{"record":{"id":"4014fc84aa71f76a","repo":"passbolt/passbolt_api","slug":"the-ldap-integration-is-not-configured-or-it-is-disabled","errorCode":null,"errorMessage":"The ldap integration is not configured or it is disabled","messagePattern":"The ldap integration is not configured or it is disabled","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/PassboltEe/DirectorySync/src/Command/DirectorySyncCommand.php","lineNumber":85,"sourceCode":"        return $consoleName;\n    }\n\n    /**\n     * @inheritDoc\n     */\n    public function execute(Arguments $args, ConsoleIo $io): ?int\n    {\n        $this->assertCurrentProcessUser($io, $this->processUserService);\n\n        $isLdapLoaded = extension_loaded('ldap');\n        if (!$isLdapLoaded) {\n            $this->error(__('Error: the ldap extension is not installed'), $io);\n            $this->abort();\n        }\n\n        $this->directoryOrgSettings = DirectoryOrgSettings::get();\n        if (!$this->directoryOrgSettings->isEnabled()) {\n            $io->err(__('The ldap integration is not configured or it is disabled'));\n            $io->info(\n                __(\n                    'To fix this problem, you need to configure ldap: {0}.',\n                    [Router::url('/app/administration/users-directory', true)]\n                )\n            );\n            $this->error(__('aborting'), $io);\n            $this->abort();\n        }\n        $this->warnPersist($args, $io);\n\n        return $this->successCode();\n    }\n\n    /**\n     * Check persist argument and displays a warning\n     *\n     * @param \\Cake\\Console\\Arguments $args The command arguments","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/DirectorySync/src/Command/DirectorySyncCommand.php#L67-L103","documentation":"DirectorySyncCommand checks the LDAP (directory sync) organization settings at startup; if DirectoryOrgSettings reports the integration as disabled or unconfigured, it prints 'The ldap integration is not configured or it is disabled' plus a hint URL and aborts. This is a deliberate guard: directory synchronization cannot run without LDAP settings enabled in the admin UI.","triggerScenarios":"Running `passbolt directory_sync` when the admin has never configured LDAP, or when directory sync is toggled off in administration settings (org settings missing the ldap fields or enabled=false).","commonSituations":"Fresh EE installations where LDAP was never set up; org settings reset after an upgrade; running the sync command on a machine pointed at a passbolt instance without the LDAP config; ldap PHP extension present but integration disabled.","solutions":["Open the hinted URL /app/administration/users-directory and configure + enable the LDAP directory.","Verify ldap org settings exist in the database (organization_settings table, property 'ldap').","Confirm the ldap PHP extension is installed (a preceding check aborts otherwise).","Re-run `passbolt directory_sync` after saving valid settings.","Use the LDAP test connection endpoint/command to validate credentials and server reachability first."],"exampleFix":"// before\n$io->err(__('The ldap integration is not configured or it is disabled'));\n// after\n$io->err(__('The ldap integration is not configured or it is disabled. Configure it at: ' . Router::url('/app/administration/users-directory', true)));","handlingStrategy":"validation","validationCode":"$settings = \\Passbolt\\DirectorySync\\Utility\\DirectoryOrgSettings::get();\nif (!$settings->isEnabled()) {\n    // bail out or prompt admin to enable LDAP before invoking the sync command\n}","typeGuard":"function isLdapEnabled(): bool {\n    try {\n        return \\Passbolt\\DirectorySync\\Utility\\DirectoryOrgSettings::get()->isEnabled();\n    } catch (\\Throwable $e) {\n        return false;\n    }\n}","tryCatchPattern":"try {\n    $this->runDirectorySync();\n} catch (\\Exception $e) {\n    if (str_contains($e->getMessage(), 'not configured or it is disabled')) {\n        // redirect admin to /app/administration/users-directory\n    }\n}","preventionTips":["Configure and enable LDAP in the admin UI before scheduling syncs.","Check org settings presence after upgrades or settings imports.","Verify the ldap PHP extension is installed on the host running the command.","Automate a pre-flight settings check in sync scripts."],"tags":["ldap","directory-sync","configuration","cli"],"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"}