Skip to content

Start typing to search the documentation.

Troubleshooting

On this page

Find the exact error string in the table for the surface you’re using. Each row is symptom → cause → fix.

Scanning and proofs

SymptomCauseFix
InvalidIdentityCommitmentRoot in the Self appThe document doesn’t match the network. Celo Sepolia takes mock passports only; Celo Mainnet takes real documents onlyStart a session on the matching network. For testnet, use a mock passport: Settings → Manage ID documents → Generate Mock Document (guide). The CLI defaults to testnet; the SDK, A2A and MCP to mainnet
Registered, but isVerified / verified is falsehasHumanProof is true but isProofFresh is false: the proof passed proofExpiresAtRefresh in place: requestProofRefresh({ agentId, network }) or POST /api/agent/refresh
A contract accepts an expired agentisVerifiedAgent() alone ignores expiryAlso check isProofFresh(getAgentId(key))

SDK and verifier

Errors from verifier.auth() (401 unless noted) and verifier.verify():

ErrorCauseFix
Missing agent authentication headersSignature or timestamp header missing (or stripped by a proxy)ECDSA agents send x-self-agent-address, -signature, -timestamp. Ed25519 agents send x-self-agent-keytype: ed25519, x-self-agent-key, -signature, -timestamp
Timestamp expired or invalidTimestamps are unix milliseconds and valid for 5 minutesSync clocks; sign right before sending
Invalid signatureThe signed bytes differ from what arrivedSign keccak256(timestamp + METHOD + pathWithQuery + keccak256(body)): path plus query, no host, the raw body
Replay detectedThe same signature was sent twiceSign every request fresh
Agent not verified on-chainKey not registered on the verifier’s network, or deregistered. On a POST: a re-serialized or altered body makes ECDSA recover a different signerMatch the network (.network('testnet') for testnet agents; the default is mainnet). For POSTs, verify req.rawBody, not JSON.stringify(req.body)
Agent's human proof has expiredproofExpiresAt has passedRefresh the proof
Agent was not verified by Self — proof provider mismatchThe agent’s proof came from another providerAccept other providers with .requireSelfProvider(false), or register through Self
Human has 3 agents (max 1)The verifier allows 1 agent per human by default; the registry allows 10 on mainnet and no cap on testnet.sybilLimit(n) for your policy, or .sybilLimit(0) for no limit
Agent's human does not meet minimum age (required: 18, got: 0)Registered without an age disclosure. Demo agents 1, 5 and 72 have noneRegister with disclosures: { minimumAge: 18 } (or --minimum-age 18)
Agent's human did not pass OFAC screeningRegistered without ofac, or the document isn’t a passport (ofac[0] is false for ID cards and Aadhaar)Register with ofac: true. Non-passport holders can’t pass requireOFAC() (known limitation)
Missing agent key for Ed25519 verificationManual verify() with keytype: 'ed25519' but no agentKeyPass keytype and agentKey (the x-self-agent-key header)
Invalid Ed25519 signatureWrong key, or the signed message differsSign the same message as ECDSA agents, with the key in x-self-agent-key
500 Raw request body unavailable for signature verificationA body arrived but req.rawBody is missing (the console logs a hint)express.json({ verify: (req, _res, buf) => { req.rawBody = buf; } }), or express.text() / express.raw()
503 Agent verification unavailable, try again laterThe verifier’s RPC call failedRetry, or set .rpc(url)

CLI

SymptomCauseFix
npx self-agent fails with an npm 404No npm package is named self-agent; the binary ships in the SDKnpx -p @selfxyz/agent-sdk self-agent ...
wait times out although the human scannedThe session’s --network doesn’t match the network of the QR they scannedWait on the session file that produced the scanned QR, or init again with the right --network
Last poll error: RPC call did not complete before the timeoutA short --timeout-seconds cut off the last poll (exit code 2)Nothing is broken: run wait again, or raise --timeout-seconds
Session expired. Run `register init` again. (exit code 1)The session passed expiresAt (default --ttl-minutes 30)Run init again
--mode ed25519 is not supported by the CLI. Use linked or wallet-free, ...The CLI supports linked and wallet-free onlyUse requestRegistration({ mode }) or the REST API
Export blocked. Re-run with --unsafe.Export needs explicit consentAdd --unsafe plus --out-key <path> or --print-private-key
A flag seems to have no effectUnknown flags are ignored silently, so typos fall back to defaultsCheck the spelling against Commands and flags
Need another chain or deployment--network knows only mainnet and testnetPass --chain, --registry and --rpc together

REST API

