Troubleshooting a self-hosted server
Payment wires: every paid endpoint accepts x402 and MPP (Machine Payments Protocol) on the same 402 - see Paying with x402 and Paying with MPP. Agent402 is the applied layer of Agentic Finance: agents that pay and get paid on their own.
Each entry names what you see, why, and the setting that changes it. Every variable is in the configuration reference.
The server exits at boot
- Neither free nor paid mode is configured. Set
FREE_MODE=true, or the paid-mode settings in Self-Hosting (WALLET_ADDRESS, a facilitator,POW_SECRET). Unsupported primary network:NETWORKnames a chain the server does not know. The error lists the known names.- No facilitator for the primary network. Set
CDP_API_KEY_ID+CDP_API_KEY_SECRETorFACILITATOR_URL; with neither, onlyNETWORK=base-sepoliaboots, on the public testnet facilitator.
A chain is missing from the 402
- Solana, Stellar or Algorand: each needs its own receiving address (
SOLANA_WALLET_ADDRESS,STELLAR_WALLET_ADDRESS,ALGORAND_WALLET_ADDRESS). Unset, the server logs a boot warning and leaves that option out. See Solana, Stellar, Algorand. - Arc is configured only while
CIRCLE_FACILITATOR_API_KEYis set, and offered only while the facilitator's/supportedlists it. See Arc. - Ink is configured only with
INK_FACILITATOR_URL; aninkentry without it is dropped with a boot warning. See Ink. - Any chain whose facilitator's
/supportedread fails at boot is dropped with a boot warning that names the facilitator, and rejoins the offer when a background re-read answers.
Payments fail on Solana while the 402 looks healthy
The receiving address must already hold a USDC token account, or every payment fails on-chain simulation. Send the address any amount of USDC on Solana once; boot checks this and warns.
A tool answers 503
- The tool needs a key you have not set (search, model, media and some data tools).
/api/pricingand/openapi.jsondescribe each tool; the configuration reference names each key. /v1model routes needOPENROUTER_API_KEY; without it every model route answers 503.- Transcription needs
ffmpegon the host for every file except PCM WAV;image-ocrneeds the language data fromnode scripts/fetch-tessdata.js. The project'sDockerfileinstalls both.
/api/decide answers 404
Decide runs as its own service (npm run start:decide, services/decide, with its own Postgres). The main server serves /api/decide only when DECIDE_SERVICE_URL and DECIDE_INTERNAL_TOKEN (24 characters or more) are both set. See Decide.
Every visitor shares one rate limit
Behind a reverse proxy, set TRUST_PROXY_HOPS to the number of proxies in front (1 behind a single edge). Unset, the client address is the connection's, so every visitor reads as the proxy; the server logs a warning at boot.
State does not survive a deploy
Without STATE_DATABASE_URL, state lives in SQLite and files under /data: that directory must be writable and persistent. With it, state lives in Postgres and two containers can overlap during a deploy. See Self-Hosting.
Checking the whole catalog
FREE_MODE=true PORT=3000 node src/server.js &
TARGET_URL=http://localhost:3000 node scripts/test-all.js
Every tool answers its own published example; a failure names the tool.