nanocoai/nanoclaw · critical · Error
Container config not found for agent group: ${agentGroupId}
Error message
Container config not found for agent group: ${agentGroupId} What it means
materializeContainerJson found the agent group but no row in container_configs for it. Normally backfill-container-configs.ts creates a default row at startup, so a missing row means the backfill was skipped, the row was deleted, or the group was created outside the normal path.
Source
Thrown at src/container-config.ts:388
maxMessagesPerPrompt: row.max_messages_per_prompt ?? undefined,
model: row.model ?? undefined,
effort: row.effort ?? undefined,
timezone: row.timezone && isValidTimezone(row.timezone) ? row.timezone : undefined,
runtimeTier: parseRuntimeTier(row.runtime_tier, group.name),
};
}
/**
* Materialize `container.json` from the DB. Called at spawn time so the
* container always sees fresh config. Returns the `ContainerConfig` for
* use by the caller (buildMounts, composeSessionSpec, etc.).
*/
export async function materializeContainerJson(agentGroupId: string): Promise<ContainerConfig> {
const group = await getAgentGroup(agentGroupId);
if (!group) throw new Error(`Agent group not found: ${agentGroupId}`);
const row = await getContainerConfig(agentGroupId);
if (!row) throw new Error(`Container config not found for agent group: ${agentGroupId}`);
const config = configFromDb(row, group);
const p = path.join(GROUPS_DIR, group.folder, 'container.json');
const dir = path.dirname(p);
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
fs.writeFileSync(p, JSON.stringify(config, null, 2) + '\n');
return config;
}
View on GitHub (pinned to 294ef2aee8)
Solutions
- Restart the host (pnpm run dev / systemctl --user restart nanoclaw) so backfill creates the default row
- Or insert one programmatically via the createContainerConfig path / ncl groups config update
- If migrations were skipped, run them, then restart
- Check logs/nanoclaw.error.log for a failed backfill
Defensive patterns
Strategy: fallback
Validate before calling
let row = await getContainerConfig(agentGroupId); if (!row) { row = await createDefaultContainerConfig(agentGroupId); } // or trigger backfill Try / catch
try { await materializeContainerJson(id); } catch (err) { if (err.message.includes('Container config not found')) { await runBackfill(); return await materializeContainerJson(id); } throw err; } Prevention
- Create groups through the supported paths (ncl groups create / init-first-agent) so container_configs rows are seeded
- Restart the host after manual DB repairs so backfill runs
- Keep migrations current; check logs/nanoclaw.error.log for backfill failures
When it happens
Trigger: Group created by direct DB insert without a container_configs row; container_configs row deleted manually; startup backfill (backfill-container-configs.ts) failed or hasn't run yet after adding a group.
Common situations: Manual DB seeding during migration testing; an old install upgraded without running migrations; deleting the config row to 'reset' it.
Related errors
- Agent group not found: ${agentGroupId}
- No container config for group: ${id}
- --cli-scope must be one of: disabled, group, global
- Nothing to update — provide at least one of: --provider, --m
- server name must be 1-64 characters of letters, digits, "_"
AI-assisted analysis of nanocoai/nanoclaw@294ef2aee8 (2026-08-28).
Data as JSON: /api/errors/47f805386ab8f160.
Report an issue: GitHub.