ResponseCauseFix
400 Missing session token. Provide Authorization: Bearer <sessionToken>.The token wasn’t sent as a header (query-string tokens are ignored)Send Authorization: Bearer <sessionToken>
400 on a status route with a valid tokenThe token belongs to another flow (e.g. a registration token on /deregister/status)Use the token from that flow
401 Invalid session tokenTruncated, altered, or from another deploymentSend the exact sessionToken from the latest response
401 on /api/qr/...A session token was used as a QR tokenUse the scanUrl as returned
409 Cannot export key until registration is complete. Current stage: qr-readyThe human hasn’t finished, or you sent an older token (the start token always says qr-ready). Ed25519 sessions get this too before completionPoll status until completed, then export with the rotated token from that poll
400 from export after completionEd25519 session: the agent already holds its keyNothing to export
409 on /api/agent/register/qrThe session is past qr-ready (already scanned)Poll status instead
410 Session expiredSessions last 30 minutes; export works for 30 minutes after the poll that saw completed (repeatable inside it)Start a new session. EVM-mode sessions can still be polled for up to 24 hours to catch a late scan
400 This agent has no stored verification config ... on refreshThe agent was registered before config tracking (demo agents 1 and 5) or through an external providerDeregister and register again
422 on refreshThe 32-byte agent ID has a byte of 0x80 or more (e.g. IDs 128–255)Deregister and register again, which mints a new ID (details)
400 on POST /api/agent/deregister for an Ed25519 agentEd25519 agents aren’t deregistered with a scanGuardian calls guardianRevoke(agentId), or the NFT owner calls selfDeregister(agentId) on the registry
404 Agent not foundNever minted, burned, or the wrong chainCheck the chain ID in the path: 42220 mainnet, 11142220 testnet
A2A lookup returns a completed task with data.error: "Agent not found"Unknown agents are a result, not a failed taskCheck data.error on completed tasks
429 Rate limit exceeded. Try again later.Per-IP limit; everyone behind one NAT shares itWait Retry-After seconds (or retryAfterMs); poll every few seconds. A2A reports JSON-RPC -32000. Limits
502 RPC errorThe API couldn’t read the chainRetry. For a visa write, a 502 with txHash means it was broadcast: check on-chain before retrying

Every status poll rotates the session token, so always send the latest one. Earlier tokens stay valid until expiry, so treat all of them as secrets. The SDK (waitForCompletion, exportKey) handles this for you.

Visa writes

ResponseCauseFix
401Stale, reused or malformed signatureSign a fresh timestamp (5 minutes, single use) over the exact message
403The signer isn’t the NFT owner, the agent’s EVM key, or the wallet behind a wallet-based IDSign with one of those
409The agent is already at or above targetTierNothing to do
422 NOT_ELIGIBLE / REVIEW_REQUIREDMetrics below the tier thresholds, or tier 3 needs an approved manual reviewImprove the metrics, or request review first

MCP

SymptomCauseFix
406 Not Acceptable: Client must accept both application/json and text/event-streamA raw request without the right Accept headerSend Accept: application/json, text/event-stream (MCP clients do this for you)
405 on GET or DELETEThe hosted server is stateless Streamable HTTPUse POST
The client ignores .mcp.jsonMissing mcpServers wrapper{ "mcpServers": { "self-agent-id": { "type": "http", "url": "https://agent-api.self.xyz/api/mcp" } } }
Privileged tools (self_get_identity, self_sign_request, …) are deniedThey act as the server’s own agent, which the hosted server doesn’t offerSign as your own agent with the local server and SELF_AGENT_PRIVATE_KEY, or run your own deployment with MCP_PRIVILEGED_API_KEY
self_verify_agent fails for a human with several agentsmax_agents_per_human defaults to 1Pass max_agents_per_human: 0 (no limit) or your cap
self_verify_request can’t check an Ed25519 requestIt verifies ECDSA signatures onlyUse the SDK’s SelfAgentVerifier
total_count from self_list_agents_for_human looks wrongIt counts agents listed for that wallet, not all agents of the humanUse the identify flow and agents-by-nullifier
Local server exits with Invalid SELF_AGENT_PRIVATE_KEY: ...The key isn’t a 0x-prefixed 32-byte hex secp256k1 keyFix the key; an invalid network or API base also stops startup
self_authenticated_fetch refuses a hostPrivate, loopback and link-local targets are blocked (re-checked on each redirect, max 3)Set MCP_AUTH_FETCH_ALLOW_PRIVATE_NETWORKS=true on the local server, and MCP_AUTH_FETCH_ALLOWED_HOSTS to allow-list hosts

Smart contracts

SymptomCauseFix
Foundry build fails against Hub V2Hub V2 uses the PUSH0 opcodeforge build --evm-version cancun, or evm_version = "cancun" in foundry.toml
userDefinedData looks garbled in your contractThe Self app passes it as a UTF-8 string, so '0' is 0x30, not 0x00Parse ASCII characters, not raw bytes (Registration data)

Known limitations

  • Refresh: agents without a stored config (400) or with an ID byte of 0x80+ (422) must deregister and register again.
  • OFAC: requireOFAC(), MCP ofac_clear and the card’s ofacClean read only ofac[0], which is false for non-passport documents.
  • Ed25519 deregistration: on-chain only (guardianRevoke or selfDeregister), not through the API.
  • Replay cache: in memory, per process. Behind several instances, a replay sent to a different instance isn’t caught; add a shared check (for example on the signature) if that matters.

Next

Was this page helpful?