ruvnet/ruflo · error

Meta-Proxy v${version} did not become the effective daemon.

Error message

Meta-Proxy v${version} did not become the effective daemon.

What it means

launchAndVerify() waits up to 100 × 50ms (5s) for the newly launched daemon to answer /version with the expected pid, version, and executable. If it never comes up in that window, the child is killed and this error is thrown — the new daemon failed to start or start fast enough.

Source

Thrown at v3/@claude-flow/cli/src/proxy/activation.ts:148

    child.unref();
    fs.writeFileSync(proxyPidFilePath(), `${child.pid}\n`, { mode: 0o600 });
    return child.pid;
  } finally { fs.closeSync(log); }
}

async function launchAndVerify(binary: string, version: string, wait: Wait): Promise<EffectiveProxy> {
  const pid = launch(binary);
  for (let attempt = 0; attempt < 100; attempt++) {
    await wait(50);
    const current = await probeEffectiveProxy();
    if (current?.pid === pid && current.version === version && path.resolve(current.executable) === path.resolve(binary)) return current;
    if (current && current.pid !== pid) {
      try { process.kill(pid, 'SIGTERM'); } catch { /* already exited */ }
      throw new Error(`Competing Meta-Proxy pid ${current.pid} won the port with version ${current.version}.`);
    }
  }
  try { process.kill(pid, 'SIGTERM'); } catch { /* already exited */ }
  throw new Error(`Meta-Proxy v${version} did not become the effective daemon.`);
}

export async function installAndActivateProxy(version: string, log?: (line: string) => void): Promise<InstallResult & { pid: number }> {
  const wait = waitNormally;
  const binary = proxyBinaryPath();
  const manifest = proxyInstallManifestPath();
  const binaryBackup = `${binary}.rollback`;
  const manifestBackup = `${manifest}.rollback`;
  let release: (() => void) | null = null;
  let prior: EffectiveProxy | null = null;
  try {
    release = await acquireProxyInstallLease(wait);
    prior = await stopEffective(wait);
    fs.rmSync(binaryBackup, { force: true });
    fs.rmSync(manifestBackup, { force: true });
    if (fs.existsSync(binary)) fs.copyFileSync(binary, binaryBackup);
    if (fs.existsSync(manifest)) fs.copyFileSync(manifest, manifestBackup);
    const installed = await installProxy({ version, log });

View on GitHub (pinned to 29f048fc3b)

Solutions

  1. Inspect the daemon log at proxyLogFilePath() for the startup crash reason and fix it (config, permissions)
  2. Verify the binary runs: ~/.metaharness/bin/meta-proxy (or proxyBinaryPath()) manually — check exit codes and missing shared libs (ldd)
  3. Retry when the machine is less loaded, or increase the wait if you patched the code — the default is 5s
  4. Confirm the bind is loopback (default 127.0.0.1:11435) and that local HTTP to that endpoint isn't blocked by security software

Example fix

// before
chmod 644 ~/.metaharness/bin/meta-proxy   # not executable
// after
chmod 755 ~/.metaharness/bin/meta-proxy
Defensive patterns

Strategy: try-catch

Validate before calling

// Preflight the binary can at least run before asking the library to launch it
const bin = proxyBinaryPath();
fs.accessSync(bin, fs.constants.X_OK);
const check = spawnSync(bin, ['--version'], { timeout: 5000 });
if (check.status !== 0) throw new Error(`meta-proxy cannot start: ${check.stderr?.toString()}`);

Type guard

null

Try / catch

try {
  const res = await installAndActivateProxy(version);
} catch (e) {
  if (e instanceof Error && e.message.includes('did not become the effective daemon')) {
    console.error('Check daemon log:', proxyLogFilePath());
  } else throw e;
}

Prevention

When it happens

Trigger: installAndActivateProxy() or effective() → launchAndVerify(): the spawned meta-proxy crashed at startup (bad config, missing permissions, port taken by something not answering /version), is slow to initialize on a loaded machine, or the probe endpoint can't reach it (e.g. unusual bind).

Common situations: First run on a machine with slow disk/network causing >5s startup; malformed proxy config crashing the daemon; the binary lacks execute permission or fails a dynamic-link check; SELinux/AppArmor blocking execution; port blocked by firewall for loopback HTTP probe.

Related errors


AI-assisted analysis of ruvnet/ruflo@29f048fc3b (2026-09-01). Data as JSON: /api/errors/8167a84cde9b2eca. Report an issue: GitHub.