Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keychain errors not handled when removing users #8280

Open
2 tasks
neurodiverseEsoteric opened this issue Jan 15, 2025 · 4 comments · Fixed by #8315
Open
2 tasks

Keychain errors not handled when removing users #8280

neurodiverseEsoteric opened this issue Jan 15, 2025 · 4 comments · Fixed by #8315
Assignees
Labels
bug broken functionality, usability problems, unexpected errors desktop Desktop client related issues

Comments

@neurodiverseEsoteric
Copy link

neurodiverseEsoteric commented Jan 15, 2025

  • [X ] This is not a feature request (existing functionality does not work, not missing functionality).
    I will request features on forum or via support.
  • [X ] I've searched and did not find a similar issue.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
- OS: [e.g. iOS]
- Desktop Environment, if applicable (on Linux)
- Version [e.g. 22]

Additional context
Add any other context about the problem here.

  • 𝙄 𝙙𝙤𝙣'𝙩 𝙝𝙖𝙫𝙚 𝙩𝙞𝙢𝙚 𝙛𝙤𝙧 𝙩𝙝𝙞𝙨. 𝙃𝙚𝙧𝙚'𝙨 𝙩𝙝𝙚 𝙡𝙤𝙜 𝙩𝙝𝙚 𝙖𝙥𝙥 𝙞𝙩𝙨𝙚𝙡𝙛 𝙜𝙚𝙣𝙚𝙧𝙖𝙩𝙚𝙙 𝙖𝙣𝙙 𝙤𝙛𝙛𝙚𝙧𝙚𝙙 𝙛𝙤𝙧 𝙢𝙚 𝙩𝙤 𝙘𝙤𝙥𝙮-𝙥𝙖𝙨𝙩𝙚:
Feedback v259.250113.0 - DeviceStorageUnavailableError - UNKNOWN - linux



 Client: linux
 Type: UNKNOWN
 Tutanota version: 259.250113.0
 Timestamp (UTC): Wed, 15 Jan 2025 20:41:56 GMT
 User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) tutanota-desktop/259.250113.0 Chrome/130.0.6723.170 Electron/33.3.1 Safari/537.36
DeviceStorageUnavailableError
 Error message: failed to resolve/generate key> Error: Error while decrypting the ciphertext provided to safeStorage.decryptString.
    at oN.getPassword (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:189098)
    at async Qb.fetchKey (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:206972)
    at async Qb.fetchOrGenerateKey (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:206744)
    at async Qt.getEncryptedVar (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:1:23882)
    at async uD.getSseInfo (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:14276)
    at async uD.removeUser (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:14646)
    at async dD.removeUserIdInternal (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:13790)
    at async dD.removeUser (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:13687)
    at async Yb.removeUser (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:223979)
    at async ipc (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:227383)
Stacktrace: 
DeviceStorageUnavailableError: failed to resolve/generate key> Error: Error while decrypting the ciphertext provided to safeStorage.decryptString.
    at oN.getPassword (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:189098)
    at async Qb.fetchKey (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:206972)
    at async Qb.fetchOrGenerateKey (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:206744)
    at async Qt.getEncryptedVar (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:1:23882)
    at async uD.getSseInfo (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:14276)
    at async uD.removeUser (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:14646)
    at async dD.removeUserIdInternal (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:13790)
    at async dD.removeUser (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:13687)
    at async Yb.removeUser (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:223979)
    at async ipc (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:227383)
    at Qb.fetchOrGenerateKey (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:206903)
    at async Qt.getEncryptedVar (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:1:23882)
    at async uD.getSseInfo (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:14276)
    at async uD.removeUser (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:14646)
    at async dD.removeUserIdInternal (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:13790)
    at async dD.removeUser (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:25:13687)
    at async Yb.removeUser (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:223979)
    at async ipc (file:///opt/tutanota-desktop/resources/app.asar/desktop/DesktopMain.js:11:227383)

Test notes

  • Reproduce the issue
    • Log in with the desktop client (possibly with more than one user to prevent autologin)
    • Stop desktop client
    • optional: back up app config directory
    • Change the key (it will be in the app config directory, safe_storage/tutanota-vault-tuta)
    • Start again, try to delete the credentials
    • See that there's no error
    • You might need to delete the whole app config directory or restore to the previous state
  • Smoke testing adding/deleting credentials, mail and calendar notifications on desktop
@neurodiverseEsoteric neurodiverseEsoteric added bug broken functionality, usability problems, unexpected errors desktop Desktop client related issues labels Jan 15, 2025
@neurodiverseEsoteric
Copy link
Author

neurodiverseEsoteric commented Jan 15, 2025

Okay, the app seems to have fixed itself after removing the acct, killing the app, deleting the tutanota-desktop directory in ~/.config, and then starting the app again.
I was expecting the error to persist after the fact, though. Not a great state for this app to have conditioned me in...

@charlag
Copy link
Contributor

charlag commented Jan 16, 2025

Hi, I'm really sorry about the issue and thank you for the info. It seems like your data and your keychain were out of sync. Normally we do handle this error during login but based on the stacktrace it's not handled when removing a user. We will look into this case.

Reproduction steps probably look like the following:

  • log in the desktop client and close it
  • change or remove the key from the system keychain
  • close the session from another device
  • try to log in

it should delete the local user cleanly and fall back to login form

@charlag charlag changed the title Does Something Have To Break After EVERY UPDATE? Keychain errors not handled when removing users Jan 16, 2025
@neurodiverseEsoteric
Copy link
Author

Hey

Sorry for lashing out yesterday

Under a lot of stress

@hrb-hub
Copy link
Contributor

hrb-hub commented Jan 17, 2025

Hey

Sorry for lashing out yesterday

Under a lot of stress

No worries, it happens. Thanks for the report still, and good luck with what you're going through :)

@charlag charlag self-assigned this Jan 20, 2025
charlag added a commit that referenced this issue Jan 20, 2025
This commit adds minimal handling for the case when the device key is
corrupted in some way, and we try to remove the local SSE data.

This does not address the issue that the local data will still be
unusable, this needs to be addressed in a more general way separately.

Close #8280
charlag added a commit that referenced this issue Jan 20, 2025
This commit adds minimal handling for the case when the device key is
corrupted in some way, and we try to remove the local SSE data.

This does not address the issue that the local data will still be
unusable, this needs to be addressed in a more general way separately.

Close #8280
@charlag charlag linked a pull request Jan 20, 2025 that will close this issue
charlag added a commit that referenced this issue Jan 20, 2025
This commit adds minimal handling for the case when the device key is
corrupted in some way, and we try to remove the local SSE data.

This does not address the issue that the local data will still be
unusable, this needs to be addressed in a more general way separately.

Close #8280
BijinDev pushed a commit that referenced this issue Jan 21, 2025
This commit adds minimal handling for the case when the device key is
corrupted in some way, and we try to remove the local SSE data.

This does not address the issue that the local data will still be
unusable, this needs to be addressed in a more general way separately.

Close #8280
BijinDev pushed a commit that referenced this issue Jan 21, 2025
This commit adds minimal handling for the case when the device key is
corrupted in some way, and we try to remove the local SSE data.

This does not address the issue that the local data will still be
unusable, this needs to be addressed in a more general way separately.

Close #8280
BijinDev pushed a commit that referenced this issue Jan 21, 2025
This commit adds minimal handling for the case when the device key is
corrupted in some way, and we try to remove the local SSE data.

This does not address the issue that the local data will still be
unusable, this needs to be addressed in a more general way separately.

Close #8280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug broken functionality, usability problems, unexpected errors desktop Desktop client related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants