{"record":{"id":"9903c8a1274e8162","repo":"siyuan-note/siyuan","slug":"invalid-system-proxy-address","errorCode":null,"errorMessage":"invalid system proxy address","messagePattern":"invalid system proxy address","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/util/system_proxy.go","lineNumber":103,"sourceCode":"\t\t}\n\t\tif \"\" == ret.HTTPSProxy {\n\t\t\tret.HTTPSProxy = socksProxy\n\t\t}\n\t}\n\tif \"\" == ret.HTTPProxy && \"\" == ret.HTTPSProxy {\n\t\treturn nil, fmt.Errorf(\"system proxy does not contain a supported HTTP, HTTPS or SOCKS proxy\")\n\t}\n\treturn ret, nil\n}\n\nfunc normalizeSystemNetworkProxyURL(address, defaultScheme string) (string, error) {\n\taddress = strings.TrimSpace(address)\n\tif !strings.Contains(address, \"://\") {\n\t\taddress = defaultScheme + \"://\" + address\n\t}\n\tproxyURL, err := url.Parse(address)\n\tif err != nil || \"\" == proxyURL.Host {\n\t\treturn \"\", fmt.Errorf(\"invalid system proxy address\")\n\t}\n\tswitch strings.ToLower(proxyURL.Scheme) {\n\tcase \"http\", \"https\", \"socks5\", \"socks5h\":\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unsupported system proxy protocol [%s]\", proxyURL.Scheme)\n\t}\n\treturn proxyURL.String(), nil\n}\n\nfunc parseSystemNetworkProxyBypass(proxyOverride string) string {\n\tentries := []string{}\n\tseen := map[string]bool{}\n\tadd := func(entry string) {\n\t\tif \"\" != entry && !seen[entry] {\n\t\t\tentries = append(entries, entry)\n\t\t\tseen[entry] = true\n\t\t}\n\t}","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/util/system_proxy.go#L85-L121","documentation":"normalizeSystemNetworkProxyURL parses a proxy address (adding a default scheme when missing) and validates that it has a host. An address that fails url.Parse or yields an empty Host is rejected as an invalid system proxy address.","triggerScenarios":"parseSystemNetworkProxy encounters a proxy string like \"://host\", \"http://\" (no host), or text that url.Parse cannot handle, producing an empty/invalid host.","commonSituations":"Malformed ProxyServer registry value; stray whitespace-only entry; copy-paste of a proxy URL missing its host part; locale-mangled characters in the address.","solutions":["Provide a complete proxy address with host and port, e.g. http://127.0.0.1:8080","Trim whitespace and remove stray characters from the proxy setting","Ensure the port is numeric and the URL is well-formed"],"exampleFix":"// before\nproxyServer = \"http://\"\n// after\nproxyServer = \"http://127.0.0.1:8080\"","handlingStrategy":"validation","validationCode":"u, err := url.Parse(strings.TrimSpace(addr)); if err != nil || u.Host == \"\" { /* fix address before use */ }","typeGuard":null,"tryCatchPattern":"if _, err := normalizeSystemNetworkProxyURL(addr, \"http\"); err != nil { /* prompt user to correct the proxy address */ }","preventionTips":["Always include host:port in proxy addresses","Trim whitespace before storing proxy settings","Test the address with url.Parse during configuration entry"],"tags":["proxy","url-parse","system-config"],"backgroundTag":"invalid-url-format","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}