usebruno/bruno · error · Error
macOS proxy detection failed: ${error instanceof Error ? err
Error message
macOS proxy detection failed: ${error instanceof Error ? error.message : String(error)} What it means
MacOSProxyResolver.detect runs `scutil --proxy` and parses its output; any rejection from execFile or thrown parse error is caught and re-wrapped with the 'macOS proxy detection failed:' prefix, keeping the original message.
Source
Thrown at packages/bruno-requests/src/network/system-proxy/utils/macos.ts:17
import { ExecFileOptions } from 'node:child_process';
import { ProxyConfiguration, ProxyResolver } from '../types';
import { normalizeProxyUrl, normalizeNoProxy, execFileAsync } from './common';
export class MacOSProxyResolver implements ProxyResolver {
async detect(opts?: { timeoutMs?: number }): Promise<ProxyConfiguration> {
const timeoutMs = opts?.timeoutMs ?? 10000;
const execOpts: ExecFileOptions = {
timeout: timeoutMs,
maxBuffer: 1024 * 1024
};
try {
const { stdout } = await execFileAsync('scutil', ['--proxy'], execOpts);
return this.parseScutilOutput(stdout);
} catch (error) {
throw new Error(`macOS proxy detection failed: ${error instanceof Error ? error.message : String(error)}`);
}
}
private parseScutilOutput(output: string): ProxyConfiguration {
if (typeof output !== 'string') {
throw new Error('Invalid scutil --proxy output');
}
const cleanLines = output.split('\n')
.map((line) => line.trim())
.filter((line) => line.length > 0);
const dictStart = cleanLines.findIndex((line) => line.includes('<dictionary>'));
if (dictStart === -1) {
throw new Error('Invalid scutil --proxy output format');
}
const config = this.parseConfiguration(cleanLines, dictStart);
return this.buildProxyConfiguration(config);View on GitHub (pinned to 9bdd81c7bd)
Solutions
- Check the suffix message: 'Invalid scutil --proxy output format' => parse issue; spawn ENOENT => scutil missing; ETIMEDOUT => raise commandTimeoutMs.
- Run `scutil --proxy` manually in Terminal and compare output shape to the parser's expectations.
- Pass a larger timeoutMs to SystemProxyResolver constructor ({ commandTimeoutMs }) if the call is slow.
- Use environment-variable proxies or explicit proxy config as a fallback.
Example fix
// before
const resolver = new MacOSProxyResolver();
await resolver.detect(); // default 10s timeout
// after
const resolver = new MacOSProxyResolver();
await resolver.detect({ timeoutMs: 30000 }); Defensive patterns
Strategy: try-catch
Try / catch
try { return await macResolver.detect({ timeoutMs: 30000 }); } catch (e) { if (/macOS proxy detection failed/.test(e.message)) return DIRECT_CONFIG; throw e; } Prevention
- Tune commandTimeoutMs to the host's responsiveness.
- Verify `scutil --proxy` works in a terminal before relying on detection.
- Fall back to environment-variable proxies on locked-down macOS.
When it happens
Trigger: scutil is missing/not executable, the command times out, or parseScutilOutput raises (invalid output / invalid format) on the returned stdout.
Common situations: Sandboxed/locked-down macOS where scutil is restricted; very slow system under load hitting the 10s default timeout; non-English locale producing unexpected scutil formatting; running in a non-macOS environment that nonetheless hits the darwin branch.
Related errors
- Invalid scutil --proxy output
- Invalid scutil --proxy output format
- Unsupported platform: ${this.osPlatform}
- No Linux proxy configuration found
- Linux proxy detection failed: ${error instanceof Error ? err
AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13).
Data as JSON: /api/errors/6acb44e187580654.
Report an issue: GitHub.