{"record":{"id":"14d0eac1c1e12560","repo":"passbolt/passbolt_api","slug":"password-expiry-is-not-activated","errorCode":null,"errorMessage":"Password expiry is not activated.","messagePattern":"Password expiry is not activated\\.","errorType":"console","errorClass":"StopException","httpStatus":null,"severity":"warning","filePath":"plugins/PassboltCe/PasswordExpiry/src/Service/Resources/PasswordExpiryGetOwnersOfExpiredResourcesService.php","lineNumber":61,"sourceCode":"     * @param \\Passbolt\\PasswordExpiry\\Service\\Settings\\PasswordExpiryGetSettingsServiceInterface $settingsService Get password expiry service\n     */\n    public function __construct(PasswordExpiryGetSettingsServiceInterface $settingsService)\n    {\n        $this->settingsService = $settingsService;\n    }\n\n    /**\n     * Notify the users about their passwords expiring today or in N days\n     *\n     * @return \\Cake\\ORM\\Query\n     * @throws \\Cake\\Console\\Exception\\StopException if the settings are not enabled\n     */\n    public function notifyResourceOwners(): Query\n    {\n        $settings = $this->settingsService->get();\n\n        if (!$settings->isPasswordExpiryFeatureEnabled()) {\n            throw new StopException(__('Password expiry is not activated.'));\n        }\n\n        $owners = $this->getOwnersToNotify();\n        $owners\n            ->find('locale')\n            ->contain(['Profiles' => AvatarsTable::addContainAvatar()]);\n\n        $this->dispatchEvent(\n            self::NOTIFY_ABOUT_EXPIRED_RESOURCES_EVENT_NAME,\n            [\n                'users' => $owners,\n            ],\n            $this\n        );\n\n        return $owners;\n    }\n","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltCe/PasswordExpiry/src/Service/Resources/PasswordExpiryGetOwnersOfExpiredResourcesService.php#L43-L79","documentation":"StopException thrown by notifyResourceOwners when the password expiry feature is disabled in organization settings. Notification of resource owners of expired resources only runs when the feature is activated.","triggerScenarios":"Executing the expired-resources owner notification query (e.g. via the password expiry notification command) while PasswordExpirySettingsDto::isPasswordExpiryFeatureEnabled() returns false.","commonSituations":"Running the password-expiry notify cron/job on an instance where admins never enabled the feature, or after an admin disabled it in the organization settings.","solutions":["Enable password expiry via POST /password-expiry/settings with automaticExpiryOnDeleteOnExpired activated in the payload.","Verify current settings via GET /password-expiry/settings.","Guard the job/command to skip execution when the feature is disabled.","If you believe it is enabled, check the setting row stored in organization_settings for the plugin scope."],"exampleFix":"// before (disabled)\n{}\n// after\n{\"automatic_expiry\": {\"automatic_expiry_on_delete_on_expired\": true, \"automatic_expiry_period\": \"90d\"}}","handlingStrategy":"validation","validationCode":"$settings = $settingsService->get(); if (!$settings->isPasswordExpiryFeatureEnabled()) { return null; // skip notification }","typeGuard":null,"tryCatchPattern":"try { $query = $service->notifyResourceOwners(); } catch (StopException $e) { // feature disabled; skip gracefully }","preventionTips":["Gate cron jobs/commands on the password expiry feature flag.","Verify the feature is enabled via GET /password-expiry/settings before scheduling notifications.","Document that disabling the feature stops owner notifications."],"tags":["password-expiry","feature-flag","config"],"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"}