{"record":{"id":"e2060cc9ef3ad457","repo":"docmirror/dev-sidecar","slug":"gsettings","errorCode":null,"errorMessage":"gsettings 设置系统代理失败（可能无桌面环境），环境变量已设置","messagePattern":"gsettings 设置系统代理失败（可能无桌面环境），环境变量已设置","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/shell/scripts/set-system-proxy/index.js","lineNumber":608,"sourceCode":"        `gsettings set org.gnome.system.proxy.https port ${port}`,\n      ]\n      // http\n      if (config.get().proxy.proxyHttp) {\n        setProxyCmd.push(`gsettings set org.gnome.system.proxy.http host ${ip}`)\n        setProxyCmd.push(`gsettings set org.gnome.system.proxy.http port ${port - 1}`)\n      } else {\n        setProxyCmd.push('gsettings set org.gnome.system.proxy.http host \\'\\'')\n        setProxyCmd.push('gsettings set org.gnome.system.proxy.http port 0')\n      }\n\n      // 设置排除域名（ignore-hosts）\n      const excludeIpStr = getProxyExcludeIpStr('\\', \\'')\n      setProxyCmd.push(`gsettings set org.gnome.system.proxy ignore-hosts \"['${excludeIpStr}']\"`)\n\n      try {\n        await exec(setProxyCmd)\n      } catch (e) {\n        log.warn('gsettings 设置系统代理失败（可能无桌面环境），环境变量已设置')\n      }\n    } else { // 关闭代理\n      if (setEnv) {\n        removeProxyEnvFromShellProfile()\n      }\n\n      try {\n        await exec(['gsettings set org.gnome.system.proxy mode none'])\n      } catch (e) {\n        log.warn('gsettings 关闭系统代理失败（可能无桌面环境）')\n      }\n    }\n  },\n  async mac (exec, params = {}) {\n    const wifiAdaptor = await getMacNetworkService(exec)\n    const { ip, port, setEnv } = params\n\n    let cmds","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/docmirror/dev-sidecar/blob/7710cd56cce760c708f30b01d2d4056eb8c402d5/packages/core/src/shell/scripts/set-system-proxy/index.js#L590-L626","documentation":"Non-fatal warning in the Linux system-proxy setter. Environment variables (HTTP_PROXY/HTTPS_PROXY via proxy.env + shell profile) are always set first; then the code applies the GNOME desktop proxy with a batch of `gsettings set org.gnome.system.proxy ...` commands. If that exec fails, this warning notes that the desktop-level proxy could not be applied (most commonly because there is no GNOME/desktop session or dconf available) but the environment-variable proxy is still in effect, so the function does not throw.","triggerScenarios":"executor.linux() with ip != null: `gsettings` binary absent, no D-Bus session (running via SSH, systemd service, cron, or headless server), dconf backend unavailable, or GSETTINGS_SCHEMA_DIR/dconf permission problems.","commonSituations":"SSH or headless Linux boxes where users expect only terminal proxy (env vars) — this warning is expected and harmless; WSL without GUI; minimal window managers (i3/sway) without gnome-settings-daemon; containers.","solutions":["If running headless intentionally, ignore this warning — CLI/terminal tools still get the proxy through HTTP(S)_PROXY environment variables (source the printed shell profile)","To make gsettings work, launch DevSidecar inside a desktop session with D-Bus (check `echo $DBUS_SESSION_BUS_ADDRESS` and `which gsettings`)","Verify manually with `gsettings set org.gnome.system.proxy mode manual` in the same session; if that fails, install dconf/gsettings (e.g. `apt install gsettings-desktop-schemas dconf-cli`)","For non-GNOME desktops (KDE, i3), set the desktop proxy via the DE's own settings; DevSidecar only automates GNOME"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const { execSync } = require('node:child_process')\nfunction gsettingsAvailable() {\n  try {\n    execSync('gsettings get org.gnome.system.proxy mode', { stdio: 'ignore' })\n    return Boolean(process.env.DBUS_SESSION_BUS_ADDRESS)\n  } catch { return false }\n}\n// false => headless/SSH; env-var proxy only, this warning is expected","typeGuard":null,"tryCatchPattern":"// The library does not throw here; treat the log line as informational.\n// If you surface warnings, filter this one for headless deployments:\nif (!process.env.DBUS_SESSION_BUS_ADDRESS) {\n  console.info('Headless environment: relying on HTTP(S)_PROXY env vars only')\n}","preventionTips":["On headless Linux, rely on the env-var proxy and ignore this warning","Run DevSidecar inside a desktop session with D-Bus if you want GNOME proxy applied","Install gsettings-desktop-schemas/dconf-cli on minimal systems","For non-GNOME DEs, configure the desktop proxy separately"],"tags":["linux","gsettings","gnome","headless","env-proxy"],"backgroundTag":"gsettings-no-desktop-environment","analyzedSha":"7710cd56cce760c708f30b01d2d4056eb8c402d5","analyzedAt":"2026-08-31T22:07:07.234Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}