Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logs.disabled = true does not work with raw_exec on Windows #17148

Closed
schmichael opened this issue May 10, 2023 · 2 comments · Fixed by #17199
Closed

logs.disabled = true does not work with raw_exec on Windows #17148

schmichael opened this issue May 10, 2023 · 2 comments · Fixed by #17199

Comments

@schmichael
Copy link
Member

Discovered due to #17131

Nomad version

Nomad 1.5.5 amd64

Operating system and Environment details

Windows 11 Enterprise
Version: 22H2
OS Build: 22621.1105

Issue

Using logs.disabled = true with a raw_exec task on Windows prevents the task from starting with the following task event:

Driver Failure: failed to launch command with executor:
rpc error: code = Unknown
desc = failed to create stdout: The parameter is incorrect

Reproduction steps

Short example job with:

task "redis" {
  driver = "raw_exec"
  logs { disabled = true }
  config {
    command = "powershell.exe"
    args = ["echo hello; sleep 9000"]
  }
}

Expected Result

Task runs with empty logs.

Actual Result

Task fails to start with driver failure above.

Nomad Client logs (if appropriate)

Prior to the executor exiting it logs:

client.driver_mgr.raw_exec.executor.stdio: received EOF, stopping recv loop: alloc_id=... driver=raw_exec task_name=redis err="rpc error: code = Unavailable desc = error reading from server: EOF"

Sorry I can't include full snippets. Trying to copy and paste out of my Windows VM to Chrome on my host causes Chrome to crash and lose all my edits. 😞

tgross added a commit that referenced this issue May 15, 2023
On Windows the executor returns an error when trying to open the `NUL` device
when we pass it `os.DevNull` for the stdout/stderr paths. Instead of opening the
device, use the discard pipe so that we have platform-specific behavior from the
executor itself.

Fixes: #17148
@tgross
Copy link
Member

tgross commented May 15, 2023

I've got a draft PR up in #17199 that I think might fix this by using io.Discard instead of the NUL device so that we get platform specific behavior from the stdlib. I need to work up a test before I'll be ready to get that reviewed.

@tgross tgross self-assigned this May 15, 2023
tgross added a commit that referenced this issue May 18, 2023
On Windows the executor returns an error when trying to open the `NUL` device
when we pass it `os.DevNull` for the stdout/stderr paths. Instead of opening the
device, use the discard pipe so that we have platform-specific behavior from the
executor itself.

Fixes: #17148
tgross added a commit that referenced this issue May 18, 2023
On Windows the executor returns an error when trying to open the `NUL` device
when we pass it `os.DevNull` for the stdout/stderr paths. Instead of opening the
device, use the discard pipe so that we have platform-specific behavior from the
executor itself.

Fixes: #17148
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants