{"record":{"id":"eb6938093f8f5f29","repo":"different-ai/openwork","slug":"this-deployment-uses-one-managed-organization","errorCode":null,"errorMessage":"This deployment uses one managed organization.","messagePattern":"This deployment uses one managed organization\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"ee/apps/den-web/app/(den)/dashboard/_providers/org-dashboard-provider.tsx","lineNumber":421,"sourceCode":"      pendingReauthMutationsRef.current = [];\n      setReauthDialogOpen(false);\n\n      if (retryAfterReauth.length > 0) {\n        pendingReauthMutationsRef.current = [\n          ...retryAfterReauth,\n          ...queuedDuringRetry,\n        ];\n        setReauthDialogOpen(true);\n        return;\n      }\n\n      queuedActions = queuedDuringRetry;\n    }\n  }\n\n  async function createOrganization(name: string) {\n    if (isSingleOrgMode) {\n      throw new Error(\"This deployment uses one managed organization.\");\n    }\n\n    const trimmed = name.trim();\n    if (!trimmed) {\n      throw new Error(\"Enter an organization name.\");\n    }\n\n    setMutationBusy(\"create-organization\");\n    setOrgError(null);\n    try {\n      const { response, payload } = await requestJson(\n        \"/v1/org\",\n        {\n          method: \"POST\",\n          body: JSON.stringify({ name: trimmed }),\n        },\n        12000,\n      );","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_providers/org-dashboard-provider.tsx#L403-L439","documentation":"createOrganization throws this immediately when the deployment is in single-org mode (isSingleOrgMode). In such deployments the org is provisioned and managed centrally, so end users are not allowed to create additional organizations — the call is rejected client-side before any network request.","triggerScenarios":"Calling createOrganization while the Den deployment is configured with single managed organization mode (server/config flag), regardless of the name argument.","commonSituations":"Users on an enterprise/managed Den instance trying the 'Create organization' UI action; a desktop client connected to a self-hosted single-tenant server; a feature flag recently flipped to single-org mode while UI still shows the create button.","solutions":["Hide the create-organization affordance in the UI when isSingleOrgMode is true instead of letting the user hit the guard.","If org creation should be allowed, update the deployment configuration to disable single-org mode and redeploy.","Catch the error in the UI and show an explanatory message ('your organization manages this setting').","Route the request through the org's admins/Den control plane rather than self-serve creation."],"exampleFix":"// before\nawait createOrganization(\"New Org\"); // throws in single-org mode\n// after\nif (!isSingleOrgMode) {\n  await createOrganization(\"New Org\");\n} else {\n  showNotice(\"Organization creation is managed by your administrator.\");\n}","handlingStrategy":"validation","validationCode":"if (isSingleOrgMode) {\n  hideCreateOrganizationButton();\n}","typeGuard":null,"tryCatchPattern":"try {\n  await createOrganization(name);\n} catch (err) {\n  if (String(err.message).includes(\"one managed organization\")) {\n    showManagedModeNotice();\n  } else throw err;\n}","preventionTips":["Read isSingleOrgMode from the provider before rendering create-org UI.","Document managed-mode restrictions for users of enterprise deployments.","Keep deployment mode flags in sync between server config and web UI.","Offer admins a Den control-plane path instead of user self-serve creation.","Test both single-org and multi-org modes in CI."],"tags":["validation","guard","single-org-mode","den-web"],"backgroundTag":"operation-not-permitted","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}