{"record":{"id":"92730bb9f0180c08","repo":"juicedata/juicefs","slug":"invalid-endpoint-s-s-92730b","errorCode":null,"errorMessage":"Invalid endpoint %s: %s","messagePattern":"Invalid endpoint (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/minio.go","lineNumber":67,"sourceCode":"}\n\nfunc (m *minio) Limits() Limits {\n\treturn Limits{\n\t\tIsSupportMultipartUpload: true,\n\t\tIsSupportUploadPartCopy:  true,\n\t\tMinPartSize:              5 << 20,\n\t\tMaxPartSize:              5 << 30,\n\t\tMaxPartCount:             10000,\n\t}\n}\n\nfunc newMinio(endpoint, accessKey, secretKey, 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\tssl := strings.ToLower(uri.Scheme) == \"https\"\n\tregion := uri.Query().Get(\"region\")\n\tif region == \"\" {\n\t\tregion = os.Getenv(\"MINIO_REGION\")\n\t}\n\tif region == \"\" {\n\t\tregion = awsDefaultRegion\n\t}\n\tif accessKey == \"\" {\n\t\taccessKey = os.Getenv(\"MINIO_ACCESS_KEY\")\n\t}\n\tif secretKey == \"\" {\n\t\tsecretKey = os.Getenv(\"MINIO_SECRET_KEY\")\n\t}\n\tvar cfg aws.Config\n\tif accessKey != \"\" {\n\t\tcfg, err = config.LoadDefaultConfig(ctx, append(defaultChecksumOpts(),","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/minio.go#L49-L85","documentation":"newMinio parses the endpoint with url.ParseRequestURI after defaulting the scheme to http. If parsing fails, the endpoint string is not a valid absolute URI (bad scheme, control characters, empty string, etc.) and the constructor returns this wrapped parse error including the underlying url.Error text.","triggerScenarios":"Creating a MinIO object store with an unparseable endpoint, e.g. an empty endpoint, 'http://[bad-ipv6', an endpoint containing spaces, or a scheme with invalid characters.","commonSituations":"Config interpolation leaving an empty or malformed URL; unquoted shell variables stripping characters; IPv6 endpoints missing brackets.","solutions":["Inspect the endpoint value in the error and fix the malformed URL syntax (wrap IPv6 hosts in brackets: 'http://[::1]:9000').","Ensure the endpoint is a non-empty absolute URL with scheme://host[:port].","Quote shell variables and check that environment/config substitution isn't mangling the value."],"exampleFix":"// before\nendpoint := \"http://::1:9000\" // unparseable\n// after\nendpoint := \"http://[::1]:9000\"","handlingStrategy":"validation","validationCode":"u, err := url.ParseRequestURI(endpoint)\nif err != nil || u.Host == \"\" {\n\treturn fmt.Errorf(\"endpoint %q is not a valid absolute URL\", endpoint)\n}","typeGuard":null,"tryCatchPattern":"store, err := newMinio(endpoint, ak, sk, \"\")\nif err != nil && strings.Contains(err.Error(), \"Invalid endpoint\") {\n\treturn fmt.Errorf(\"fix minio endpoint %q: %w\", endpoint, err)\n}","preventionTips":["Always specify scheme://host[:port] explicitly.","Bracket IPv6 literals in the host part.","Quote variables in shell/config templates to avoid character loss."],"tags":["object-storage","url","minio"],"backgroundTag":"invalid-url","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"}