louislam/uptime-kuma · error · Error
Connection to Docker daemon timed out.
Error message
Connection to Docker daemon timed out.
What it means
The catch block in testDockerHost inspects the axios error: if e.code === 'ECONNABORTED' or e.name === 'CanceledError' it re-throws as this friendly timeout message. The request has a 5000ms axios timeout and a 6000ms axiosAbortSignal, so the timeout fires at the 5–6 second mark. Any non-timeout axios error is rethrown as-is by the else branch.
Source
Thrown at server/docker.js:105
try {
let res = await axios.request(options);
if (Array.isArray(res.data)) {
if (res.data.length > 1) {
if ("ImageID" in res.data[0]) {
return res.data.length;
} else {
throw new Error("Invalid Docker response, is it Docker really a daemon?");
}
} else {
return res.data.length;
}
} else {
throw new Error("Invalid Docker response, is it Docker really a daemon?");
}
} catch (e) {
if (e.code === "ECONNABORTED" || e.name === "CanceledError") {
throw new Error("Connection to Docker daemon timed out.");
} else {
throw e;
}
}
}
/**
* Since axios 0.27.X, it does not accept `tcp://` protocol.
* Change it to `http://` on the fly in order to fix it. (https://github.com/louislam/uptime-kuma/issues/2165)
* @param {any} url URL to fix
* @returns {any} URL with tcp:// replaced by http://
*/
static patchDockerURL(url) {
if (typeof url === "string") {
// Replace the first occurrence only with g
return url.replace(/tcp:\/\//g, "http://");
}
return url;View on GitHub (pinned to 6b5ea01557)
Solutions
- Confirm the daemon is running: `systemctl status docker` (Linux) or `docker info`.
- From the Uptime Kuma host, time the call directly: `time curl --unix-socket /var/run/docker.sock http://localhost/containers/json?all=true` — if it takes >5s you need to raise the timeout or speed up the daemon.
- Open the network path: for TCP, ensure the port is reachable and not filtered; for TLS, confirm the cert files under data/docker-tls/<host>/.
- If your environment legitimately needs more time, raise `timeout` and the `axiosAbortSignal` delay in testDockerHost (server/docker.js:71-75).
Example fix
// before
const options = {
url: "/containers/json?all=true",
timeout: 5000,
// ...
signal: axiosAbortSignal(6000),
};
// after — give slow daemons a chance
const options = {
url: "/containers/json?all=true",
timeout: 15000,
// ...
signal: axiosAbortSignal(16000),
}; Defensive patterns
Strategy: retry
Validate before calling
// Sanity-check reachability and latency before configuring
async function probeDockerLatency(options) {
const start = Date.now();
try {
await require("axios").request({ ...options, timeout: 4000 });
return Date.now() - start;
} catch (e) {
if (e.code === "ECONNABORTED") return -1;
throw e;
}
} Try / catch
// Retry transient timeouts before reporting the host as broken
async function testWithRetry(host, attempts = 2) {
for (let i = 0; i < attempts; i++) {
try { return await DockerHost.testDockerHost(host); }
catch (e) {
if (/timed out/.test(e.message) && i < attempts - 1) continue;
throw e;
}
}
} Prevention
- Ensure dockerd is up and the network path is open before testing the host in the UI.
- On high-latency links, raise timeout/abortSignal in testDockerHost to avoid false negatives.
- Use the socket transport when possible — it removes a network hop.
When it happens
Trigger: The Docker daemon is unreachable (firewall, wrong host, down), or it is reachable but slow to enumerate containers, so the 5s timeout elapses. Socket path present but dockerd not running. TCP host behind a slow proxy. The 6000ms AbortController fires before axios's own timeout.
Common situations: Local dockerd stopped; firewall blocking 2375/2376; the daemon is up but on a busy host enumerating hundreds of containers; TLS handshake stalled by a missing/mismatched CA; remote daemon over a high-latency link.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Invalid Docker response, is it Docker really a daemon?
- Request timed out
- TLS Connection failed: ${message}
- docker host not found
- Embedded Mariadb supports only 'node' or 'root' user, but th
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/a70cdecf6a2bb8f1.
Report an issue: GitHub.