{"record":{"id":"54a57fba81841cac","repo":"larksuite/cli","slug":"s-is-empty","errorCode":null,"errorMessage":"%s is empty","messagePattern":"(.+?) is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/transport/config.go","lineNumber":190,"sourceCode":"\t\treturn false, nil\n\t}\n\tswitch s {\n\tcase \"1\", \"true\", \"on\", \"yes\", \"y\":\n\t\treturn true, nil\n\tcase \"0\", \"false\", \"off\", \"no\", \"n\":\n\t\treturn false, nil\n\t}\n\tif b, err := strconv.ParseBool(s); err == nil {\n\t\treturn b, nil\n\t}\n\treturn false, fmt.Errorf(\"invalid %s %q (want true/false/1/0)\", name, raw)\n}\n\n// proxyURL validates the fixed configured proxy configuration and returns its URL.\nfunc (c *Config) proxyURL() (*url.URL, error) {\n\traw := strings.TrimSpace(c.Proxy)\n\tif raw == \"\" {\n\t\treturn nil, fmt.Errorf(\"%s is empty\", envvars.CliProxyAddress)\n\t}\n\tredacted := redactProxyURL(raw)\n\tu, err := url.Parse(raw)\n\tif err != nil {\n\t\t// Do not wrap the raw url.Parse error: its string embeds the original\n\t\t// URL, which can contain userinfo (user:password). Return a redacted,\n\t\t// generic message instead.\n\t\treturn nil, fmt.Errorf(\"invalid %s %q: malformed URL\", envvars.CliProxyAddress, redacted)\n\t}\n\tif u.Scheme != \"http\" {\n\t\treturn nil, fmt.Errorf(\"invalid %s %q: scheme must be http\", envvars.CliProxyAddress, redacted)\n\t}\n\tif u.Host == \"\" {\n\t\treturn nil, fmt.Errorf(\"invalid %s %q: missing host\", envvars.CliProxyAddress, redacted)\n\t}\n\t// Security hardening: only allow a loopback proxy. This prevents accidental\n\t// cross-machine proxying of credentials/traffic.\n\tif u.Hostname() != \"127.0.0.1\" {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/transport/config.go#L172-L208","documentation":"proxyURL validates the fixed proxy address from LARKSUITE_CLI_PROXY_ADDRESS (or the config file). It rejects an address that is empty or whitespace-only; the message names the env var. This is fail-closed behavior: proxy-plugin mode is enabled but no usable proxy address was configured, so the CLI refuses to build the transport.","triggerScenarios":"LARKSUITE_CLI_PROXY_ENABLE=true is set (or Enable:true in proxy_config.json) while LARKSUITE_CLI_PROXY_ADDRESS is unset, exported as an empty string (`export LARKSUITE_CLI_PROXY_ADDRESS=`), or contains only spaces; then ApplyToTransport runs during command startup.","commonSituations":"Enabling the proxy plugin but forgetting to set the address; a shell profile exporting the var empty; a provisioning tool clearing the variable; config file that sets Enable:true but omits LARKSUITE_CLI_PROXY_ADDRESS.","solutions":["Set a loopback proxy address with explicit port: `export LARKSUITE_CLI_PROXY_ADDRESS=http://127.0.0.1:8080`.","If you don't have a proxy, disable plugin mode: `export LARKSUITE_CLI_PROXY_ENABLE=false` or unset it (and remove Enable:true from ~/.lark-cli/proxy_config.json).","Check that the value isn't empty-with-whitespace: `echo \"[$LARKSUITE_CLI_PROXY_ADDRESS]\"`.","In proxy_config.json, ensure both LARKSUITE_CLI_PROXY_ENABLE:true and a non-empty LARKSUITE_CLI_PROXY_ADDRESS are present together."],"exampleFix":"// before\nexport LARKSUITE_CLI_PROXY_ENABLE=true\nexport LARKSUITE_CLI_PROXY_ADDRESS=\n// after\nexport LARKSUITE_CLI_PROXY_ENABLE=true\nexport LARKSUITE_CLI_PROXY_ADDRESS=http://127.0.0.1:8080","handlingStrategy":"validation","validationCode":"if [ -n \"$LARKSUITE_CLI_PROXY_ADDRESS\" ]; then echo \"address set: $LARKSUITE_CLI_PROXY_ADDRESS\"; else echo 'LARKSUITE_CLI_PROXY_ADDRESS is empty but proxy mode may be enabled' >&2; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set LARKSUITE_CLI_PROXY_ENABLE=true without also setting a non-empty LARKSUITE_CLI_PROXY_ADDRESS.","If you don't have a proxy, disable the plugin instead of leaving the address blank.","Check provisioning scripts don't export the variable as empty.","Keep Enable and Address together in proxy_config.json."],"tags":["config","proxy","environment","validation"],"backgroundTag":"missing-config-value","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}