Skip to main content

Troubleshooting

Module not initialized

Make sure @quik/healthcheck is registered in your bootstrap module and appears after @quik/core (and before @quik/http finishes initializing, if you want the /health//ready routes).

/ready always returns 503

An item stays at its default pending status until something calls ready()/ok() on it, or until a registered check via registerCheck() runs and resolves it. GET /ready treats pending as not-ready and returns 503 until every registered item settles to ready.

Routes not registered

QHealthcheckRoute (GET /health, GET /ready) is only registered in onAfterInit when both @quik/http is present in bootstrap and an IQHTTPEngine feature instance exists (e.g. @quik/http-express has run its own setup()). If either is missing, no routes are added — this is silent, not an error.

Check keeps timing out

registerCheck(name, check, options) races the check against options.timeoutMs (or the healthcheck.timeoutMilliseconds config default, 2000ms). A slow check resolves to options.onTimeoutStatus (default pending) rather than throwing.

Common Errors

@quik/healthcheck has no errors.* locale keys of its own — QHealthcheckRoute responds with translated status messages instead of typed errors:

  • quik.healthcheck.errors.pending — an item has not yet reported readiness.
  • quik.healthcheck.errors.unready — an item explicitly reported unready.
  • quik.healthcheck.errors.down — an item explicitly reported down.
  • quik.healthcheck.errors.degraded — an item explicitly reported degraded.
  • quik.healthcheck.errors.unhealthy — the aggregate status could not be classified, or getReady() threw.