Troubleshooting
Audience: engineers and operators diagnosing a sidecar integration. Error responses use the format
{ "status": "error", "error": "<type>", "message": "<text>" }. Search this page by the returnedmessage.
Initial triage checklist
- Open Sessions in the sidecar backoffice, locate the exchange, and inspect its status and error code.
- Check the sidecar server logs (
infolevel or higher) around the timestamp of the failure. - Coordinate with the partner: most cross-organisation errors stem from allowlist or DNS configuration on the partner's side. Have them check Sessions for the same timestamp.
The sidecar fails to start
| Log symptom | Cause | Resolution |
|---|---|---|
Invalid environment variables with variable names | A required variable is missing or fails validation (URL, PEM, byte length) | Set or correct the listed variables. See Environment variables. |
JWT_PRIVATE_KEY must be an EC private key in PEM format | PEM is missing, truncated, or lacks valid line breaks | In a .env file, wrap the key in double quotes and encode line breaks as \n. In Kubernetes, mount it directly from a Secret. |
Failed to run migrations or create initial admin | PostgreSQL is unreachable, permissions are insufficient, database does not exist, or INITIAL_ADMIN_PASSWORD / INITIAL_ADMIN_EMAIL (in production) is missing | Verify database host, port, ownership, and credentials, and ensure INITIAL_ADMIN_PASSWORD (and INITIAL_ADMIN_EMAIL in production) are set on first boot. |
Wallet file not found at … | WALLET_FILE_PATH does not point to the mounted keystore | Mount wallet.json read-only and verify WALLET_FILE_PATH. |
invalid password while loading the wallet | WALLET_PASS does not match the keystore | Supply the password used when encrypting wallet.json. |
401 on core-system API calls
message | Resolution |
|---|---|
Missing API Key or Secret | Include both x-api-key and x-api-secret headers. Verify that any internal reverse proxy preserves these headers. |
Invalid or expired API Key | The key ID is unknown, the secret is incorrect, or the key was revoked or expired. Inspect keys via GET /api/v1/admin/api-keys and issue a replacement via POST /api/v1/admin/api-keys if needed (secrets cannot be recovered after creation). |
Auth Portal shows an error instead of the QR code
The Auth Portal validates the Requester's login token before rendering a QR code.
| Portal error | Cause | Resolution (Requester) |
|---|---|---|
Invalid requester credentials | ISS_CODE is not registered in the Auth Portal, or ISSUER does not match the registered issuer domain | Align ISS_CODE and ISSUER with your Auth Portal registration, or ask the network operator to update your member record. |
| Signature verification error | The ekyc_pub TXT record on ISSUER does not match JWT_PRIVATE_KEY | Check that your DNS key matches your private key. |
Request token has expired (410) | Login token exceeded its 15-minute lifetime | Request a new login token for each attempt; do not cache tokens. |
Session reference already exists (409) | The same login token was submitted to the portal more than once (double submit, browser back, or retry) | Request a new login token for every sign-up attempt. |
| QR renders with no Providers listed | The token's accept list is empty, or none of the codes match active Auth Portal members | Add and enable Provider partners in your allowlist using their exact Auth Portal member codes. |
Login token rejected on the Provider
Returned as 400 by token/verify, kyc/submit, and kyc/authorize. (kyc/invalidate does not require or verify a login token.)
message | Cause | Resolution |
|---|---|---|
Invalid token format | Input is not a valid JWT (wrong QR code or truncated deep-link parameter) | Verify your mobile app forwards the full QR payload or the URL-decoded q parameter. |
No public keys found for domain: … | DNS TXT lookup for the Requester's iss returned no ekyc_pub record | The Requester must publish its ekyc_pub record. Verify outbound DNS resolution from your sidecar. |
Token verification failed for all keys from … | Signature does not match any published ekyc_pub key, or algorithm is not ES512 | The Requester must align its DNS record and JWT_PRIVATE_KEY. See Check that your DNS key matches your private key. |
Login token has expired | Token exceeded the Requester's REQUEST_TOKEN_EXPIRY_MINUTES lifetime | Have the customer restart the flow on the Requester's site. |
Login token iat is in the future | Clock drift between member servers | Synchronise both servers with NTP. |
This provider (…) is not in the login token accept list | Requester has not allowlisted you as a Provider, or configured a different partner code | Have the Requester add you with your exact ISS_CODE and the Provider role. |
Login token iss_code … is not an authorized or enabled partner | Requester is missing from your allowlist or disabled | Add the Requester under Partners and click Enable. |
Login token iss_code … is not a requester | Partner exists without the Requester role | Enable the Requester role on the partner record. |
Login token tier N exceeds partner max tier M | Requested tier exceeds the partner's configured maxTier | Raise Max tier for that partner if permitted by your bilateral agreement (new partners default to 0). |
Token issuer is not a registered domain of this partner | Token iss does not match any domain configured on the partner | Add the Requester's ISSUER domain under Domains on the partner record. |
Provider submit or authorize fails
message | Cause | Resolution |
|---|---|---|
Validation Error (with details) | data.user_info fails schema validation for the tier | Compare against KYC data by tier. Common issues include gender outside M/F or missing address codes. |
Either data+tier or attestationRef must be provided | submit called without data | Supply data.user_info matching the requested tier. |
Tier is required to process KYC flow | authorize called without tier | Include tier from the verified login token. |
No active cached KYC found for this user | No active attestation exists for user_id | Call kyc/submit instead. |
Cached attestation reference is invalid or invalidated (400) | attestation_ref is unknown, belongs to another user_id, or was invalidated | Invalidation is permanent. Call kyc/submit with current verified data and store the returned attestation_ref. |
An active attestation exists for this user; invalidate it before submitting a replacement (409) | submit called while an active attestation exists for user_id | Call kyc/invalidate with the attestation_ref returned in the 409 body, then retry kyc/submit. If you lost the reference and attestation_ref was omitted due to a race, check your records or inspect the customer's latest session detail in Sessions. |
Requested Tier N exceeds cached Tier M | Cached attestation was created at a lower tier | Call kyc/invalidate, then kyc/submit at the higher tier. |
Failed to submit consent to the auth portal / Auth portal rejected consent: HTTP … (500) | Sidecar could not reach the Auth Portal over CamDX, or the Auth Portal rejected the request | Check CAMDX_SECURITY_SERVER, EKYC_AUTH_PORTAL_MEMBER_CODE, Security Server permissions, and portal logs. |
Failed to generate token (500) | JWT_PRIVATE_KEY could not sign | Verify JWT_PRIVATE_KEY is a valid EC P-521 private key in PEM format. |
Provider invalidate fails or remains pending
| Result | Cause | Resolution |
|---|---|---|
404 Attestation not found for this user | No attestation matches both attestation_ref and user_id | Verify user_id and attestation_ref match the original submit call. |
400 ValidationError | attestation_ref is not a UUID, or reason is not in the allowed enum | Use a valid UUID and one of profile_updated, ekyc_repeated, data_correction, or other. |
200 with already_invalidated: true | Attestation was already invalidated earlier | Expected idempotent response; does not affect any replacement attestation. |
200 with camdl_publication: "failed" | Background CamDL revocation failed after max retries (RPC outage, missing revocation role, or insufficient gas) | Invalidation is already active locally and on kyc-status-v1. Resolve the underlying cause and retry under Attestations in the backoffice; contact TSC if the wallet requires funding. |
200 with camdl_publication: "pending" persistently | Background worker disabled or RPC_URL unreachable | Check CAMDL_PUBLICATION_WORKER_ENABLED, RPC_URL, and sidecar logs. Sharing remains unaffected. |
Customer approved, but remains on the Auth Portal
The Provider's submit or authorize returned 201, but the Auth Portal does not redirect the customer to the Requester's callback.
The Auth Portal rejected the consent delivery for one of the following reasons:
| Portal error reason | Resolution |
|---|---|
Provider auth token ref does not match session | The login token passed to submit or authorize differs from the session the customer scanned. Forward the scanned token unchanged. |
Provider auth token audience does not match requester issuer / issuer code does not match provider code / issuer does not match provider code | Partner codes or issuer domains differ across sidecar configs, partner allowlists, and the Auth Portal registry. Align ISS_CODE and ISSUER with registration records. |
Session not found | Portal session expired (login token lifetime elapsed) before consent arrived |
Contact the network operator to inspect the session in the Auth Portal backoffice (Requests and Consents).
Requester kyc/fetch fails
message | Cause | Resolution |
|---|---|---|
Auth token has expired | More than 5 minutes elapsed after approval | Call kyc/fetch immediately on callback; have the customer restart. |
Auth token aud … does not match this service (…) | Token was issued for a different Requester, or your ISS_CODE changed | Reject the request; align ISS_CODE with partners if changed. |
Auth token iss_code … is not an authorized or enabled partner / is not a provider | Provider is missing from allowlist, disabled, or lacks the Provider role | Update the partner entry under Partners. |
Token is invalid or expired | Request session for ref_id is unknown or expired | Have the customer restart the flow. |
Request session is not in a fetchable state: completed | This flow was already fetched | Use the previously fetched data; do not call kyc/fetch twice for one session. |
Requested tier N exceeds authorized tier M | tier in kyc/fetch exceeds the tier in the login token | Send the tier requested in step 1. |
Provider is not in the allowlist. | No enabled Provider partner matches both iss_code and camdx_code | Verify the partner's Code, CamDX member code, and Provider role. |
Provider refused the KYC request (400) | The Provider's sidecar returned 4xx on resolve | See the next table; ask the Provider to check its sidecar log and Sessions for the exact reason. |
Provider KYC resolution failed: HTTP … (500) | The Provider's sidecar returned 5xx on resolve | Have the customer retry, and escalate to the Provider if persistent. |
Failed to retrieve KYC from provider (500) | Your Security Server or the Provider was unreachable | Verify CamDX connectivity and run Ping against the Provider in the backoffice. |
Attestation verification failed: … / Attestation issuer is not a registered domain of this provider (500) | Document failed integrity, signature, DNS-DID, or partner domain checks | Do not accept the data. Confirm the Provider's openatts DNS record matches its wallet and its ISSUER domain is listed in your partner Domains. |
Reasons a Provider refuses resolve
These messages appear in the Provider's sidecar log when it returns 400 to a Requester's resolve call (the Requester sees 400 Provider refused the KYC request).
Provider message | Responsible side | Resolution |
|---|---|---|
No requester partner found for aud: … | Provider | Add the Requester to your allowlist with its exact ISS_CODE. |
No domains configured for requester partner: … | Provider | Add the Requester's issuer domain under Domains on the partner record. |
No public keys found for requester domains: … | Requester or Provider | Requester publishes ekyc_pub at that domain, or Provider corrects the configured domain. |
Requester signature verification failed | Requester | Requester's published ekyc_pub DNS key does not match JWT_PRIVATE_KEY. |
CamDX member code does not match the requester partner | Provider | Correct the Requester's CamDX member code in your allowlist and confirm the Security Server forwards X-Road-Client. |
Auth token has already been used or is not redeemable / Auth token has already been used or expired | – | Replay or expired redemption attempt; expected rejection. |
Token is invalid or expired | – | Auth token is unknown or older than 5 minutes. |
Requested tier N exceeds authorized tier M | Requester | Fetch at or below the tier approved by the customer. |
KYC data no longer available | Provider | Attestation was invalidated after consent; ask the customer to re-share to deliver the replacement attestation. |
Attestation status is unknown or unexpected
Status checks are optional and never block sharing. GET /kyc/{ekyc_ref}/status returns 200 with unknown when a declared check cannot complete; unknown means status is inconclusive rather than current or invalidated. Check each source's reason:
reason | Cause | Resolution |
|---|---|---|
timeout | Check exceeded STATUS_CHECK_TIMEOUT_MS | Retry; increase STATUS_CHECK_TIMEOUT_MS only if network latency is consistently high. |
unreachable | CamDL JSON-RPC endpoint unreachable | Verify RPC_URL and outbound network rules. |
http_error | Provider's status service returned a non-200 response | Verify CamDX connectivity, kyc-status-v1 publication, and that the Provider has you enabled with the Requester role. |
bad_response | Response failed schema, merkle_root, nonce, or responded_at freshness checks | Check server clock sync (NTP) and report malformed responses to the Provider. |
bad_signature | Response signature failed verification against the Provider's DNS keys | Provider must align its ekyc_pub DNS record with JWT_PRIVATE_KEY. |
not_found | Provider's status service has no delivery record of this attestation for your organisation | Confirm the attestation originated from that Provider and contact them if unexpected. |
member_mismatch | Attestation's CamDX member differs from your Provider partner's CamDX member code | Correct CamDX member code on the partner record. |
chain_mismatch | Attestation's CamDL chain ID differs from your CAMDL_CHAIN_ID | Align CAMDL_CHAIN_ID with the network chain or treat CamDL checking as unsupported for that attestation. |
not_configured | RPC_URL or CAMDL_CHAIN_ID is unset | Configure both variables to enable CamDL checks. |
malformed_declaration | Attestation's declared status metadata is invalid | Cannot be resolved on the Requester side; ask the Provider to issue a replacement attestation. |
Overall unknown also occurs when one declared source returns current while another returns unknown. Once any check confirms invalidated, the overall status remains invalidated.
Status is not_supported
The attestation declares no status checks, so the sidecar performs no network calls (for example, when the Provider configured ATTESTATION_STATUS_CHECKS=none). The attestation remains valid and needs no reissuance; only the Provider can enable checks for future attestations.
404 on GET /kyc/{ekyc_ref}, /status, or DELETE
The ekyc_ref is unknown or was deleted. Deleted attestations retain only non-PII metadata, and read-back, status, and delete calls return 404. Verify you are passing the ekyc_ref returned by kyc/fetch.
Ping fails in the backoffice
| Result | Cause | Resolution |
|---|---|---|
Connection failed: … | Security Server is unreachable or path is misconfigured | Verify CAMDX_SECURITY_SERVER and the partner's CamDX eKYC path. |
Provider returned HTTP 400: … No partner found for CamDX member code | Partner has not allowlisted your member code | Ask the partner to add your exact CAMDX_MEMBER_CODE. |
… is not enabled / … is not an authorized requester | Partner record exists but is disabled or lacks the Requester role | Ask the partner to enable you and assign the Requester role. |
Provider returned HTTP 4xx/5xx (CamDX error) | ping service is not published or access is not granted | Ask the partner's Security Server administrator to publish ping and grant access to your member code. |
Check that your DNS key matches your private key
Compute the expected ekyc_pub value from your sidecar's private key and compare it with your live DNS record:
# Derive ekyc_pub from the private key (same encoding as scripts/generate-test-resources.js)
JWT_PRIVATE_KEY="$(cat ekyc-private.pem)" node -e '
const c = require("crypto");
const pem = process.env.JWT_PRIVATE_KEY.replace(/\\n/g, "\n");
const { x, y } = c.createPublicKey(pem).export({ format: "jwk" });
const X = Buffer.from(x, "base64url"), Y = Buffer.from(y, "base64url");
console.log("ekyc_pub=" + Buffer.concat([Buffer.from([Y[Y.length - 1] & 1 ? 3 : 2]), X]).toString("base64"));'
# Query public DNS
dig +short TXT ekyc.yourorg.com.kh
One of the returned ekyc_pub= records must match exactly. For attestations, the address in openatts … p=did:ethr:<address>#controller must match your attestation wallet address.
Allow for DNS caching up to the record's TTL after changes; use short TTLs (such as 300 seconds) during key rotation.
Reporting an issue
When escalating an issue to a partner or the network operator, provide the timestamp, the ref_id (decoded from the login token; non-sensitive), both organisations' codes, and the exact error message. Never share raw tokens, API secrets, or customer personal data.