{"record":{"id":"fedbc74962c5ed7d","repo":"nanocoai/nanoclaw","slug":"provide-host-host-path-and-container-contai","errorCode":null,"errorMessage":"Provide --host <host-path> and --container <container-path>","messagePattern":"Provide --host <host-path> and --container <container-path>","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/resources/groups.ts","lineNumber":567,"sourceCode":"        return {\n          removed: { apt: apt || null, npm: npm || null },\n          note: 'Image rebuild required for package changes to take effect.',\n        };\n      },\n    },\n    'config add-mount': {\n      access: 'approval',\n      hostOnly: true,\n      description:\n        \"Mount a host directory into a group's containers. OPERATOR-ONLY — never runnable from \" +\n        'inside a container (mounting host paths is a filesystem-access boundary). Requires ' +\n        '`ncl groups restart` to take effect. Use --id <group-id> --host <host-path> --container <container-path> [--ro].',\n      handler: async (args) => {\n        const id = args.id as string;\n        if (!id) throw new Error('--id is required');\n        const hostPath = (args.host ?? args['host-path']) as string | undefined;\n        const containerPath = (args.container ?? args['container-path']) as string | undefined;\n        if (!hostPath || !containerPath) throw new Error('Provide --host <host-path> and --container <container-path>');\n\n        const row = await getContainerConfig(id);\n        if (!row) throw new Error(`No container config for group: ${id}`);\n\n        const mount: AdditionalMountConfig = {\n          hostPath,\n          containerPath,\n          ...(args.ro || args.readonly ? { readonly: true } : {}),\n        };\n        const existing = JSON.parse(row.additional_mounts) as AdditionalMountConfig[];\n        if (!existing.some((m) => m.hostPath === hostPath && m.containerPath === containerPath)) {\n          existing.push(mount);\n          await updateContainerConfigJson(id, 'additional_mounts', existing);\n        }\n        return { added: mount, note: `Run \\`ncl groups restart --id ${id}\\` for the mount to take effect.` };\n      },\n    },\n    'config remove-mount': {","sourceCodeStart":549,"sourceCodeEnd":585,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/src/cli/resources/groups.ts#L549-L585","documentation":"Thrown by `ncl groups config add-mount` when either the host path or container path is missing. The handler accepts `--host`/`--host-path` and `--container`/`--container-path` aliases but requires both to be non-empty before building the `AdditionalMountConfig` object.","triggerScenarios":"`ncl groups config add-mount --id <g> --host /srv/data` (no --container), or the reverse, or empty-string values for either flag.","commonSituations":"Assuming the container path defaults to the host path; typos like `--hostpath` that fall into args['host-path'] but with wrong casing; script variables that are unset.","solutions":["Supply both flags: `--host <host-path> --container <container-path>`","If scripting, assert both variables are set and non-empty before invoking"],"exampleFix":"# before\nncl groups config add-mount --id my-group --host /srv/data\n# after\nncl groups config add-mount --id my-group --host /srv/data --container /data","handlingStrategy":"validation","validationCode":"if (!hostPath || !containerPath) { console.error('both --host and --container are required'); process.exit(1); }","typeGuard":"const isMountArgs = (a: Record<string, unknown>): a is { host: string; container: string } => typeof a.host === 'string' && typeof a.container === 'string' && a.host !== '' && a.container !== '';","tryCatchPattern":null,"preventionTips":["Never assume the container path defaults to the host path","In scripts, destructure and assert both variables before building the command"],"tags":["cli","missing-argument","ncl","mounts"],"backgroundTag":"missing-required-argument","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}