{"record":{"id":"4e55a54a3e58413f","repo":"juicedata/juicefs","slug":"invalid-endpoint-s-s-4e55a5","errorCode":null,"errorMessage":"Invalid endpoint %s: %s","messagePattern":"Invalid endpoint (.+?): (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/webdav.go","lineNumber":184,"sourceCode":"\t\t\tinfo.ModTime(),\n\t\t\tinfo.IsDir(),\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t})\n\t\tif len(objs) == int(limit) {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn generateListResult(objs, limit)\n}\n\nfunc newWebDAV(endpoint, user, passwd, 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.Path == \"\" {\n\t\turi.Path = \"/\"\n\t}\n\tc := gowebdav.NewClient(uri.String(), user, passwd)\n\tc.SetTransport(httpClient.Transport)\n\tc.SetHeader(\"User-Agent\", UserAgent)\n\treturn &webdav{endpoint: uri, c: c}, nil\n}\n\nfunc init() {\n\tRegister(\"webdav\", newWebDAV)\n}\n","sourceCodeStart":166,"sourceCodeEnd":198,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/webdav.go#L166-L198","documentation":"url.ParseRequestURI rejected the WebDAV endpoint after defaulting to an http:// prefix. Validation guard: the server address is not a well-formed URI (missing host, invalid characters), so the gowebdav client cannot be created.","triggerScenarios":"WebDAV storage URL whose endpoint is empty, contains illegal characters/whitespace, or is otherwise rejected by ParseRequestURI (e.g. \"http://host with space\", control characters).","commonSituations":"Unexpanded shell variables in the endpoint; spaces or quotes pasted in; missing host (e.g. just a path); wrong port syntax like \"://host:notaport\".","solutions":["Echo the endpoint and strip whitespace/quotes/control characters","Provide a valid host[:port][/path], e.g. dav.example.com:5005 or http://dav.example.com","Ensure variables in the config are actually expanded","Percent-encode special characters where needed"],"exampleFix":"// before\nwebdav://my server/dav\n// after\nwebdav://my-server/dav","handlingStrategy":"validation","validationCode":"func validWebDAVEndpoint(ep string) error {\n\tif !strings.Contains(ep, \"://\") { ep = \"http://\" + ep }\n\t_, err := url.ParseRequestURI(ep)\n\treturn err\n}","typeGuard":null,"tryCatchPattern":"_, err := object.CreateStorage(ctx, \"webdav\", url, user, pass)\nif err != nil && strings.HasPrefix(err.Error(), \"Invalid endpoint\") {\n\t// fix endpoint and retry\n}","preventionTips":["Use host[:port][/path] form without spaces","Include http(s):// explicitly to control scheme","Expand and trim config variables before use"],"tags":["webdav","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"}