{"record":{"id":"55fedac855eae96b","repo":"ruvnet/ruflo","slug":"proposal-proposalid-not-found-55feda","errorCode":null,"errorMessage":"Proposal ${proposalId} not found","messagePattern":"Proposal (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/swarm/src/consensus/raft.ts","lineNumber":225,"sourceCode":"\n    // Leader votes for itself\n    proposal.votes.set(this.node.id, {\n      voterId: this.node.id,\n      approve: true,\n      confidence: 1.0,\n      timestamp: new Date(),\n    });\n\n    // Replicate to followers\n    await this.replicateToFollowers(logEntry);\n\n    return proposal;\n  }\n\n  async vote(proposalId: string, vote: ConsensusVote): Promise<void> {\n    const proposal = this.proposals.get(proposalId);\n    if (!proposal) {\n      throw new Error(`Proposal ${proposalId} not found`);\n    }\n\n    if (proposal.status !== 'pending') {\n      return;\n    }\n\n    proposal.votes.set(vote.voterId, vote);\n\n    // Check if we have consensus\n    await this.checkConsensus(proposalId);\n  }\n\n  async awaitConsensus(proposalId: string): Promise<ConsensusResult> {\n    const startTime = Date.now();\n\n    return new Promise((resolve, reject) => {\n      const checkInterval = setInterval(() => {\n        const proposal = this.proposals.get(proposalId);","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/swarm/src/consensus/raft.ts#L207-L243","documentation":"RaftConsensus.vote(proposalId, vote) looks the proposal up in the local proposals map; an id this node never created or received throws 'Proposal ... not found'. Note the adjacent behavior: if the proposal exists but is no longer 'pending', vote() returns silently — so this error specifically means the proposal id is unknown locally, not merely late.","triggerScenarios":"Voting on a proposal id that was created on another node and never replicated here; a restart wiped the in-memory proposals map while vote messages kept arriving; a mistyped or truncated proposalId; using an engine-level id that differs from the raft-level id.","commonSituations":"Follower nodes receiving vote requests before the proposal replication reached them; replaying recorded messages after a process restart; string mismatches in ids passed between subsystems.","solutions":["Use the exact proposal object/id returned by propose() when voting.","Guard with a lookup first (e.g. engine.getProposal(proposalId)) and drop or defer votes for unknown ids.","Ensure replication delivers a proposal to a node before it is expected to vote on it.","After a restart, expect unknown-proposal errors for pre-restart proposals — rebuild state or ignore stale votes."],"exampleFix":"// before\nawait raft.vote(proposalId, vote); // proposalId unknown on this node\n\n// after — guard with a local lookup\nif (!engine.getProposal(proposalId)) {\n  throw new Error(`proposal ${proposalId} not known locally; await replication`);\n}\nawait engine.vote(proposalId, vote);","handlingStrategy":"validation","validationCode":"// guard with the engine-level lookup before voting\nif (!engine.getProposal(proposalId)) {\n  // unknown locally: drop, or defer until replication delivers it\n  return;\n}\nawait engine.vote(proposalId, vote);","typeGuard":null,"tryCatchPattern":"try {\n  await raft.vote(proposalId, vote);\n} catch (e) {\n  if (e instanceof Error && /^Proposal .* not found$/.test(e.message)) {\n    // unknown proposal on this node: ignore stale votes or await replication\n  } else {\n    throw e;\n  }\n}","preventionTips":["Only vote with ids returned by propose() — never reconstructed strings.","On followers, expect proposals to arrive via replication before vote requests; drop unknown ids gracefully.","After a restart, treat pre-restart proposal ids as gone — rebuild state instead of replaying votes."],"tags":["consensus","raft","voting","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}