{"record":{"id":"fe90f2451b19e717","repo":"ruvnet/ruflo","slug":"failure-previous-meta-proxy-prior-was-rest","errorCode":null,"errorMessage":"${failure} Previous Meta-Proxy ${prior ? 'was restored and verified' : 'binary was restored; it was not running before the upgrade'}.","messagePattern":"(.+?) Previous Meta-Proxy (.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/proxy/activation.ts","lineNumber":182,"sourceCode":"    if (fs.existsSync(binary)) fs.copyFileSync(binary, binaryBackup);\n    if (fs.existsSync(manifest)) fs.copyFileSync(manifest, manifestBackup);\n    const installed = await installProxy({ version, log });\n    const effective = await launchAndVerify(installed.binaryPath, installed.version, wait);\n    return { ...installed, pid: effective.pid };\n  } catch (error) {\n    const failure = error instanceof Error ? error.message : String(error);\n    if (fs.existsSync(binaryBackup)) {\n      try {\n        await stopEffective(wait);\n        fs.rmSync(binary, { force: true });\n        fs.renameSync(binaryBackup, binary);\n        fs.rmSync(manifest, { force: true });\n        if (fs.existsSync(manifestBackup)) fs.renameSync(manifestBackup, manifest);\n        if (prior) await launchAndVerify(prior.executable === binary ? binary : prior.executable, prior.version, wait);\n      } catch (rollbackError) {\n        throw new Error(`${failure} Rollback failed: ${rollbackError instanceof Error ? rollbackError.message : String(rollbackError)}`);\n      }\n      throw new Error(`${failure} Previous Meta-Proxy ${prior ? 'was restored and verified' : 'binary was restored; it was not running before the upgrade'}.`);\n    }\n    throw error;\n  } finally {\n    fs.rmSync(binaryBackup, { force: true });\n    fs.rmSync(manifestBackup, { force: true });\n    release?.();\n  }\n}\n","sourceCodeStart":164,"sourceCodeEnd":191,"githubUrl":"https://github.com/ruvnet/ruflo/blob/29f048fc3b556f857cf2b126d2a84c19d2daa0d0/v3/@claude-flow/cli/src/proxy/activation.ts#L164-L191","documentation":"This is the terminal error of a failed upgrade with successful rollback: installAndActivateProxy() prefixes the original failure with what happened to the previous Meta-Proxy. If a prior daemon was running, it was restored and re-verified via launchAndVerify; otherwise only the old binary files were restored and nothing was relaunched. It tells you the system is back to (or at) the pre-upgrade state and the requested upgrade did not happen.","triggerScenarios":"installAndActivateProxy() failed at any step after the backup was created (installProxy download failure, launchAndVerify timeout, competing daemon) and the rollback path completed; the error message embeds the root cause as its prefix.","commonSituations":"Network failure while downloading the new version; target version doesn't exist or is incompatible; the new daemon couldn't start within 5s (errors 5/6 conditions); corporate proxy blocking downloads in CI.","solutions":["Read the prefix of the message — it is the root cause of the upgrade; address that (network, version availability, daemon startup)","Confirm the previous daemon is healthy (probe http://127.0.0.1:11435/version) or start it manually if none was running before","Re-run the install once the root cause is fixed; the transactional flow can be safely retried","If repeated, pin the currently working version and check the daemon log and CLI --verbose output for the underlying failure"],"exampleFix":"// retry after fixing root cause (e.g. network)\nexport HTTPS_PROXY=http://corp-proxy:8080\nnpx ruflo proxy install --version 1.2.3","handlingStrategy":"try-catch","validationCode":"// Verify the current install is healthy before attempting an upgrade\nconst current = await probeEffectiveProxy();\nif (current) console.log(`Healthy baseline: v${current.version} pid ${current.pid}`);","typeGuard":"null","tryCatchPattern":"try {\n  await installAndActivateProxy(version);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('was restored')) {\n    // upgrade failed, previous state restored — inspect the prefix cause and retry later\n    console.error('Upgrade failed, rolled back. Cause:', e.message.split('.')[0]);\n  } else throw e;\n}","preventionTips":["Verify network/proxy access to the download source before upgrading in CI","Pin a known-good version and upgrade deliberately, checking release notes","Confirm the daemon is healthy (probe /version) before and after each upgrade","Treat this error as safe: the prefix tells you the root cause to fix before retrying"],"tags":["rollback","upgrade","install","proxy"],"backgroundTag":"upgrade-rolled-back","analyzedSha":"29f048fc3b556f857cf2b126d2a84c19d2daa0d0","analyzedAt":"2026-09-01T11:37:30.251Z","contentChangedAt":"2026-09-01T11:37:30.251Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}