nanocoai/nanoclaw · error · Error

no messaging group for ${channelType} ${platformId} — create

Error message

no messaging group for ${channelType} ${platformId} — create + wire it first

What it means

Thrown by `ncl messaging-groups inject` when getMessagingGroupByPlatform(channelType, platformId, instance) returns null — no messaging_groups row matches that channel/platform/instance combination. The injection path requires the group to already exist and be wired before a message can be routed.

Source

Thrown at src/cli/resources/messaging-groups.ts:107

    const isGroup = Number(values.is_group ?? 0) === 1;
    values.unknown_sender_policy = resolveUnknownSenderPolicy(channelKey, isGroup, channelType);
  },
  customOperations: {
    send: {
      access: 'approval',
      description:
        'Inject a message into a messaging group as if a sender posted it, waking the wired agent — used to send a welcome on first wire. Use --channel-type, --platform-id, --text, optionally --instance, --sender-id, --sender.',
      handler: async (args) => {
        const channelType = args.channel_type as string;
        const platformId = args.platform_id as string;
        const text = args.text as string;
        if (!channelType || !platformId || !text) {
          throw new Error('--channel-type, --platform-id and --text are required');
        }
        const instance = (args.instance as string) ?? channelType;
        const mg = await getMessagingGroupByPlatform(channelType, platformId, instance);
        if (!mg) {
          throw new Error(`no messaging group for ${channelType} ${platformId} — create + wire it first`);
        }
        // Build the same InboundEvent the CLI admin transport (src/channels/cli.ts)
        // emits for a routed message, and route it in-process. The sender id should
        // be a wired user (e.g. the owner just granted) so the access gate passes.
        await routeInbound({
          channelType,
          instance,
          platformId,
          threadId: platformId,
          message: {
            id: `send-${randomUUID()}`,
            kind: 'chat',
            timestamp: new Date().toISOString(),
            content: JSON.stringify({
              text,
              sender: (args.sender as string) ?? 'cli',
              senderId: (args.sender_id as string) ?? 'cli:local',
            }),

View on GitHub (pinned to 294ef2aee8)

Solutions

  1. List what exists: `ncl messaging-groups list` and compare channel_type/platform_id/instance
  2. Create and wire the group (setup wizard or `ncl messaging-groups create` + `ncl wirings create`), then re-inject
  3. If the adapter uses a named instance, pass --instance explicitly
Defensive patterns

Strategy: validation

Validate before calling

const mg = await getMessagingGroupByPlatform(channelType, platformId, instance); if (!mg) throw new Error('create + wire the messaging group before injecting');

Try / catch

Catch the 'no messaging group' error and fall back to creating/wiring the group, then retry once.

Prevention

When it happens

Trigger: Injecting before creating the messaging group and its wiring; wrong platform id; the group lives under a different instance name (instance defaults to channelType).

Common situations: Trying to send a first-wire welcome before the wiring step completed; platform id copied from a different chat; instance-specific adapters where the install uses a named instance.

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


AI-assisted analysis of nanocoai/nanoclaw@294ef2aee8 (2026-08-28). Data as JSON: /api/errors/3b1068b0254701cd. Report an issue: GitHub.