ruvnet/ruflo · error

Federation: could not persist keypair (${err instanceof Erro

Error message

Federation: could not persist keypair (${err instanceof Error ? err.message : err}); using ephemeral key for this session

What it means

Log warning in the federation plugin's initialize: generating or persisting the Ed25519 node keypair to disk failed (write error or key-dir issue); the plugin continues with a fresh ephemeral key that will not survive restarts.

Source

Thrown at v3/@claude-flow/plugin-agent-federation/src/plugin.ts:137

        publicKeyHex = stored.publicKey;
      } else {
        privateKey = ed.utils.randomPrivateKey();
        const pk = ed.getPublicKey(privateKey);
        publicKeyHex = Buffer.from(pk).toString('hex');
        if (!existsSync(keyDir)) mkdirSync(keyDir, { recursive: true, mode: 0o700 });
        writeFileSync(keyPath, JSON.stringify({
          nodeId,
          privateKey: Buffer.from(privateKey).toString('hex'),
          publicKey: publicKeyHex,
          createdAt: new Date().toISOString(),
        }, null, 2), { mode: 0o600 });
      }
    } catch (err) {
      // Fall back to ephemeral key if persistence fails — still real crypto.
      privateKey = ed.utils.randomPrivateKey();
      const pk = ed.getPublicKey(privateKey);
      publicKeyHex = Buffer.from(pk).toString('hex');
      context.logger.warn(`Federation: could not persist keypair (${err instanceof Error ? err.message : err}); using ephemeral key for this session`);
    }

    const coordConfig: FederationCoordinatorConfig = {
      nodeId,
      publicKey: publicKeyHex,
      endpoint,
      capabilities: [
        'send',
        'receive',
        'query-redacted',
        'status',
        'ping',
        'discovery',
        ...(signatureMode === 'legacy' ? [] : [JCS_SIGNATURE_PROTOCOL]),
      ],
      supportedProtocols: [
        'websocket',
        'http',

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Fix write permissions on the keypair persistence path; without persistence a new ephemeral key is generated each session, breaking peer identity continuity.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at v3/@claude-flow/plugin-agent-federation/src/plugin.ts:137 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/1d659f8a84e6f12d. Report an issue: GitHub.