{"record":{"id":"e6ae9eca71492914","repo":"passbolt/passbolt_api","slug":"directory-sync-plugin-is-not-enabled","errorCode":null,"errorMessage":"Directory sync plugin is not enabled.","messagePattern":"Directory sync plugin is not enabled\\.","errorType":"http","errorClass":"ServiceUnavailableException","httpStatus":503,"severity":"warning","filePath":"plugins/PassboltEe/DirectorySync/src/Controller/DirectoryIgnoreController.php","lineNumber":198,"sourceCode":"    private function normalizeForeignModel(string $foreignModel): string\n    {\n        $foreignModel = ucfirst($foreignModel);\n        if ($foreignModel === 'Directoryentries') {\n            $foreignModel = 'DirectoryEntries';\n        }\n\n        return $foreignModel;\n    }\n\n    /**\n     * Assert the directory is configured.\n     *\n     * @return void\n     */\n    protected function assertDirectoryEnabled()\n    {\n        if (!$this->directoryOrgSettings->isEnabled()) {\n            throw new ServiceUnavailableException('Directory sync plugin is not enabled.');\n        }\n    }\n}\n","sourceCodeStart":180,"sourceCodeEnd":202,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/DirectorySync/src/Controller/DirectoryIgnoreController.php#L180-L202","documentation":"DirectoryIgnoreController throws this ServiceUnavailableException (HTTP 503) from assertDirectoryEnabled() when the LDAP/directory sync organization settings are not enabled. All directory-ignore endpoints (toggle, view, add, delete) call it before doing any work, so none of those APIs function while the feature is disabled in org settings. It signals the feature is switched off, not that the request is malformed.","triggerScenarios":"Any call to GET/POST/DELETE /directory/import/... endpoints when DirectoryOrgSettings::isEnabled() returns false — i.e. no passbolt LDAP org settings saved, or the integration was disabled via the settings disable endpoint.","commonSituations":"Fresh passbolt EE install where LDAP settings were never saved; admin disabled directory sync but scripts still poll the ignore endpoints; wrong environment (prod settings not loaded, e.g. missing/misconfigured passbolt.php or org-settings storage) making isEnabled() false; setup without an active EE license so settings cannot be enabled.","solutions":["Save valid LDAP settings via POST /directorysync/settings or the admin UI to enable directory sync.","If the feature was intentionally disabled, stop calling the /directory/import endpoints.","Verify org settings persistence: check the organization settings storage for the directory-sync entries.","Confirm the EE license/subscription is active so directory sync can be enabled.","Check which environment/config is loaded (passbolt.php, env vars) to ensure the right org settings source is being read."],"exampleFix":"// before\ncurl -X DELETE https://passbolt.example.com/directory/import/users/<uuid>\n// 503 Directory sync plugin is not enabled\n// after\n# first enable directory sync by saving settings\ncurl -X POST -H 'Content-Type: application/json' -d '{\"directory_type\":\"ldap\", ...}' \\\n  https://passbolt.example.com/directorysync/settings.json\n# then retry the ignore endpoint","handlingStrategy":"fallback","validationCode":"// client-side pre-check before calling ignore endpoints\nconst settings = await api.get('/directorysync/settings.json');\nif (!settings.body || settings.status === 503) {\n    throw new Error('Directory sync is not enabled; skipping ignore operations');\n}","typeGuard":null,"tryCatchPattern":"try {\n    await api.delete(`/directory/import/${model}/${id}`);\n} catch (e) {\n    if (e.response?.status === 503) {\n        console.warn('Directory sync disabled; enable it in admin settings first.');\n        return; // degrade gracefully instead of failing the workflow\n    }\n    throw e;\n}","preventionTips":["Enable and save LDAP settings before automating any /directory/import calls.","After disabling directory sync, remove or gate the jobs/scripts that call its endpoints.","Verify the EE subscription/licensing is active so settings can be saved.","Check the correct environment's org settings when running scripts against staging vs prod."],"tags":["feature-disabled","http-503","ldap-directory-sync","configuration"],"backgroundTag":"feature-not-enabled","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}