Skip to content
Latchkey

Buildkite agent "could not connect" in CI

The Buildkite agent starts but cannot open an HTTPS connection to agent.buildkite.com (or your configured endpoint). Until it connects, the agent never registers and no jobs are picked up.

What this error means

The agent log repeats a connection warning and retries. The agent never shows as "connected" in the Buildkite dashboard and jobs stay queued.

buildkite-agent
2026-06-30 12:00:01 WARN  Failed to find builds to run: Get "https://agent.buildkite.com/v3/...":
dial tcp: lookup agent.buildkite.com: no such host
2026-06-30 12:00:03 WARN  Connecting to Buildkite... (attempt 2)

Common causes

Outbound HTTPS to the Agent API is blocked

A firewall, security group, or egress proxy blocks port 443 to agent.buildkite.com, so the agent cannot reach the API to register or poll for jobs.

A wrong or unset endpoint

A custom endpoint in the agent config points somewhere unreachable, or DNS on the host cannot resolve the Buildkite hostname.

How to fix it

Open egress and confirm connectivity from the host

  1. Allow outbound HTTPS (443) to agent.buildkite.com from the agent host or its security group.
  2. From the host, run a direct request to confirm the API is reachable.
  3. Restart the agent and watch for a successful "Connected to Buildkite" line.
Terminal
curl -sS -o /dev/null -w "%{http_code}\n" https://agent.buildkite.com/v3

Point the agent at the correct endpoint and proxy

If the host uses an egress proxy, export it so the agent inherits it, and leave the default endpoint unless you run Buildkite behind a custom domain.

Terminal
export HTTPS_PROXY=http://proxy.internal:3128
export NO_PROXY=169.254.169.254
buildkite-agent start

How to prevent it

  • Allowlist outbound 443 to the Buildkite Agent API in the agent host network policy.
  • Set HTTPS_PROXY/NO_PROXY explicitly on proxied hosts.
  • Monitor agent connectivity so a network change surfaces before builds queue.

Frequently asked questions

What causes ""could not connect to buildkite""?
A firewall, security group, or egress proxy blocks port 443 to agent.buildkite.com, so the agent cannot reach the API to register or poll for jobs.
How do I fix "could not connect to buildkite"?
Open egress and confirm connectivity from the host

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card