cline/cline · error

Timed out waiting for hub ${label} lock ${lockDir}

Error message

Timed out waiting for hub ${label} lock ${lockDir}

What it means

Error "Timed out waiting for hub ${label} lock ${lockDir}" thrown in cline/cline.

Source

Thrown at sdk/packages/core/src/hub/discovery/index.ts:501

			const record = await readHubLockRecord(lockDir);
			if (!record) {
				// The winner creates the directory before it can publish owner.json.
				// Do not steal that initialization window. A genuinely abandoned
				// empty lock is reclaimed only after the bounded wait.
				if (Date.now() >= deadline) {
					await removeHubLock(lockDir);
					continue;
				}
				await sleep(HUB_STARTUP_LOCK_POLL_MS);
				continue;
			}
			const lockAge = Date.now() - Date.parse(record.acquiredAt);
			if (!isPidAlive(record.pid) || lockAge > HUB_STARTUP_LOCK_MAX_AGE_MS) {
				await removeHubLock(lockDir);
				continue;
			}
			if (Date.now() >= deadline) {
				throw new Error(`Timed out waiting for hub ${label} lock ${lockDir}`);
			}
			await sleep(HUB_STARTUP_LOCK_POLL_MS);
			continue;
		}

		try {
			await writeFile(
				join(lockDir, "owner.json"),
				`${JSON.stringify(
					{ pid: process.pid, acquiredAt: new Date().toISOString() },
					null,
					2,
				)}\n`,
				"utf8",
			);
			return await callback();
		} finally {
			await removeHubLock(lockDir);

View on GitHub (pinned to 491b30b806)

When it happens

Trigger: Thrown at sdk/packages/core/src/hub/discovery/index.ts:501 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of cline/cline@491b30b806 (2026-08-25). Data as JSON: /api/errors/3c97d039378c39af. Report an issue: GitHub.