docmirror/dev-sidecar · warning
删除环境变量 REQUEST_CA_BUNDLE 失败:
Error message
删除环境变量 REQUEST_CA_BUNDLE 失败:
What it means
This is a log.warn, not a thrown error. On Windows, when clearing the previous proxy environment variables, set-system-proxy tries to delete the REQUEST_CA_BUNDLE registry value (HKCU Environment); if the registry removal API returns an error, the failure is only logged. Proxying still proceeds; residual env vars may affect child processes that honor REQUEST_CA_BUNDLE.
Source
Thrown at packages/core/src/shell/scripts/set-system-proxy/index.js:562
await exec('setx DS_REFRESH "1"')
}
})
}
})
regKey.get('HTTP_PROXY', (err) => {
if (!err) {
regKey.remove('HTTP_PROXY', async (err) => {
if (err) {
log.warn('删除环境变量 HTTP_PROXY 失败:', err)
}
})
}
})
regKey.get('REQUEST_CA_BUNDLE', (err) => {
if (!err) {
regKey.remove('REQUEST_CA_BUNDLE', async (err) => {
if (err) {
log.warn('删除环境变量 REQUEST_CA_BUNDLE 失败:', err)
}
})
}
})
} catch (e) {
log.error('删除环境变量 HTTPS_PROXY、HTTP_PROXY 失败:', e)
}
return true
}
},
async linux (exec, params = {}) {
const { ip, port, setEnv } = params
if (ip != null) { // 设置代理
// 延迟加载config
loadConfig()
// 设置环境变量(独立于 gsettings,即使 gsettings 失败也设置)View on GitHub (pinned to 7710cd56cc)
Solutions
- Open regedit → HKEY_CURRENT_USER\Environment and manually delete REQUEST_CA_BUNDLE if present
- Run dev-sidecar once as administrator so the registry delete succeeds
- Check core.log for the accompanying err detail to confirm the winreg error code
- If the value doesn't exist in regedit, the warning is benign — ignore it
Defensive patterns
Strategy: fallback
Try / catch
// The library only warns; verify cleanup yourself after setting system proxy:
regKey.get('REQUEST_CA_BUNDLE', (err) => {
if (!err) console.warn('REQUEST_CA_BUNDLE still present; delete manually via regedit or elevated run')
}) Prevention
- Run set-system-proxy with sufficient privileges on Windows (elevated once is enough for HKCU writes)
- Check core.log after proxy changes for registry warnings
- Avoid running two dev-sidecar instances concurrently that both mutate HKCU Environment
- Audit HKEY_CURRENT_USER\Environment for stale REQUEST_CA_BUNDLE/HTTPS_PROXY values after uninstalling
When it happens
Trigger: Running the Windows branch of setSystemProxy (clear/set phase) when the HKCU Environment key lacks proper permissions, the value was concurrently removed, or the winreg handle reports an access/IO error on remove.
Common situations: Corporate machines with restricted registry permissions; antivirus blocking registry writes; the variable already deleted by another instance running simultaneously.
Related errors
- 没有找到占用该端口的进程
- 未找到处于 LISTENING 状态的进程
- 终止占用端口 ${port} 的进程失败。 PowerShell 方案: ${psError.message} CMD
- 证书路径为空,无法安装根证书。请确认证书文件已生成。
- 证书文件不存在: ${certPath}
AI-assisted analysis of docmirror/dev-sidecar@7710cd56cc (2026-08-31).
Data as JSON: /api/errors/c3bcafa726f7a40f.
Report an issue: GitHub.