{"record":{"id":"bf18e5aef8460865","repo":"goharbor/harbor","slug":"failed-to-parse-the-url-of-registry-v","errorCode":null,"errorMessage":"failed to parse the URL of registry: %v","messagePattern":"failed to parse the URL of registry: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/server/registry/proxy.go","lineNumber":33,"sourceCode":"package registry\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"net/url\"\n\n\tcommonhttp \"github.com/goharbor/harbor/src/common/http\"\n\t\"github.com/goharbor/harbor/src/lib/config\"\n)\n\nvar proxy = newProxy()\n\nfunc newProxy() http.Handler {\n\tregURL, _ := config.RegistryURL()\n\turl, err := url.Parse(regURL)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to parse the URL of registry: %v\", err))\n\t}\n\tproxy := httputil.NewSingleHostReverseProxy(url)\n\t// The reverse proxy forwards all /v2/ traffic to a single host (the registry),\n\t// so it deserves a dedicated transport with a large per-host idle connection\n\t// pool. Relying on http.DefaultTransport (MaxIdleConnsPerHost=2) closes almost\n\t// every connection after use under high concurrency, piling up TIME_WAIT\n\t// sockets and eventually exhausting ephemeral ports (EADDRNOTAVAIL).\n\topts := []func(*http.Transport){\n\t\tfunc(tr *http.Transport) {\n\t\t\ttr.MaxIdleConns = 1024\n\t\t\ttr.MaxIdleConnsPerHost = 1024\n\t\t},\n\t}\n\tif commonhttp.InternalTLSEnabled() {\n\t\topts = append(opts, commonhttp.WithInternalTLSConfig())\n\t}\n\tproxy.Transport = commonhttp.NewTransport(opts...)\n","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/registry/proxy.go#L15-L51","documentation":"Error \"failed to parse the URL of registry: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/registry/proxy.go:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}