{"record":{"id":"0711d6ed16422745","repo":"Foundry376/Mailspring","slug":"mailspring-could-not-store-your-password-securely","errorCode":null,"errorMessage":"Mailspring could not store your password securely because encryption is not available on this system.","messagePattern":"Mailspring could not store your password securely because encryption is not available on this system\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/key-manager.ts","lineNumber":162,"sourceCode":"      } catch (err) {\n        console.warn('Mailspring could not re-encrypt your saved passwords with the new key.', err);\n      }\n    }\n\n    return keys;\n  }\n\n  _encryptionUnavailableHint() {\n    return process.platform === 'linux'\n      ? localized(\n          ' On Linux, Mailspring requires a secret service such as org.freedesktop.portal.Secret or org.freedesktop.Secret.Service. Please ensure a provider is installed and running, then restart Mailspring.'\n        )\n      : '';\n  }\n\n  async _writeKeyHash(keys: KeySet) {\n    if (!(await secureStorage.isAvailable())) {\n      throw new Error(\n        localized(\n          `Mailspring could not store your password securely because encryption is not available on this system.`\n        ) + this._encryptionUnavailableHint()\n      );\n    }\n    const enrcyptedCredentials = await secureStorage.encrypt(JSON.stringify(keys));\n    AppEnv.config.set(configCredentialsKey, enrcyptedCredentials);\n  }\n\n  _reportFatalError(err: Error): never {\n    // ensureClients is throttled rather than serialized, and _getKeyHash's callers report its\n    // throw a second time, so only the first failure gets a dialog. The rest still propagate.\n    if (this._fatalErrorReported) {\n      (err as any).noSentry = true;\n      throw err;\n    }\n    this._fatalErrorReported = true;\n","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/src/key-manager.ts#L144-L180","documentation":"KeyManager._writeKeyHash guard: secureStorage.isAvailable() is false, so there is no OS keychain/secret service to store the encrypted password keyset — on Linux this means no org.freedesktop.Secret.Service or xdg-portal Secret provider is running. The error halts storing any secrets rather than writing them unencrypted.","triggerScenarios":"Thrown at app/src/key-manager.ts:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["On Linux, install and start a secret service provider (gnome-keyring, KWallet, keepassxc with the freedesktop Secret Service) and restart Mailspring","On macOS/Windows, ensure the OS keychain is accessible and not locked by policy"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"648c685d602ece6bb00c22534b8734de6ac644b3","analyzedAt":"2026-09-03T02:00:24.311Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}