nanocoai/nanoclaw · error · Error
member not found
Error message
member not found
What it means
Thrown by `ncl members remove` when the DELETE statement affected zero rows — no agent_group_members row matched the given (user_id, agent_group_id) pair. This is a no-op guard so the operator knows nothing was removed.
Source
Thrown at src/cli/resources/members.ts:66
new Date().toISOString(),
);
return { user_id: userId, agent_group_id: groupId };
},
},
remove: {
access: 'approval',
description: 'Remove a user from an agent group. Use --user and --group.',
handler: async (args) => {
const userId = args.user as string;
const groupId = args.group as string;
if (!userId) throw new Error('--user is required');
if (!groupId) throw new Error('--group is required');
const result = await getDb().run(
'DELETE FROM agent_group_members WHERE user_id = ? AND agent_group_id = ?',
userId,
groupId,
);
if (result.changes === 0) throw new Error('member not found');
return { removed: { user_id: userId, agent_group_id: groupId } };
},
},
},
});
View on GitHub (pinned to 294ef2aee8)
Solutions
- Check current membership: `ncl members list --group <gid>`
- Verify the user id format with `ncl users list` (must be <channel>:<handle>)
- If already removed, treat the end state as correct and continue
Defensive patterns
Strategy: try-catch
Validate before calling
const members = await listMembers(groupId); if (!members.some(m => m.user_id === userId)) { /* already absent */ } Try / catch
try { await removeMember(uid, gid); } catch (e) { if (e.message === 'member not found') return; /* idempotent success */ throw e; } Prevention
- Check membership before deleting
- Make removal scripts idempotent by swallowing not-found
When it happens
Trigger: The user was never a member of that group, was already removed, or either id is wrong (e.g. user id missing the <channel>: prefix or the group id typo'd).
Common situations: Re-running a removal script that already succeeded; user id format mismatch (bare handle instead of channel-qualified id); user belongs to a different group.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- policy not found
- ${def.name} not found: ${id}
- group not found: ${id}
- No container config for group: ${id}
- MCP server "${name}" not found
AI-assisted analysis of nanocoai/nanoclaw@294ef2aee8 (2026-08-28).
Data as JSON: /api/errors/afba71ba0af6eba3.
Report an issue: GitHub.