{"record":{"id":"9606a2dd8ebb4c4f","repo":"juicedata/juicefs","slug":"invalid-endpoint-s-s-9606a2","errorCode":null,"errorMessage":"Invalid endpoint %s: %s","messagePattern":"Invalid endpoint (.+?): (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/wasabi.go","lineNumber":56,"sourceCode":"\nfunc (s *wasabi) String() string {\n\treturn fmt.Sprintf(\"wasabi://%s/\", s.s3client.bucket)\n}\n\nfunc (s *wasabi) InitTiers(_ Tiers) error {\n\tif err := s.tierStorage.InitTiers(nil); err != nil {\n\t\treturn err\n\t}\n\treturn notSupported\n}\n\nfunc newWasabi(endpoint, accessKey, secretKey, token string) (ObjectStorage, error) {\n\tif !strings.Contains(endpoint, \"://\") {\n\t\tendpoint = fmt.Sprintf(\"https://%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\tssl := strings.ToLower(uri.Scheme) == \"https\"\n\thostParts := strings.Split(uri.Host, \".\")\n\tbucket := hostParts[0]\n\tregion := hostParts[2]\n\tendpoint = uri.Scheme + \"://\" + uri.Host[len(bucket)+1:]\n\n\tawsCfg, err := config.LoadDefaultConfig(ctx, append(defaultChecksumOpts(),\n\t\tconfig.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(accessKey, secretKey, token)))...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to load config: %s\", err)\n\t}\n\tclient := s3.NewFromConfig(awsCfg, func(options *s3.Options) {\n\t\toptions.Region = region\n\t\toptions.BaseEndpoint = aws.String(endpoint)\n\t\toptions.EndpointOptions.DisableHTTPS = !ssl\n\t\toptions.UsePathStyle = false\n\t\toptions.HTTPClient = httpClient","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/wasabi.go#L38-L74","documentation":"Returned by newWasabi when the Wasabi endpoint URL cannot be parsed after defaulting to https. A valid endpoint is like https://bucket.s3.region.wasabisys.com; the wrapped parse error pinpoints the defect.","triggerScenarios":"Wasabi storage URL with an unparseable endpoint: empty value, illegal characters, stray whitespace, or a scheme-only/garbage string.","commonSituations":"Typo in the endpoint in juicefs format/mount; unexpanded shell or template variable; quotes/spaces pasted into the config; forgetting the host entirely.","solutions":["Inspect the endpoint string for whitespace or invalid characters","Use a valid host form, e.g. s3.us-west-1.wasabisys.com or with https:// scheme","Ensure the variable holding the endpoint is actually expanded","Percent-encode special characters if they must be present"],"exampleFix":"// before\n--storage-endpoint \"$WASABI_ENDPOINT\"  # empty -> https://\n// after\n--storage-endpoint \"s3.us-west-1.wasabisys.com\"","handlingStrategy":"validation","validationCode":"func validWasabiEndpoint(ep string) error {\n\tif !strings.Contains(ep, \"://\") { ep = \"https://\" + ep }\n\t_, err := url.ParseRequestURI(ep)\n\treturn err\n}","typeGuard":null,"tryCatchPattern":"_, err := object.CreateStorage(ctx, \"wasabi\", url, ak, sk)\nif err != nil && strings.HasPrefix(err.Error(), \"Invalid endpoint\") {\n\t// correct endpoint and retry\n}","preventionTips":["Trim whitespace and quotes from endpoints","Use known Wasabi hostnames like s3.<region>.wasabisys.com","Expand config variables before passing them"],"tags":["wasabi","endpoint","url-parse","object-storage"],"backgroundTag":"invalid-url","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}