{"id":"e45f963228775a29","repo":"docker/cli","slug":"failed-to-open-the-raw-stream-connection-w","errorCode":null,"errorMessage":"failed to open the raw stream connection: %w","messagePattern":"failed to open the raw stream connection: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/system/dial_stdio.go","lineNumber":39,"sourceCode":"\t\tArgs:   cli.NoArgs,\n\t\tHidden: true,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn runDialStdio(cmd.Context(), dockerCLI)\n\t\t},\n\t\tValidArgsFunction:     cobra.NoFileCompletions,\n\t\tDisableFlagsInUseLine: true,\n\t}\n\treturn cmd\n}\n\nfunc runDialStdio(ctx context.Context, dockerCli command.Cli) error {\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\tdialer := dockerCli.Client().Dialer()\n\tconn, err := dialer(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to open the raw stream connection: %w\", err)\n\t}\n\tdefer conn.Close()\n\n\tvar connHalfCloser halfCloser\n\tswitch t := conn.(type) {\n\tcase halfCloser:\n\t\tconnHalfCloser = t\n\tcase halfReadWriteCloser:\n\t\tconnHalfCloser = &nopCloseReader{t}\n\tdefault:\n\t\treturn errors.New(\"the raw stream connection does not implement halfCloser\")\n\t}\n\n\tstdin2conn := make(chan error, 1)\n\tconn2stdout := make(chan error, 1)\n\tgo func() {\n\t\tstdin2conn <- copier(connHalfCloser, &halfReadCloserWrapper{os.Stdin}, \"stdin to stream\")\n\t}()","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/system/dial_stdio.go#L21-L57","documentation":"Error \"failed to open the raw stream connection: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/system/dial_stdio.go:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}