Mintplex-Labs/anything-llm · info

Memory is already global.

Error message

Memory is already global.

What it means

Idempotency message from Memory.promoteToGlobal when the memory's scope is already 'global'. The model returns {memory: existing, message}, and the endpoint only returns 400 when memory is null — so this message is effectively informational: the endpoint actually responds 200 with the memory. You will encounter it in logs/tests, not as an HTTP error body.

Source

Thrown at server/endpoints/memory.js:157

        console.error(e);
        return response.sendStatus(500);
      }
    }
  );

  app.post(
    "/memories/:memoryId/promote",
    [
      validatedRequest,
      flexUserRoleValid([ROLES.all]),
      memoryFeatureEnabled,
      validateMemoryOwner,
    ],
    async (request, response) => {
      try {
        const memoryId = Number(request.params.memoryId);
        const { memory, message } = await Memory.promoteToGlobal(memoryId);
        if (!memory) return response.status(400).json({ error: message });

        response.status(200).json({ memory });
      } catch (e) {
        console.error(e);
        return response.sendStatus(500);
      }
    }
  );

  app.post(
    "/memories/:memoryId/demote/:slug",
    [
      validatedRequest,
      flexUserRoleValid([ROLES.all]),
      memoryFeatureEnabled,
      validateMemoryOwner,
      validWorkspaceSlug,
    ],

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Nothing to fix — the request succeeds (200) and returns the current memory
  2. Hide/disable the Promote action when the loaded memory already has scope 'global'
  3. Safe to ignore in automation; the operation is idempotent

Example fix

// before
if (memory) showPromoteButton();
// after
if (memory && memory.scope !== 'global') showPromoteButton();
Defensive patterns

Strategy: type-guard

Type guard

function isPromotable(memory) {
  return memory !== null && memory.scope === 'workspace'; // only workspace memories can promote
}

Prevention

When it happens

Trigger: POST /memories/:id/promote on a memory whose scope is already 'global' — typically a double-submit or a stale UI still showing a 'Promote' action.

Common situations: Promote button double-clicked; another client promoted the same memory moments earlier; retrying a promote that already succeeded.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/b193216add04f2e2. Report an issue: GitHub.