{"record":{"id":"f8d1c7e3e632a9c8","repo":"nanocoai/nanoclaw","slug":"failed-to-list-install-owned-networks","errorCode":null,"errorMessage":"Failed to list install-owned networks","messagePattern":"Failed to list install-owned networks","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/drivers/docker-driver.ts","lineNumber":397,"sourceCode":"      }\n      if (preSeam.length > 0) log.info('Stopped pre-seam containers', { count: preSeam.length, names: preSeam });\n    } catch (err) {\n      log.warn('Failed to clean up pre-seam containers', { err });\n    }\n\n    let names: string[] = [];\n    try {\n      const out = this.#cli.run([\n        'network',\n        'ls',\n        '--filter',\n        `label=${LABELS.install}=${installSlug}`,\n        '--format',\n        '{{.Name}}',\n      ]);\n      names = out.trim().split('\\n').filter(Boolean);\n    } catch (err) {\n      log.warn('Failed to list install-owned networks', { err });\n      return;\n    }\n    const removed: string[] = [];\n    for (const name of names) {\n      try {\n        this.#cli.run(['network', 'rm', validateRuntimeName(name, 'network')]);\n        removed.push(name);\n      } catch {\n        /* still in use by a live session, or already gone */\n      }\n    }\n    if (removed.length > 0) log.info('Removed orphaned networks', { count: removed.length, names: removed });\n  }\n\n  /**\n   * Name-existence alone cannot answer \"is this MY session\": the name is\n   * key-derived, but a foreign container can wear it — another install sharing\n   * this daemon whose truncated identity collides, or an operator's hand-made","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/src/drivers/docker-driver.ts#L379-L415","documentation":"The host could not list Docker networks owned by this install, so network residue reaping is skipped entirely this run. Orphaned networks accumulate until a later successful sweep.","triggerScenarios":"`docker network ls --filter label=...` fails — daemon unavailable mid-sweep, CLI parse issue, or docker socket permission problems.","commonSituations":"Docker restarting during a host sweep; permissions changed on the docker socket.","solutions":["Verify `docker network ls` works for the host user","Restart nanoclaw to retry the sweep","Prune stale networks manually if accumulation matters: `docker network prune` (careful — global)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"execSync('docker network ls').toString(); // gate before sweep","typeGuard":null,"tryCatchPattern":"try { listNetworks(); } catch { return; /* retried next sweep */ }","preventionTips":["Keep Docker healthy; restart nanoclaw after daemon restarts","Periodically audit install-labeled networks if warnings recur"],"tags":["docker","networks","cleanup"],"backgroundTag":"docker-daemon-unavailable","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}