twentyhq/twenty · error · Error

Object "${name}" not found in workspace metadata. Has the ap

Error message

Object "${name}" not found in workspace metadata. Has the app been installed and synced?

What it means

configure-partner-rls lists all objects in workspace metadata and asserts each of ALL_TARGET_OBJECTS (partner, person, company, partnerLink, partnerService, partnerContent, application, opportunity) is present. The throw names the first missing object and asks whether the app is installed and synced. It fails fast before attempting any field/predicate work.

Source

Thrown at packages/twenty-apps/internal/twenty-partners/src/scripts/configure-partner-rls.ts:310

  console.log(`[rls:configure] target: ${metadataUrl}`);

  // ── 1. Resolve all object metadata IDs and their partnerUser field IDs ──────

  const objectsData = await metadataFetch<{
    objects: { edges: { node: { id: string; nameSingular: string } }[] };
  }>(
    metadataUrl,
    apiKey,
    `{ objects(paging:{first:100}) { edges { node { id nameSingular } } } }`,
  );

  const objectIdByName = new Map<string, string>(
    objectsData.objects.edges.map((e) => [e.node.nameSingular, e.node.id]),
  );

  for (const name of ALL_TARGET_OBJECTS) {
    if (!objectIdByName.has(name)) {
      throw new Error(
        `Object "${name}" not found in workspace metadata. ` +
          `Has the app been installed and synced?`,
      );
    }
  }

  if (!objectIdByName.has('workspaceMember')) {
    throw new Error('workspaceMember object not found in workspace metadata.');
  }

  const workspaceMemberId = objectIdByName.get('workspaceMember') as string;

  const objectInfoByName = new Map<SimpleTargetObject, ObjectInfo>();

  for (const name of SIMPLE_TARGET_OBJECTS) {
    const objectId = objectIdByName.get(name) as string;
    const partnerUserFieldMetadataId = await findFieldByName(
      metadataUrl,

View on GitHub (pinned to 1f5dd2bbd2)

Solutions

  1. Install the partners app in the target workspace and wait for metadata sync to complete.
  2. Confirm TWENTY_PARTNERS_API_URL/TWENTY_PARTNERS_API_KEY point at the correct workspace.
  3. Re-run rls:configure after the install/sync finishes (idempotent).
  4. If the object was renamed in a newer app version, update to the matching app version or adjust ALL_TARGET_OBJECTS.

Example fix

// before
if (!objectIdByName.has(name)) {
  throw new Error(`Object "${name}" not found in workspace metadata. Has the app been installed and synced?`);
}

// after — list which objects are missing in one pass
const missing = ALL_TARGET_OBJECTS.filter((n) => !objectIdByName.has(n));
if (missing.length > 0) {
  throw new Error(
    `Missing objects in workspace metadata: ${missing.join(', ')}. ` +
    `Install/re-sync the partners app, then re-run rls:configure.`,
  );
}
Defensive patterns

Strategy: validation

Validate before calling

// Ensure the app is installed and synced before running rls:configure.
// The script validates presence; pre-empt by checking install state:
const objects = await fetchObjectNames(metadataUrl, apiKey);
const required = ['partner','person','company','partnerLink','partnerService','partnerContent','application','opportunity'];
const missing = required.filter((n) => !objects.includes(n));
if (missing.length > 0) {
  throw new Error(`Install/sync the partners app; missing objects: ${missing.join(', ')}`);
}

Prevention

When it happens

Trigger: The objects(paging:{first:100}) query returns a set whose nameSingular values do not include one of the target objects. Causes: the Twenty app defining these objects is not installed in the workspace; install completed but metadata sync hasn't run; a different/older app version missing an object; querying the wrong workspace.

Common situations: Fresh workspace where the partners app was never installed; partial install; metadata sync pending; wrong workspace URL/key; app renamed an object across versions.

Related errors


AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12). Data as JSON: /api/errors/2fff99d459f8fa4a. Report an issue: GitHub.