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

  1. Open regedit → HKEY_CURRENT_USER\Environment and manually delete REQUEST_CA_BUNDLE if present
  2. Run dev-sidecar once as administrator so the registry delete succeeds
  3. Check core.log for the accompanying err detail to confirm the winreg error code
  4. 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

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


AI-assisted analysis of docmirror/dev-sidecar@7710cd56cc (2026-08-31). Data as JSON: /api/errors/c3bcafa726f7a40f. Report an issue: GitHub.