nanocoai/nanoclaw · warning
wakeContainer failed — host-sweep will retry
Error message
wakeContainer failed — host-sweep will retry
What it means
Spawning a session container failed during wakeContainer; the wake is recorded as failed and host-sweep will retry on its next 60s pass. Messages stay queued in inbound.db — nothing is lost, delivery is delayed.
Source
Thrown at src/container-runner.ts:147
* Contract: never throws. Returns `true` on successful spawn, `false` on
* transient spawn failure (e.g. OneCLI gateway unreachable). Callers don't
* need to wrap — the inbound row stays pending and host-sweep retries on its
* next tick.
*/
export function wakeContainer(session: Session): Promise<boolean> {
if (activeContainers.has(session.id)) {
log.debug('Container already running', { sessionId: session.id });
return Promise.resolve(true);
}
const existing = wakePromises.get(session.id);
if (existing) {
log.debug('Container wake already in-flight — joining existing promise', { sessionId: session.id });
return existing;
}
const promise = spawnContainer(session)
.then(() => true)
.catch((err) => {
log.warn('wakeContainer failed — host-sweep will retry', { sessionId: session.id, err });
return false;
})
.finally(() => {
wakePromises.delete(session.id);
});
wakePromises.set(session.id, promise);
return promise;
}
async function spawnContainer(session: Session): Promise<void> {
const agentGroup = await getAgentGroup(session.agent_group_id);
if (!agentGroup) {
log.error('Agent group not found', { agentGroupId: session.agent_group_id });
return;
}
// Refresh the destination map and current-thread routing so any admin
// changes take effect on wake. Destinations come from the agent-to-agentView on GitHub (pinned to 294ef2aee8)
Solutions
- Check `docker ps -a | grep <session>` and the error field in the log line
- Ensure Docker is running and the image exists: `docker images nanoclaw-agent` — rebuild with `./container/build.sh` if missing
- Remove conflicting stale containers for the session
- Wait for host-sweep retry or nudge with a new message
Defensive patterns
Strategy: retry
Validate before calling
import { execSync } from 'node:child_process';
execSync('docker images nanoclaw-agent:latest'); // fails fast if image missing Try / catch
try { await wakeContainer(session); } catch { /* host-sweep retries in 60s; check docker first */ } Prevention
- Keep Docker running and the agent image built
- Protect data/ and images from aggressive `docker system prune`
- Watch logs/nanoclaw.error.log for spawn errors after host reboots
When it happens
Trigger: spawnContainer rejects: Docker daemon unreachable, image missing (nanoclaw-agent:latest not built), name/mount/network conflicts, or resource exhaustion on the host.
Common situations: Docker not running after host reboot; image removed by `docker system prune`; disk full; a stale container with the same name.
Related errors
- --stdin-json input exceeds ${MAX_STDIN_JSON_BYTES} bytes
- --stdin-json input is not valid JSON
- --stdin-json input must be one JSON object
- Failed to list existing sessions for adoption
- Failed to clean up orphaned containers
AI-assisted analysis of nanocoai/nanoclaw@294ef2aee8 (2026-08-28).
Data as JSON: /api/errors/904b7afadfd3fdc2.
Report an issue: GitHub.