Mintplex-Labs/anything-llm · error · Error

Community Hub connection key not found

Error message

Community Hub connection key not found

What it means

Thrown by POST /community-hub/:communityHubItemType/create when SystemSettings.hubSettings() returns no connectionKey. The connectionKey is the credential used to authenticate publish/create calls against the remote Community Hub service, so without it the downstream CommunityHub.createStaticItem call cannot proceed. This is a configuration precondition, not a runtime fault.

Source

Thrown at server/endpoints/communityHub.js:193

        const { connectionKey } = await SystemSettings.hubSettings();
        const items = await CommunityHub.fetchUserItems(connectionKey);
        response.status(200).json({ success: true, ...items });
      } catch (error) {
        console.error(error);
        response.status(500).json({ success: false, error: error.message });
      }
    }
  );

  app.post(
    "/community-hub/:communityHubItemType/create",
    [validatedRequest, flexUserRoleValid([ROLES.admin])],
    async (request, response) => {
      try {
        const { communityHubItemType } = request.params;
        const { connectionKey } = await SystemSettings.hubSettings();
        if (!connectionKey)
          throw new Error("Community Hub connection key not found");

        const data = reqBody(request);
        const { success, error, itemId } = await CommunityHub.createStaticItem(
          communityHubItemType,
          data,
          connectionKey
        );
        if (!success) throw new Error(error);

        await EventLogs.logEvent(
          "community_hub_publish",
          { itemType: communityHubItemType },
          response.locals?.user?.id
        );
        response
          .status(200)
          .json({ success: true, error: null, item: { id: itemId } });
      } catch (error) {

View on GitHub (pinned to 526360e320)

Solutions

  1. Navigate to System Settings → Community Hub and enter the connection key issued by the hub.
  2. Verify the key saved by re-opening the settings panel (not just submitting).
  3. Check that hubSettings() reads from the correct settings row and is not masked by an env override.
  4. If the key was revoked, obtain a new one from the Community Hub administrator.
Defensive patterns

Strategy: validation

Validate before calling

const { connectionKey } = await SystemSettings.hubSettings();
if (!connectionKey) {
  return res.status(400).json({ success: false, error: 'Configure the Community Hub connection key in System Settings first.' });
}

Prevention

When it happens

Trigger: An admin user clicks 'Publish to Community Hub' before configuring the connection key in System Settings. Also if the setting was saved as an empty string or cleared.

Common situations: Fresh installation where Community Hub was never set up; an admin rotated/cleared the key; the hubSettings() loader failed silently and defaulted to empty.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/40e8a7047949ef48. Report an issue: GitHub.