Troubleshooting
This page provides a checklist and quick diagnostic steps for common errors when deploying and operating HieraChain.
API not responding or 404
-
Check the server process:
-
Default listens on
http://localhost:2661. Openhttp://localhost:2661/docsto verify. - If the port has changed: see
hierachain/config/settings.py(environment variableHRC_API_PORT).
401/403 when calling API
-
Production may enable AUTH:
settings.AUTH_ENABLED. In that case, you need to send an API key: -
Header name depends on
settings.API_KEY_NAME(defaultX-API-Key).
Error when adding events (schema mismatch)
-
Ensure the payload includes the required fields:
-
detailsis a map. Non-string values will be converted to strings. - Timestamps are server-generated; no need to send from the client.
Cannot create a Sub-Chain
-
Chain creation endpoint:
-
Chain name must match regex
[a-zA-Z0-9_\-]+(see validation inapi/v1/endpoints.py).
Events not appearing in returned blocks
-
Use the block retrieval API:
-
Some chains need to be finalized or have a proof submitted to see new blocks. Try submitting a proof:
Poor performance / 503 Service Unavailable
- If
ResourceGuardMiddlewareis integrated, 503 may be due to CPU/RAM exceeding thresholds. - Check rate limit/HSTS/CORS configuration in
settings.py. - Reduce event batch sizes, enable advanced caching if appropriate (
ADVANCED_CACHING_ENABLED).
Redis/SQLite not connecting
-
Check environment variables:
-
DATABASE_URL(SQLite/PostgreSQL) -
REDIS_HOST,REDIS_PORT,REDIS_DB -
Switch
DEFAULT_STORAGE_BACKENDtomemoryto isolate storage issues.
V2 endpoints return errors
- Verify that API v2 is loaded (see
hierachain/api/server.pyandhierachain/api/v2/endpoints.py). -
Try the v2 health endpoint:
Signatures/keys
- Check the public key is 64‑hex (Ed25519) when registering users (
security/identity.py). - Use
security/security_utils.pyto generate test key pairs.
Logging and auditing
- Set the appropriate log level, see
settings.LOG_LEVEL. - Use
risk_management/audit_logger.pyfor audit trails.