Skip to content

.cryptkey Error During Non-SSO Account Switching after SSO Login or vice-versa #1746

Closed
@avinash-0007

Description

@avinash-0007

Description:

We have identified an issue involving the .cryptkey file that causes errors when switching accounts after using both SSO and Non-SSO login methods.

Steps to Reproduce:

  1. Register a new account .

  2. Log in with SSO and add an additional account via SSO. A .cryptkey file is created in storage/domain/user/.cryptkey.

  3. Attempt to switch between the accounts — it works as expected.

  4. Log out and log back in without using SSO.

  5. Attempt to switch accounts again — an error occurs, and the following error is logged:

[2024-09-11 14:19:32.658][b4f90fd4] JSON[INFO]: {"Action":"AccountSwitch","Result":false,"ErrorCode":803,"ErrorMessage":"AccountSwitchFailed[803]","ErrorMessageAdditional":"CryptKeyError[111]","ExceptionCode":0,"epoch":1726064372}
[2024-09-11 14:19:32.694][b4f90fd4] [INFO]: Memory peak usage: 8MB
[2024-09-11 14:19:32.724][b4f90fd4] [INFO]: Time delta: 0.55190300941467
[2024-09-11 14:19:59.935][3e510555] [INFO]: [SM:2.37.2][IP:2401:4900:1c63:4335:c50:b8c2:84fe:e8f3][PID:1192][nginx/1.24.0][fpm-fcgi][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3][POST https://xxxxx.com/apps/snappymail/?/Json/&q[]=/0/]
[2024-09-11 14:19:59.975][3e510555] Nextcloud[DEBUG]: integrated
[2024-09-11 14:20:00.034][3e510555] JSON[INFO]: Action: DoAppDelayStart
[2024-09-11 14:20:00.069][3e510555] POST[INFO]: {"Action":"AppDelayStart"}
[2024-09-11 14:20:00.100][3e510555] COOKIE[DEBUG]: set smtoken
[2024-09-11 14:20:00.130][3e510555] JSON[INFO]: {"Action":"AppDelayStart","Result":true,"epoch":1726064400}
[2024-09-11 14:20:00.170][3e510555] [INFO]: Memory peak usage: 6MB
[2024-09-11 14:20:00.204][3e510555] [INFO]: Time delta: 0.43127679824829

   

### **Temporary Workaround:**
- Delete the `.cryptkey` file from `storage/domain/user/.cryptkey`.
- After deleting the `.cryptkey`, delete and re-add the account using Non-SSO login.
- Account switching then works correctly without error.

### **Issue Context:**
This issue seems to be related to the `.cryptkey` file behavior when transitioning between SSO and Non-SSO logins. 



![Screenshot 2024-09-13 at 6 43 34 PM](https://github.com/user-attachments/assets/3229e5f6-dd48-428b-b22e-e162827453a5)



Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions