{"record":{"id":"5f4befc8909bc1d7","repo":"ruvnet/ruflo","slug":"derivemeship-subnet-subnet-exhausted-after-102","errorCode":null,"errorMessage":"deriveMeshIP: subnet ${subnet} exhausted after 1024 probes for ${nodeId}; jump to a wider range","messagePattern":"deriveMeshIP: subnet (.+?) exhausted after 1024 probes for (.+?); jump to a wider range","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/plugin-agent-federation/src/domain/value-objects/wg-config.ts","lineNumber":138,"sourceCode":"  const hostBits = 32 - prefix;\n  const hostMask = hostBits >= 32 ? 0xffffffff : ((1 << hostBits) - 1) >>> 0;\n  const networkBase = (base & ~hostMask) >>> 0;\n\n  for (let probe = 0; probe < 1024; probe++) {\n    const input = probe === 0 ? nodeId : `${nodeId}\\x00${probe}`;\n    const hash = createHash('sha256').update(input).digest();\n    // Use the first 4 bytes as the host portion.\n    const hashHost = ((hash[0] << 24) | (hash[1] << 16) | (hash[2] << 8) | hash[3]) >>> 0;\n    let candidate = (networkBase | (hashHost & hostMask)) >>> 0;\n    const lastOctet = candidate & 0xff;\n    // Avoid .0 (network) and .255 (broadcast) of each /24 slice. Cheap\n    // clamp: bump to .1 if landing on .0, or .254 if landing on .255.\n    if (lastOctet === 0) candidate = (candidate | 1) >>> 0;\n    else if (lastOctet === 255) candidate = (candidate & ~1) >>> 0;\n    const ip = `${ipToString(candidate)}/32`;\n    if (!usedIPs.has(ip)) return ip;\n  }\n  throw new Error(`deriveMeshIP: subnet ${subnet} exhausted after 1024 probes for ${nodeId}; jump to a wider range`);\n}\n","sourceCodeStart":120,"sourceCodeEnd":140,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/plugin-agent-federation/src/domain/value-objects/wg-config.ts#L120-L140","documentation":"deriveMeshIP exhausted its probe budget: for the given nodeId it tried the sha256-derived host address plus 1024 salted probes (nodeId + \\x00n) and every candidate IP was already in usedIPs. This means the subnet is functionally full and the operator must widen the mesh range before this node can join.","triggerScenarios":"deriveMeshIP fails to find a free address in the subnet after 1024 deterministic probes for a node id.","commonSituations":"Subnet nearly exhausted by existing nodes, or probe collisions in a too-narrow range.","solutions":["Move the mesh to a wider subnet as the message suggests.","Reclaim addresses from decommissioned nodes before adding new ones."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}