{"record":{"id":"c3bcafa726f7a40f","repo":"docmirror/dev-sidecar","slug":"request-ca-bundle","errorCode":null,"errorMessage":"删除环境变量 REQUEST_CA_BUNDLE 失败:","messagePattern":"删除环境变量 REQUEST_CA_BUNDLE 失败:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/shell/scripts/set-system-proxy/index.js","lineNumber":562,"sourceCode":"                await exec('setx DS_REFRESH \"1\"')\n              }\n            })\n          }\n        })\n        regKey.get('HTTP_PROXY', (err) => {\n          if (!err) {\n            regKey.remove('HTTP_PROXY', async (err) => {\n              if (err) {\n                log.warn('删除环境变量 HTTP_PROXY 失败:', err)\n              }\n            })\n          }\n        })\n        regKey.get('REQUEST_CA_BUNDLE', (err) => {\n          if (!err) {\n            regKey.remove('REQUEST_CA_BUNDLE', async (err) => {\n              if (err) {\n                log.warn('删除环境变量 REQUEST_CA_BUNDLE 失败:', err)\n              }\n            })\n          }\n        })\n      } catch (e) {\n        log.error('删除环境变量 HTTPS_PROXY、HTTP_PROXY 失败:', e)\n      }\n\n      return true\n    }\n  },\n  async linux (exec, params = {}) {\n    const { ip, port, setEnv } = params\n    if (ip != null) { // 设置代理\n      // 延迟加载config\n      loadConfig()\n\n      // 设置环境变量（独立于 gsettings，即使 gsettings 失败也设置）","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/docmirror/dev-sidecar/blob/7710cd56cce760c708f30b01d2d4056eb8c402d5/packages/core/src/shell/scripts/set-system-proxy/index.js#L544-L580","documentation":"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.","triggerScenarios":"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.","commonSituations":"Corporate machines with restricted registry permissions; antivirus blocking registry writes; the variable already deleted by another instance running simultaneously.","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"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// The library only warns; verify cleanup yourself after setting system proxy:\nregKey.get('REQUEST_CA_BUNDLE', (err) => {\n  if (!err) console.warn('REQUEST_CA_BUNDLE still present; delete manually via regedit or elevated run')\n})","preventionTips":["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"],"tags":["windows","registry","environment-variable"],"backgroundTag":"registry-delete-failed","analyzedSha":"7710cd56cce760c708f30b01d2d4056eb8c402d5","analyzedAt":"2026-08-31T22:07:07.234Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}