You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows requires that stderr is an empty string when running a container with TTY. In Containerd, pkg/cio/io.go#L298-L302, the Stderr is set to a value, e.g.
To address this issue related to nerdctl, we can refactor the TerminalLogURI() function. This will involve adding an optional parameter that specifies whether stderr should be set to an empty string when the terminal is used. This change will help avoid the "failed precondition" error when creating a new task on Windows.
Example:
funcTerminalLogURI(uri*url.URL, setStderr...bool) Creator {
returnfunc(_string) (IO, error) {
// Default value for Stderr is an ampty stringstderr:=""iflen(setStderr) >0&&setStderr[0] {
stderr=uri.String()
}
return&logURI{
config: Config{
Stdout: uri.String(),
Stderr: stderr,
Terminal: true,
},
}, nil
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Windows requires that stderr is an empty string when running a container with TTY. In Containerd, pkg/cio/io.go#L298-L302, the Stderr is set to a value, e.g.
which causes microsoft/hcsshim service_internal.go#L127 to fail to create a new task.
containerd/pkg/cio/io.go
Lines 298 to 302 in 4a18adc
To address this issue related to nerdctl, we can refactor the TerminalLogURI() function. This will involve adding an optional parameter that specifies whether stderr should be set to an empty string when the terminal is used. This change will help avoid the "failed precondition" error when creating a new task on Windows.
Example:
Related issues:
nerdctl bug #2966
Beta Was this translation helpful? Give feedback.
All reactions