{"record":{"id":"26746c58aacba943","repo":"juicedata/juicefs","slug":"invalid-host-s","errorCode":null,"errorMessage":"Invalid host: %s","messagePattern":"Invalid host: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/swift.go","lineNumber":141,"sourceCode":"\t\t\"\",\n\t}, err\n}\n\nfunc newSwiftOSS(endpoint, username, apiKey, token string) (ObjectStorage, error) {\n\tif !strings.Contains(endpoint, \"://\") {\n\t\tendpoint = fmt.Sprintf(\"http://%s\", endpoint)\n\t}\n\turi, err := url.ParseRequestURI(endpoint)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Invalid endpoint %s: %s\", endpoint, err)\n\t}\n\tif uri.Scheme != \"http\" && uri.Scheme != \"https\" {\n\t\treturn nil, fmt.Errorf(\"Invalid uri.Scheme: %s\", uri.Scheme)\n\t}\n\n\thostSlice := strings.SplitN(uri.Host, \".\", 2)\n\tif len(hostSlice) != 2 {\n\t\treturn nil, fmt.Errorf(\"Invalid host: %s\", uri.Host)\n\t}\n\tcontainer := hostSlice[0]\n\thost := hostSlice[1]\n\n\t// current only support V1 authentication\n\tauthURL := uri.Scheme + \"://\" + host + \"/auth/v1.0\"\n\n\tconn := swift.Connection{\n\t\tUserName:  username,\n\t\tApiKey:    apiKey,\n\t\tAuthToken: token,\n\t\tAuthUrl:   authURL,\n\t\tUserAgent: UserAgent,\n\t\tTransport: httpClient.Transport.(*http.Transport),\n\t}\n\terr = conn.Authenticate(context.Background())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Auth: %s\", err)","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/swift.go#L123-L159","documentation":"Returned by newSwiftOSS when the endpoint host does not contain a dot separating the container name from the auth host — the Swift endpoint convention is container.authhost, so a single-label host leaves the container undefined.","triggerScenarios":"Thrown at pkg/object/swift.go:141 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Format the endpoint as container.auth.domain so the container prefix can be extracted"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}