passbolt/passbolt_api · error · NotFoundException

The password expiry setting does not exist.

Error message

The password expiry setting does not exist.

What it means

NotFoundException thrown by PasswordExpiryDeleteSettingsService::delete when the PasswordExpirySettingsTable::get($id) call fails for any reason, meaning no password expiry setting row exists with the given UUID.

Solutions

  1. Fetch the current setting id via GET /password-expiry/settings and retry with a valid id.
  2. Check the database log to confirm the underlying Throwable was not a connection error being masked as 404.
  3. Refresh the admin UI so it lists current settings rather than stale ids.
  4. If the setting genuinely exists, inspect the password_expiry_settings table for the row.
Defensive patterns

Strategy: try-catch

Validate before calling

$exists = $table->exists(['id' => $id]); if (!$exists) { return; }

Type guard

function isValidUuid(string $v): bool { return (bool)preg_match('/^[0-9a-f-]{36}$/i', $v); }

Try / catch

try { $service->delete($uac, $id); } catch (NotFoundException $e) { // refetch setting id and retry }

Prevention

When it happens

Trigger: Calling delete with a well-formed UUID that does not correspond to an existing password_expiry_settings row, or a database error during get (the Throwable is swallowed and converted to 404).

Common situations: Deleting a setting that was already deleted by another admin, stale ids cached in the UI, or a database connectivity problem misreported as not-found.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17). Data as JSON: /api/errors/617f4a524d282e95. Report an issue: GitHub.

Appendix: source

Thrown at plugins/PassboltCe/PasswordExpiry/src/Service/Settings/PasswordExpiryDeleteSettingsService.php:48

    /**
     * Deletes Password expiry settings.
     *
     * @param \App\Utility\ExtendedUserAccessControl $uac UAC.
     * @param string $id Setting ID.
     * @return bool
     * @throws \Cake\Http\Exception\NotFoundException When the ID is not found.
     * @throws \Cake\ORM\Exception\PersistenceFailedException When the entity could not be deleted.
     */
    public function delete(UserAccessControl $uac, string $id): bool
    {
        /** @var \Passbolt\PasswordExpiry\Model\Table\PasswordExpirySettingsTable $passwordExpirySettingsTable */
        $passwordExpirySettingsTable = $this->fetchTable('Passbolt/PasswordExpiry.PasswordExpirySettings');

        try {
            $setting = $passwordExpirySettingsTable->get($id);
        } catch (Throwable $exception) {
            throw new NotFoundException(__('The password expiry setting does not exist.'));
        }

        $result = $passwordExpirySettingsTable->deleteOrFail($setting);

        /** Dispatch settings updated event. */
        $this->dispatchEvent(PasswordExpirySetSettingsService::EVENT_SETTINGS_UPDATED, compact('uac'), $setting);

        return $result;
    }
}

View on GitHub (pinned to 31c1bbc10f)