Skip to content
Latchkey

Locust RPS stuck at 0 / all requests failing in CI

When Locust shows 0 RPS or a 100% failure column, no request is completing successfully. In CI this almost always means the --host is wrong or unreachable, the target is not up, or requests are rejected for missing auth.

What this error means

The Locust stats table shows all requests under the "# fails" column, RPS near 0, and a failures list dominated by ConnectionError or a repeated 401/403/404.

Locust
Type     Name    # reqs  # fails  |  Avg  ...  # RPS
GET      /       0       412(100%) |  0    ...  0.00
ConnectionError(... Connection refused ...)  412

Common causes

Wrong or unreachable host

A --host that points at the wrong address, or a target not yet listening, makes every request raise a connection error.

Missing auth or wrong path

If the endpoint needs a token or the path is wrong, every request returns 401/403/404 and counts as a failure.

How to fix it

Confirm host reachability before the run

  1. Curl the target from the same job to prove it is up and correct.
  2. Pass the confirmed URL as --host.
  3. Wait for readiness so the run does not start against a down target.
Terminal
curl -sf http://localhost:8080/health
locust --headless -u 100 -r 10 --run-time 1m --host http://localhost:8080

Send required auth in the task

Attach the token or session the endpoint requires so requests succeed instead of returning 401/403.

locustfile.py
from locust import HttpUser, task
class ApiUser(HttpUser):
    @task
    def get(self):
        self.client.get("/", headers={"Authorization": "Bearer " + TOKEN})

How to prevent it

  • Verify the target is up and the host is correct before load.
  • Provide auth headers or a login flow in the locustfile.
  • Use correct request paths so responses are not all failures.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →