{"record":{"id":"2fff99d459f8fa4a","repo":"twentyhq/twenty","slug":"object-name-not-found-in-workspace-metadata","errorCode":null,"errorMessage":"Object \"${name}\" not found in workspace metadata. Has the app been installed and synced?","messagePattern":"Object \"(.+?)\" not found in workspace metadata\\. Has the app been installed and synced\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/twenty-apps/internal/twenty-partners/src/scripts/configure-partner-rls.ts","lineNumber":310,"sourceCode":"  console.log(`[rls:configure] target: ${metadataUrl}`);\n\n  // ── 1. Resolve all object metadata IDs and their partnerUser field IDs ──────\n\n  const objectsData = await metadataFetch<{\n    objects: { edges: { node: { id: string; nameSingular: string } }[] };\n  }>(\n    metadataUrl,\n    apiKey,\n    `{ objects(paging:{first:100}) { edges { node { id nameSingular } } } }`,\n  );\n\n  const objectIdByName = new Map<string, string>(\n    objectsData.objects.edges.map((e) => [e.node.nameSingular, e.node.id]),\n  );\n\n  for (const name of ALL_TARGET_OBJECTS) {\n    if (!objectIdByName.has(name)) {\n      throw new Error(\n        `Object \"${name}\" not found in workspace metadata. ` +\n          `Has the app been installed and synced?`,\n      );\n    }\n  }\n\n  if (!objectIdByName.has('workspaceMember')) {\n    throw new Error('workspaceMember object not found in workspace metadata.');\n  }\n\n  const workspaceMemberId = objectIdByName.get('workspaceMember') as string;\n\n  const objectInfoByName = new Map<SimpleTargetObject, ObjectInfo>();\n\n  for (const name of SIMPLE_TARGET_OBJECTS) {\n    const objectId = objectIdByName.get(name) as string;\n    const partnerUserFieldMetadataId = await findFieldByName(\n      metadataUrl,","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-apps/internal/twenty-partners/src/scripts/configure-partner-rls.ts#L292-L328","documentation":"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.","triggerScenarios":"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.","commonSituations":"Fresh workspace where the partners app was never installed; partial install; metadata sync pending; wrong workspace URL/key; app renamed an object across versions.","solutions":["Install the partners app in the target workspace and wait for metadata sync to complete.","Confirm TWENTY_PARTNERS_API_URL/TWENTY_PARTNERS_API_KEY point at the correct workspace.","Re-run rls:configure after the install/sync finishes (idempotent).","If the object was renamed in a newer app version, update to the matching app version or adjust ALL_TARGET_OBJECTS."],"exampleFix":"// before\nif (!objectIdByName.has(name)) {\n  throw new Error(`Object \"${name}\" not found in workspace metadata. Has the app been installed and synced?`);\n}\n\n// after — list which objects are missing in one pass\nconst missing = ALL_TARGET_OBJECTS.filter((n) => !objectIdByName.has(n));\nif (missing.length > 0) {\n  throw new Error(\n    `Missing objects in workspace metadata: ${missing.join(', ')}. ` +\n    `Install/re-sync the partners app, then re-run rls:configure.`,\n  );\n}","handlingStrategy":"validation","validationCode":"// Ensure the app is installed and synced before running rls:configure.\n// The script validates presence; pre-empt by checking install state:\nconst objects = await fetchObjectNames(metadataUrl, apiKey);\nconst required = ['partner','person','company','partnerLink','partnerService','partnerContent','application','opportunity'];\nconst missing = required.filter((n) => !objects.includes(n));\nif (missing.length > 0) {\n  throw new Error(`Install/sync the partners app; missing objects: ${missing.join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the partners app in the target workspace and wait for metadata sync.","Confirm TWENTY_PARTNERS_API_URL/API_KEY point at the correct workspace before running.","Re-run rls:configure after install/sync (idempotent).","If an object was renamed across app versions, align ALL_TARGET_OBJECTS with the installed version."],"tags":["metadata","install","config","rls","partners"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}