{"id":"4fcce9a08ab4cb83","repo":"docker/cli","slug":"invalid-argument-w","errorCode":null,"errorMessage":"invalid argument: %w","messagePattern":"invalid argument: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/connhelper/ssh/ssh.go","lineNumber":172,"sourceCode":"\tremoteCommand, err := quoteCommand(remoteCommandAndArgs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif remoteCommand != \"\" {\n\t\tsshArgs = append(sshArgs, remoteCommand)\n\t}\n\treturn sshArgs, nil\n}\n\n// quoteCommand returns the remote command to run using the ssh connection\n// as a single string, quoting values where needed because ssh executes\n// these in a POSIX shell.\nfunc quoteCommand(commandAndArgs ...string) (string, error) {\n\tvar quotedCmd string\n\tfor i, arg := range commandAndArgs {\n\t\ta, err := syntax.Quote(arg, syntax.LangPOSIX)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"invalid argument: %w\", err)\n\t\t}\n\t\tif i == 0 {\n\t\t\tquotedCmd = a\n\t\t\tcontinue\n\t\t}\n\t\tquotedCmd += \" \" + a\n\t}\n\t// each part is quoted appropriately, so now we'll have a full\n\t// shell command to pass off to \"ssh\"\n\treturn quotedCmd, nil\n}\n","sourceCodeStart":154,"sourceCodeEnd":184,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/connhelper/ssh/ssh.go#L154-L184","documentation":"Error \"invalid argument: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/connhelper/ssh/ssh.go:172 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}