{"id":"d16d709f844ddff2","repo":"docker/cli","slug":"invalid-proto-expected-s-s","errorCode":null,"errorMessage":"invalid proto, expected %s: %s","messagePattern":"invalid proto, expected (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/hosts.go","lineNumber":86,"sourceCode":"\tcase \"npipe\":\n\t\treturn parseSimpleProtoAddr(proto, host, defaultNamedPipe)\n\tcase \"fd\":\n\t\treturn addr, nil\n\tcase \"ssh\":\n\t\treturn addr, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"invalid bind address format: %s\", addr)\n\t}\n}\n\n// parseSimpleProtoAddr parses and validates that the specified address is a valid\n// socket address for simple protocols like unix and npipe. It returns a formatted\n// socket address, either using the address parsed from addr, or the contents of\n// defaultAddr if addr is a blank string.\nfunc parseSimpleProtoAddr(proto, addr, defaultAddr string) (string, error) {\n\taddr = strings.TrimPrefix(addr, proto+\"://\")\n\tif strings.Contains(addr, \"://\") {\n\t\treturn \"\", fmt.Errorf(\"invalid proto, expected %s: %s\", proto, addr)\n\t}\n\tif addr == \"\" {\n\t\taddr = defaultAddr\n\t}\n\treturn fmt.Sprintf(\"%s://%s\", proto, addr), nil\n}\n\n// ParseTCPAddr parses and validates that the specified address is a valid TCP\n// address. It returns a formatted TCP address, either using the address parsed\n// from tryAddr, or the contents of defaultAddr if tryAddr is a blank string.\n// tryAddr is expected to have already been Trim()'d\n// defaultAddr must be in the full `tcp://host:port` form\nfunc ParseTCPAddr(tryAddr string, defaultAddr string) (string, error) {\n\tif tryAddr == \"\" || tryAddr == \"tcp://\" {\n\t\treturn defaultAddr, nil\n\t}\n\taddr := strings.TrimPrefix(tryAddr, \"tcp://\")\n\tif strings.Contains(addr, \"://\") || addr == \"\" {","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/opts/hosts.go#L68-L104","documentation":"Error \"invalid proto, expected %s: %s\" thrown in docker/cli.","triggerScenarios":"Thrown at opts/hosts.go:86 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}