{"record":{"id":"bf9fa0e8989c7cb6","repo":"juicedata/juicefs","slug":"invalid-endpoint-s-s","errorCode":null,"errorMessage":"Invalid endpoint %s: %s","messagePattern":"Invalid endpoint (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/ceph.go","lineNumber":336,"sourceCode":"\t\t\t\tbreak\n\t\t\t} else if results[j] != nil {\n\t\t\t\tobjs <- results[j]\n\t\t\t}\n\t\t\tready[j] = false\n\t\t\tconds[j].Signal()\n\t\t\tms[j].Unlock()\n\t\t}\n\t}()\n\treturn objs, nil\n}\n\nfunc newCeph(endpoint, cluster, user, token string) (ObjectStorage, error) {\n\tif !strings.Contains(endpoint, \"://\") {\n\t\tendpoint = fmt.Sprintf(\"ceph://%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\tname := uri.Host\n\tconn, err := rados.NewConnWithClusterAndUser(cluster, user)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Can't create connection to cluster %s for user %s: %s\", cluster, user, err)\n\t}\n\tif opt := os.Getenv(\"CEPH_ADMIN_SOCKET\"); opt != \"none\" {\n\t\tif opt == \"\" {\n\t\t\topt = \"$run_dir/jfs-$cluster-$name-$pid.asok\"\n\t\t}\n\t\tif err = conn.SetConfigOption(\"admin_socket\", opt); err != nil {\n\t\t\tlogger.Warnf(\"Failed to set admin_socket to %s: %s\", opt, err)\n\t\t}\n\t}\n\tif opt := os.Getenv(\"CEPH_LOG_FILE\"); opt != \"none\" {\n\t\tif opt == \"\" {\n\t\t\topt = \"/var/log/ceph/jfs-$cluster-$name.log\"\n\t\t}","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/ceph.go#L318-L354","documentation":"newCeph wraps the endpoint in a ceph:// scheme and parses it with url.ParseRequestURI. If parsing fails, the endpoint is not a valid absolute URI and the Ceph object-store constructor aborts with this message.","triggerScenarios":"Passing an unparseable endpoint (empty, spaces, invalid characters) to the ceph object storage constructor, e.g. via --storage-endpoint ceph://... configuration.","commonSituations":"Malformed monitor/endpoint string in config; empty endpoint after env-var interpolation; copy-paste artifacts (quotes, trailing slashes with spaces).","solutions":["Provide a valid endpoint that parses as a URI, e.g. ceph://mon1.example.com","Remove whitespace, quotes, or invalid URL characters from the endpoint","Ensure the endpoint is non-empty in your storage config"],"exampleFix":"// before\nnewCeph(\"mon1 mon2\", \"mycluster\", \"admin\", \"\")\n// after\nnewCeph(\"mon1.example.com\", \"mycluster\", \"admin\", \"\")","handlingStrategy":"validation","validationCode":"// Go\nu, err := url.ParseRequestURI(endpoint)\nif err != nil || u.Host == \"\" {\n    return fmt.Errorf(\"invalid ceph endpoint: %q\", endpoint)\n}","typeGuard":null,"tryCatchPattern":"// Go\nobj, err := object.NewCeph(endpoint, cluster, user, token)\nif err != nil && strings.Contains(err.Error(), \"Invalid endpoint\") {\n    log.Fatalf(\"fix ceph endpoint in config: %v\", err)\n}","preventionTips":["Use ceph://host endpoints free of spaces and invalid URL characters","Validate storage endpoints at config-load time","Avoid env-interpolation that can silently produce empty endpoint strings"],"tags":["object-storage","ceph","url-parsing","configuration"],"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"}