Database connection errors
The Wallet Gateway fails to start with database connection errors.- PostgreSQL: verify the database exists (
psql -U postgres -l), check credentials in your config, ensure PostgreSQL is running (pg_isready), and check network and firewall rules. - SQLite: ensure the directory for the database file exists, check read/write permissions, and verify disk space.
- Memory: no configuration is needed, but remember data is lost on restart.
Authentication failures
API calls return401 Unauthorized.
- Invalid or expired token: use a valid JWT, check its expiration, and regenerate it if needed.
- Missing Authorization header: include
Authorization: Bearer <token>in the correct format. - Session not found: create a session with
addSession()first, ensure it has not expired, and confirm you are using the correct user context.
503 Service Unavailable with JSON-RPC error -32002 (resource unavailable).
The Wallet Gateway could not verify the token because the identity provider is unavailable; the
token itself may be valid, so clients should retry instead of logging the user out. The gateway
logs the underlying cause.
- IDP unreachable: check that the gateway can reach the IDP’s
configUrland thejwks_uriit advertises, and check firewall and proxy rules. - Issuer mismatch: the
issuerin the IDP’s discovery document must be identical to theissuerconfigured for the identity provider, including scheme, host, and trailing slash. - Malformed responses: the discovery document and JWKS must be valid JSON. An HTML error page served with status 200 counts as unavailable.
Network connection issues
The Wallet Gateway cannot connect to a configured network or Ledger API.- Network unreachable: verify the Ledger API URL, test connectivity with
curl <ledger-api-url>/v2/version, and check firewall rules and routing. - Invalid network configuration: confirm
synchronizerIdmatches the validator, theidentityProviderIdmatches an IDP, and the credentials are correct. - SSL/TLS issues: verify certificates for HTTPS endpoints. In development you may need HTTP or to configure certificate trust.
Port already in use
EADDRINUSE: address already in use :::3030.
-
Find and stop the process using the port:
-
Use a different port:
-
Check whether another Wallet Gateway instance is running:
Configuration validation errors
The Wallet Gateway fails to start with configuration errors.-
Validate your config against the schema:
- Check for common mistakes: missing required fields, invalid JSON, type mismatches (strings vs numbers), and incorrect IDP references in networks.
-
Start from the example config:
Signing provider issues
Transactions fail with signing errors. Verify the provider’s configuration, environment variables and permissions:- Fireblocks: API key and secret set in the env vars named by
signingProviders.fireblocks.apiKeyEnvandsecretEnv, keys valid with proper permissions, and the Fireblocks API reachable. - Participant: the participant node is running and reachable, the party exists on it, and the participant logs show no signing errors.
- Blockdaemon:
signingProviders.blockdaemon.baseUrlset, API key in the env var named bysigningProviders.blockdaemon.apiKeyEnv, API reachable, and the key has signing permissions. - DFNS:
signingProviders.dfns.orgId,baseUrl, andcredIdset. Private key and auth token in the env vars named byprivateKeyEnvandauthTokenEnv. Credentials correct, and the service account has wallet-creation and signing permissions. - Securosys:
signingProviders.securosys.baseUrlset. Credentials in the env vars named by its*Envfields. - BitGo:
signingProviders.bitgo.baseUrlset, and the access token in the env var named bysigningProviders.bitgo.accessTokenEnv.
Debugging
-
Enable pretty logs for readable, detailed output:
-
Use structured logs for aggregation:
- Check logs in console output, system logs, or container logs depending on how you run the Wallet Gateway.
-
Verify endpoints respond: