Skip to content

Upgrading from 0.6.5 to 0.6.6 ends with (CryptoClient) uncaught exception #321

@stronk7

Description

@stronk7

Describe the bug
Trying to upgrade from sdk 0.6.5. to 0.6.6 consistently get the follow error on startup):

node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

[Error: Failed to deserialize or serialize a JSON value missing field `version` at line 1 column 6856] {
  code: 'GenericFailure'
}

To Reproduce
Steps to reproduce the behavior:

  1. With existing and working bot, already using encrypted rooms, just update to 0.6.6:
    1. npm update matrix-bot-sdk
    2. npm ior npm ci
  2. Run the bot and look to logs (LogLevel.DEBUG).
  3. Process ends with the error commented above.

Expected behavior
The bot starts working normally, like it was with 0.6.5.

Log snippet

...
...
Sun, 28 May 2023 08:41:52 GMT [DEBUG] [MatrixClientLite] End-to-end encryption client created
...
...
Sun, 28 May 2023 08:41:52 GMT [DEBUG] [MatrixHttpClient] (REQ-1) GET https://matrix.example.com/_matrix/client/v3/account/whoami
Sun, 28 May 2023 08:41:53 GMT [DEBUG] [MatrixHttpClient] (REQ-2) GET https://matrix.example.com/_matrix/client/v3/user/%40nextbotdev%3Aexample.com/account_data/m.direct
Sun, 28 May 2023 08:41:53 GMT [DEBUG] [MatrixHttpClient] (REQ-3) GET https://matrix.example.com/_matrix/client/v3/joined_rooms
Sun, 28 May 2023 08:41:53 GMT [DEBUG] [MatrixClientLite] Preparing end-to-end encryption
Sun, 28 May 2023 08:41:53 GMT [DEBUG] [MatrixHttpClient] (REQ-4) GET https://matrix.example.com/_matrix/client/v3/rooms/!iWhUNHQUZTUeqBZncL%3Aexample.com/state/m.room.encryption/
Sun, 28 May 2023 08:41:53 GMT [ERROR] [MatrixHttpClient] (REQ-4) { errcode: 'M_NOT_FOUND', error: 'Event not found.' }
Sun, 28 May 2023 08:41:53 GMT [DEBUG] [MatrixHttpClient] (REQ-5) GET https://matrix.example.com/_matrix/client/v3/rooms/!VlyOdAIoWKBBMwwrMU%3Aexample.com/state/m.room.encryption/
Sun, 28 May 2023 08:41:53 GMT [ERROR] [MatrixHttpClient] (REQ-5) { errcode: 'M_NOT_FOUND', error: 'Event not found.' }
Sun, 28 May 2023 08:41:53 GMT [DEBUG] [CryptoClient] Starting with device ID: NMQJEXECYB
node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

[Error: Failed to deserialize or serialize a JSON value missing field `version` at line 1 column 6856] {
  code: 'GenericFailure'
}

Additional context
The M_NOT_FOUND errors are pre-existing, happening always, as many times as encrypted rooms the bot is in (seems like). I imagine that those errors are unrelated with the new one, reported here, causing the bot to stop on startup.

Ciao :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions