{"record":{"id":"18547272cbbd6195","repo":"juicedata/juicefs","slug":"invalid-endpoint-s-s-185472","errorCode":null,"errorMessage":"invalid endpoint %s: %s","messagePattern":"invalid endpoint (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/eos.go","lineNumber":60,"sourceCode":"}\n\nfunc (s *eos) Limits() Limits {\n\treturn Limits{\n\t\tIsSupportMultipartUpload: true,\n\t\tIsSupportUploadPartCopy:  true,\n\t\tMinPartSize:              4 << 20,\n\t\tMaxPartSize:              5 << 30,\n\t\tMaxPartCount:             10000,\n\t}\n}\n\nfunc newEos(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\tendpoint = uri.Scheme + \"://\" + uri.Host[len(bucket)+1:]\n\tregion := \"us-east-1\"\n\n\tif accessKey == \"\" {\n\t\taccessKey = os.Getenv(\"EOS_ACCESS_KEY\")\n\t}\n\tif secretKey == \"\" {\n\t\tsecretKey = os.Getenv(\"EOS_SECRET_KEY\")\n\t}\n\tif token == \"\" {\n\t\ttoken = os.Getenv(\"EOS_TOKEN\")\n\t}\n\tcfg, err := config.LoadDefaultConfig(ctx, append(defaultChecksumOpts(),\n\t\tconfig.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(accessKey, secretKey, token)))...)","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/eos.go#L42-L78","documentation":"Returned by newEos when the EOS (EMC Elastic Object Storage) endpoint cannot be parsed as a URL after defaulting to https. A valid endpoint like https://bucket.eosendpoint is required; the wrapped parse error identifies the malformed part.","triggerScenarios":"Calling newEos (via createStorage with the 'eos' storage type, or TestEOS) with an endpoint string that url.ParseRequestURI cannot parse — e.g. empty string, spaces, stray colon-only authority, or malformed characters.","commonSituations":"Environment variable or CLI flag left empty; endpoint containing whitespace or unescaped characters; config template not substituted (literal '$ENDPOINT'); missing scheme is fine (https:// is prepended) but truly invalid URIs are not.","solutions":["Set the endpoint to a valid URL like 'eos-name.ctyun.cn' or 'https://eos-name.ctyun.cn' (scheme is optional but content must be a parseable URI)","Trim whitespace/quotes from the config value or env var","Check for unexpanded template variables in the config file","URL-escape any special characters in the endpoint"],"exampleFix":"// before\nstore, err := createStorage(\"eos\", \"\", accessKey, secretKey) // invalid endpoint :\n// after\nstore, err := createStorage(\"eos\", \"eos.eu-west-1.outscale.com\", accessKey, secretKey)","handlingStrategy":"validation","validationCode":"u, err := url.ParseRequestURI(strings.TrimSpace(endpoint))\nif err != nil || u.Host == \"\" {\n\treturn fmt.Errorf(\"endpoint %q is not a valid URL\", endpoint)\n}","typeGuard":"func validEndpoint(s string) bool { _, err := url.ParseRequestURI(strings.TrimSpace(s)); return err == nil }","tryCatchPattern":"store, err := createStorage(\"eos\", endpoint, ak, sk)\nif err != nil && strings.HasPrefix(err.Error(), \"invalid endpoint\") {\n\t// fix endpoint in config/env, then retry\n}","preventionTips":["Trim quotes/whitespace from endpoint config values","Use a config schema check (or dry-run) that validates URLs before connecting","Prefer full https:// URLs to avoid scheme-guessing surprises","Verify env vars are actually set (no empty $ENDPOINT expansion) before launch"],"tags":["object-storage","eos","url-parsing","config"],"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"}