Readiness API: GET /api/readyz
Applies to: MetaDefender Storage Security (MDSS) 4.7.0 and later. Earlier versions do not have this endpoint and answer 401 or 404 on this path.
Credentials: none. The endpoint needs no API key, Authorization header or cookie. Credentials sent anyway are ignored.
GET /api/readyz reports whether this MDSS instance can serve requests. It is meant for load balancers, uptime monitors and Kubernetes readiness probes.
Takes no parameters.
The HTTP status code carries the verdict:
200ready,503not ready. The body has the same shape in both cases.Every answer is current (
Cache-Control: no-store) and is read from state the gateway already holds. A probe never queries the database, the cache or the broker itself, so any polling interval is safe.The body holds only statuses and short reason codes: no URLs, versions, sizes or keys.
Statuses
Status | HTTP | Meaning |
|---|---|---|
| 200 | Everything reports fine. |
| 200 | MDSS serves requests, but something needs attention: processing paused by the storage guardrail, throttling, a replica missing, or no scan instance reachable. |
| 503 | MDSS cannot serve: the cache, database or message broker is unreachable, or a core service is not reporting. |
The overall status is the worst component status. A component carries a reason only when it is not Healthy.
Reasons
Reason | Status | On | Meaning |
|---|---|---|---|
| Unhealthy | cache, database, messageBroker | The gateway's connection is down, or its check failed or timed out. |
| Unhealthy | messageBroker | RabbitMQ has blocked the connection because of a memory or disk alarm on the broker. Nothing can be published. |
| Unhealthy | any | No check has completed yet (start-up), or the last result is older than 15 s. |
| Unhealthy | discovery, scanning, remediation | No replica of the service has sent a health report within its freshness window: the service is stopped, crashed or hung. |
| Degraded | discovery, scanning | Processing is paused by the storage guardrail: machine disk, database size or database disk at a critical level. |
| Degraded | scanning | Every MetaDefender Core instance returned errors on recent scan requests. |
| Degraded | discovery, scanning, remediation | The service is throttling its intake because of resource or queue pressure. |
| Degraded | discovery, scanning, remediation | One replica stopped reporting while another replica of the same service still reports. |
When several reasons apply to one component, the first in this order is reported: NotReporting, Paused, NoInstanceReachable, Throttling, ReplicaMissing.
How the status is tracked
Component | What is watched | Refreshed | Goes down after | Comes back after |
|---|---|---|---|---|
| The state of the gateway's own Redis connection | every 5 s | up to 5 s | up to 10 s: reconnect plus one cycle |
| The gateway's own queries. One | every 5 s | up to 10 s | up to 10 s |
| The state of the gateway's own RabbitMQ connection | every 5 s | up to 5 s | up to 5 s |
| Health reports every service broadcasts over RabbitMQ, every 10 s by default | on each report |
| up to 10 s: the first report of the restarted service |
| The storage guardrail in the Job Dispatcher: checked every 30 s, sent in its health report every 60 s | on each report | up to 90 s after a capacity signal turns critical | up to 90 s after every signal is back to normal. Resume is automatic only while all signals can be measured. |
| The autoscaler state of the service, plus the discovery queue thresholds | on each report | up to 10 s | when pressure is relieved or the service is idle. The autoscaler holds Throttle for at least 30 s. |
Over time:
Start-up. The gateway answers
503until its first checks run and the first report of every service arrives, about 10 to 20 s after it starts. The components showNotCheckedorNotReporting.One instance at a time. Each API gateway answers for itself. Behind a load balancer, probe every instance.
Forgotten replicas. A replica silent for 180 s is removed. Until then it shows as
ReplicaMissingif another replica of the same service still reports, orNotReportingif none does.Logging. The gateway logs a state change once:
Readiness check: the Database is Unhealthy (Unreachable)and laterReadiness check: the Database is reachable again. A503answered to a probe is logged at Information, not Error.
Examples
Call it
Only the HTTP code:
Only the components that are not healthy:
Database unreachable: 503 Service Unavailable
/api/health still answers 200 in this state: the process is alive, but it cannot serve.
Paused by the storage guardrail: 200 OK
The instance stays in the load balancer rotation. Free disk or database space, and the status returns to Healthy by itself.
Load balancer health check
Setting | Value |
|---|---|
Path |
|
Success codes |
|
Interval | 10 to 30 s |
Timeout | 5 s |
Unhealthy threshold | 2 |
Healthy threshold | 2 |
Do not point the health check at /: it is a static page served by the web server and answers 200 even while the API is down.
Kubernetes readiness probe
What you see during an Amazon MQ (RabbitMQ) maintenance
A broker node restarts. Within 5 s
/api/readyzanswers503,messageBroker: Unreachable.Every MDSS service restarts after losing the broker. While the API gateway restarts, the web server answers
502on every endpoint,/api/healthincluded, for a few seconds up to about half a minute.The gateway is back:
503withNotCheckedorNotReportingfor about 20 s while its checks and the service reports arrive.Every service reports:
200,Healthy.
If 503 with NotReporting persists for more than 2 to 3 minutes after the maintenance has ended, a service did not come back. Run sudo mdss -c restart on Linux, or restart the MDSS services on Windows.
Limitations
A Redis that is frozen but keeps its connection open still shows
cache: Healthy. A stopped or killed Redis is detected. Tracked in MDSS-15082.NoInstanceReachablereflects the errors the scanning service saw on recent scan requests. It is not a direct check of MetaDefender Core, and with no recent scansscanningstaysHealthy.On MDSS Cloud and other multi-tenant deployments
/api/healthand/api/readyzanswer without a tenant cookie and report deployment-level state only.