{"record":{"id":"cfa2cee7725b285c","repo":"usebruno/bruno","slug":"linux-proxy-detection-failed-error-instanceof-e","errorCode":null,"errorMessage":"Linux proxy detection failed: ${error instanceof Error ? error.message : String(error)}","messagePattern":"Linux proxy detection failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-requests/src/network/system-proxy/utils/linux.ts","lineNumber":45,"sourceCode":"        () => this.getEnvironmentFileProxy(),\n        () => this.getSystemdProxy()\n      ];\n\n      for (const method of detectionMethods) {\n        try {\n          const proxy = await method();\n          if (proxy) {\n            return proxy;\n          }\n        } catch (error) {\n          // Continue to next method if this one fails\n          continue;\n        }\n      }\n\n      throw new Error('No Linux proxy configuration found');\n    } catch (error) {\n      throw new Error(`Linux proxy detection failed: ${error instanceof Error ? error.message : String(error)}`);\n    }\n  }\n\n  private async getGSettingsProxy(execOpts: ExecFileOptions): Promise<ProxyConfiguration | null> {\n    try {\n      const mode = await safeExec('gsettings', ['get', 'org.gnome.system.proxy', 'mode'], execOpts);\n\n      // Handle PAC (auto) mode\n      if (mode === '\\'auto\\'') {\n        const autoConfigUrl = await safeExec('gsettings', ['get', 'org.gnome.system.proxy', 'autoconfig-url'], execOpts);\n        const cleanUrl = (autoConfigUrl || '').replace(/'/g, '').trim();\n        if (cleanUrl) {\n          return {\n            http_proxy: null,\n            https_proxy: null,\n            no_proxy: null,\n            pac_url: cleanUrl,\n            source: 'linux-system'","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-requests/src/network/system-proxy/utils/linux.ts#L27-L63","documentation":"Outer wrapper in LinuxProxyResolver.detect that re-wraps any inner failure (including the 'No Linux proxy configuration found' case) with a 'Linux proxy detection failed:' prefix. The original error message is preserved in the suffix.","triggerScenarios":"Any uncaught exception from a Linux detection routine — gsettings exec crash, permission error, or the no-config sentinel — gets re-thrown here.","commonSituations":"gsettings binary missing or not on PATH; timeout exceeded while spawning helper processes; safeExec rejecting for a non-zero exit on a detection command.","solutions":["Inspect the embedded suffix message to find the real cause (e.g. 'No Linux proxy configuration found' vs a spawn ENOENT).","Ensure gsettings (GNOME) or kwriteconfig5 (KDE) is installed and on PATH for the process user.","Fall back to environment-variable proxies (http_proxy/https_proxy) if desktop tooling is unavailable."],"exampleFix":"// before\nconst cfg = await resolver.getSystemProxy();\n\n// after: surface the underlying cause for routing\ncatch (e) {\n  const msg = e.message;\n  if (msg.endsWith('No Linux proxy configuration found')) return DIRECT_CONFIG;\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return await linuxResolver.detect(); } catch (e) { const m = e.message; if (m.endsWith('No Linux proxy configuration found')) return DIRECT; throw e; }","preventionTips":["Inspect the embedded suffix to route between no-config and real failures.","Ensure gsettings/kwriteconfig5 binaries are installed and on PATH."],"tags":["proxy","linux","system-proxy","wrapper"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}