{"record":{"id":"6cacd32d37d4d6e8","repo":"agalwood/Motrix","slug":"plugin-lifecycle-secrets-seed-missing-6cacd3","errorCode":"plugin.lifecycle.secrets_seed_missing","errorMessage":"secret store is unavailable in this runtime","messagePattern":"secret store is unavailable in this runtime","errorType":"exception","errorClass":"SecretStoreError","httpStatus":null,"severity":"error","filePath":"src/core/plugin/capabilities/secret-store.ts","lineNumber":71,"sourceCode":"   */\n  available(): boolean\n}\n\n// ---------------------------------------------------------------------------\n// FailingSecretStore — sentinel for \"no secrets configured\"\n// ---------------------------------------------------------------------------\n\n/**\n * Used by tests and by the server impl when no seed is available.\n * available() is always false; encrypt/decrypt always reject.\n */\nexport class FailingSecretStore implements SecretStore {\n  available(): boolean {\n    return false\n  }\n\n  async encrypt(_plaintext: string): Promise<string> {\n    throw new SecretStoreError(\n      'plugin.lifecycle.secrets_seed_missing',\n      'secret store is unavailable in this runtime'\n    )\n  }\n\n  async decrypt(_token: string): Promise<string> {\n    throw new SecretStoreError(\n      'plugin.lifecycle.secrets_seed_missing',\n      'secret store is unavailable in this runtime'\n    )\n  }\n}\n","sourceCodeStart":53,"sourceCodeEnd":84,"githubUrl":"https://github.com/agalwood/Motrix/blob/1a708ee57746c434e2c67a44bbf0906a976afea4/src/core/plugin/capabilities/secret-store.ts#L53-L84","documentation":"The runtime installed FailingSecretStore because no encryption seed was configured. Its available() returns false and encrypt() always throws this error. Plugins that need to persist secrets cannot operate in this state; the error is the explicit signal rather than silently producing unreadable ciphertext.","triggerScenarios":"Plugin calls secretStore.encrypt() but the runtime was started without a seed (e.g. missing SEED env var, missing config field); dev/test environment never provisioned a seed; production deploy forgot the seed in the new region.","commonSituations":"New deployment missing the secrets-seed configuration; local dev without the seed; seed rotated/removed; container image lacks the seed mount.","solutions":["Configure the encryption seed in the runtime (env var or config) so a real SecretStore is installed.","Check secretStore.available() before calling encrypt() and degrade or surface a setup error.","Verify the seed is provisioned in deployment automation (CI/CD, IaC)."],"exampleFix":"// before\nconst token = await secretStore.encrypt(secret)\n\n// after\nif (!secretStore.available()) throw new Error('configure SECRETS_SEED to enable secret persistence')\nconst token = await secretStore.encrypt(secret)","handlingStrategy":"validation","validationCode":"if (!secretStore.available()) {\n  throw new Error('configure SECRETS_SEED to enable secret persistence')\n}\nawait secretStore.encrypt(plaintext)","typeGuard":"function secretsAvailable(s: SecretStore): s is SecretStore & { available(): true } {\n  return s.available() === true\n}","tryCatchPattern":null,"preventionTips":["Gate encrypt() on secretStore.available() and surface a setup error to the operator.","Provision the seed in deployment automation (env / secret manager / IaC).","Fail fast at boot if a plugin declares it needs secrets and no seed is configured."],"tags":["secret","encryption","config","runtime","setup"],"backgroundTag":null,"analyzedSha":"1a708ee57746c434e2c67a44bbf0906a976afea4","analyzedAt":"2026-08-12T16:18:09.346Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}