{"id":"71dbb4bf4af96184","repo":"docker/cli","slug":"invalid-ssh-url-w","errorCode":null,"errorMessage":"invalid SSH URL: %w","messagePattern":"invalid SSH URL: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/connhelper/ssh/ssh.go","lineNumber":22,"sourceCode":"import (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/docker/cli/cli/connhelper/internal/syntax\"\n)\n\n// ParseURL creates a [Spec] from the given ssh URL. It returns an error if\n// the URL is using the wrong scheme, contains fragments, query-parameters,\n// or contains a password.\nfunc ParseURL(daemonURL string) (*Spec, error) {\n\tu, err := url.Parse(daemonURL)\n\tif err != nil {\n\t\tvar urlErr *url.Error\n\t\tif errors.As(err, &urlErr) {\n\t\t\terr = urlErr.Unwrap()\n\t\t}\n\t\treturn nil, fmt.Errorf(\"invalid SSH URL: %w\", err)\n\t}\n\treturn NewSpec(u)\n}\n\n// NewSpec creates a [Spec] from the given ssh URL's properties. It returns\n// an error if the URL is using the wrong scheme, contains fragments,\n// query-parameters, or contains a password.\nfunc NewSpec(sshURL *url.URL) (*Spec, error) {\n\ts, err := newSpec(sshURL)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid SSH URL: %w\", err)\n\t}\n\treturn s, nil\n}\n\nfunc newSpec(u *url.URL) (*Spec, error) {\n\tif u == nil {\n\t\treturn nil, errors.New(\"URL is nil\")","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/connhelper/ssh/ssh.go#L4-L40","documentation":"Error \"invalid SSH URL: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/connhelper/ssh/ssh.go:22 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}