{"record":{"id":"e48a9df69062ccb3","repo":"glanceapp/glance","slug":"parsing-proxy-url-v","errorCode":null,"errorMessage":"parsing proxy URL: %v","messagePattern":"parsing proxy URL: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/config-fields.go","lineNumber":218,"sourceCode":"\tvar proxyURL string\n\n\tif err := node.Decode(&proxyURL); err != nil {\n\t\tif err := node.Decode(alias); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif proxyURL == \"\" && p.URL == \"\" {\n\t\treturn nil\n\t}\n\n\tif p.URL != \"\" {\n\t\tproxyURL = p.URL\n\t}\n\n\tparsedUrl, err := url.Parse(proxyURL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parsing proxy URL: %v\", err)\n\t}\n\n\tvar timeout = defaultClientTimeout\n\tif p.Timeout > 0 {\n\t\ttimeout = time.Duration(p.Timeout)\n\t}\n\n\tp.client = &http.Client{\n\t\tTimeout: timeout,\n\t\tTransport: &http.Transport{\n\t\t\tProxy:           http.ProxyURL(parsedUrl),\n\t\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: p.AllowInsecure},\n\t\t},\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/config-fields.go#L200-L236","documentation":"Returned while building the per-widget HTTP proxy client when the proxy URL string (either the globally configured proxy URL or the field's own url) fails url.Parse with an error. This is a config-time failure: the raw error from net/url is wrapped with the 'parsing proxy URL' context. Note url.Parse is lenient — it mainly errors on control characters or unparseable escapes, so most 'invalid looking' URLs actually fail later at request time, not here.","triggerScenarios":"A widget/field with proxy configuration whose url contains control characters or malformed percent-encoding (e.g. 'http://%zz@host:port', or a value with embedded newlines from YAML folding) causing url.Parse to return a non-nil error.","commonSituations":"YAML multiline/folded scalars injecting whitespace into the URL; copy-paste artifacts with invisible control chars; malformed percent-escapes in passwords embedded in the URL.","solutions":["Re-enter the proxy URL as a clean single-line string: http://host:port or with credentials http://user:pass@host:port.","Ensure no trailing spaces, quotes-with-newlines, or tabs around the value in YAML.","Percent-encode special characters in the password (e.g. @ as %40).","Validate with `glance config:validate` to confirm parsing succeeds."],"exampleFix":"# before\nproxy:\n  url: >-\n    http://proxy.local:8080\n\n# after\nproxy:\n  url: http://proxy.local:8080","handlingStrategy":"validation","validationCode":"python3 -c \"\nfrom urllib.parse import urlparse\nurlparse('http://user:pw@proxy.local:8080')  # raises on malformed input in py via scheme checks; for Go parity:\nimport re,sys\nu='http://user:pw@proxy.local:8080'\nsys.exit(0 if re.match(r'^https?://[^\\s]+:\\d+$',u) else 1)\n\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep proxy URLs on a single YAML line, plain style.","Percent-encode special characters in inline credentials.","Prefer env vars HTTP_PROXY/HTTPS_PROXY when possible."],"tags":["config","proxy","url","validation"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}