{"record":{"id":"db2db76341f40992","repo":"passbolt/passbolt_api","slug":"the-subscription-key-cannot-be-verified-db2db7","errorCode":null,"errorMessage":"The subscription key cannot be verified.","messagePattern":"The subscription key cannot be verified\\.","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"plugins/PassboltEe/Subscription/src/Controller/Subscriptions/SubscriptionsViewController.php","lineNumber":46,"sourceCode":" * Class SubscriptionsCreateController\n */\nclass SubscriptionsViewController extends AppController\n{\n    /**\n     * @return void\n     * @throws \\Exception\n     */\n    public function view()\n    {\n        if (!$this->User->isAdmin()) {\n            throw new ForbiddenException(__('You are not allowed to access this location.'));\n        }\n\n        try {\n            $service = new SubscriptionKeyGetService();\n            $keyDto = $service->get($this->User->getAccessControl());\n        } catch (SubscriptionSignatureException $e) {\n            throw new BadRequestException($e->getMessage());\n        } catch (SubscriptionException $e) {\n            throw new PaymentRequiredException($e->getMessage(), $e->getErrors());\n        }\n\n        $this->success(__('The subscription is valid.'), $keyDto->toArray());\n    }\n}\n","sourceCodeStart":28,"sourceCodeEnd":54,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Subscription/src/Controller/Subscriptions/SubscriptionsViewController.php#L28-L54","documentation":"When reading the stored subscription key, SubscriptionKeyGetService::get raised SubscriptionSignatureException: the locally stored key does not pass signature verification, indicating a corrupted or tampered key file/record. Surfaced as HTTP 400.","triggerScenarios":"GET /subscription.jsonapi where the persisted subscription key was modified, truncated, or written by an untrusted source so its signature check fails.","commonSituations":"Manual edits to the subscription record in the database; partial write/corruption during a failed update; restoring a DB backup with a mismatched key row.","solutions":["Re-submit a valid subscription key via POST /subscription.jsonapi to overwrite the corrupted stored key","Inspect the subscription_key table row for truncation or manual modifications","Restore from the license email/portal and re-apply the key","Check storage/filesystem integrity if corruption is recurring"],"exampleFix":"// before: DB contains hand-edited key -> 400 on GET /subscription\n// after\ncurl -X POST .../subscription.jsonapi -d \"data=<valid subscription key>\"","handlingStrategy":"try-catch","validationCode":"// Periodically validate the stored key before it matters\nconst status = await fetch('/subscription.jsonapi', {headers});\nif (status.status === 400 && (await status.json()).message.includes('cannot be verified')) {\n  alertAdmin('Stored subscription key corrupted — re-apply a valid key');\n}","typeGuard":null,"tryCatchPattern":"const res = await fetch('/subscription.jsonapi', {headers});\nif (res.status === 400 && res.body.message.includes('cannot be verified')) {\n  await reapplyKeyFromOriginalSource();\n}","preventionTips":["Never modify the subscription key rows in the database directly","Keep a copy of the original key for re-application","Verify DB restores include intact subscription_key data"],"tags":["subscription","signature","license","corruption"],"backgroundTag":"checksum-mismatch","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}