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

Startup crash with 1.3.5+ #71

Closed
genehand opened this issue Jun 30, 2024 · 4 comments
Closed

Startup crash with 1.3.5+ #71

genehand opened this issue Jun 30, 2024 · 4 comments

Comments

@genehand
Copy link

Hey I'm getting startup crashes with the latest releases, going back to 1.3.4 resolves it:

Jun 30 08:16:32 chip matterbridge[6899]: [08:16:32.575] [Matterbridge] Matter server started
Jun 30 08:16:32 chip matterbridge[6899]: [08:16:32.576] [Matterbridge] The commissioning server on port 5541 for matterbridge-zigbee2mqtt is already commissioned. Waiting for controllers to connect ...
Jun 30 08:16:32 chip matterbridge[6899]: [08:16:32.576] [Matterbridge] Commissioned fabric information:
Jun 30 08:16:32 chip matterbridge[6899]: [08:16:32.576] [Matterbridge] - fabric index 1 id <snip> vendor 4631 (Alexa) Alexa-1
Jun 30 08:16:32 chip matterbridge[6899]: /usr/lib/node_modules/matterbridge/node_modules/node-persist/src/local-storage.js:449
Jun 30 08:16:32 chip matterbridge[6899]: 		return this.options.stringify(obj);
Jun 30 08:16:32 chip matterbridge[6899]: 		                    ^
Jun 30 08:16:32 chip matterbridge[6899]: TypeError: Do not know how to serialize a BigInt
Jun 30 08:16:32 chip matterbridge[6899]:     at Object.stringify (<anonymous>)
Jun 30 08:16:32 chip matterbridge[6899]:     at LocalStorage.stringify (/usr/lib/node_modules/matterbridge/node_modules/node-persist/src/local-storage.js:449:23)
Jun 30 08:16:32 chip matterbridge[6899]:     at LocalStorage.copy (/usr/lib/node_modules/matterbridge/node_modules/node-persist/src/local-storage.js:469:26)
Jun 30 08:16:32 chip matterbridge[6899]:     at LocalStorage.setItem (/usr/lib/node_modules/matterbridge/node_modules/node-persist/src/local-storage.js:179:20)
Jun 30 08:16:32 chip matterbridge[6899]:     at NodeStorage.set (file:///usr/lib/node_modules/matterbridge/node_modules/node-persist-manager/dist/nodeStorage.js:148:35)
Jun 30 08:16:32 chip matterbridge[6899]:     at Matterbridge.showCommissioningQRCode (file:///usr/lib/node_modules/matterbridge/dist/matterbridge.js:1969:37)
Jun 30 08:16:32 chip matterbridge[6899]:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Jun 30 08:16:32 chip matterbridge[6899]:     at async Timeout.<anonymous> (file:///usr/lib/node_modules/matterbridge/dist/matterbridge.js:1799:21)

After getting that it then can't restart at all:

Jun 30 08:17:23 chip matterbridge[7099]: CLI: Matterbridge.loadInstance() failed with error: Error: [node-persist][readFile] /home/mb/.matterbridge/storage/.matterbridge/c6724947ca70506d3d4794dd710813af1a1ef8e646852dba3fe0dea6a2aa7911 does not look like a valid storage file!

The file is 0 bytes, after deleting it and going back to 1.3.4 it contains:

{"key":"matterbridgeLatestVersion","value":"1.3.7"}

I'm running in childbridge mode with the latest matterbridge-zigbee2mqtt (2.1.4) and matterbridge-home-assistant (1.3.6) plugins. I don't see any obvious BigInt changes, let me know any other info you need.

@Apollon77
Copy link

Interesting ... but yes bigint is not handled by JSON.stringify by default ... @Luligu We have extra stiff in matter,js to stringify correctly including bigint

@Luligu
Copy link
Owner

Luligu commented Jul 1, 2024

Hi,
thanks for letting me know.
Fixed with

[1.3.8] - 2024-07-01

Fixed

  • [matterbridge]: Fixed crash in childbridge mode

@Apollon77 thanks me too of course but the problem is express. I will sanitize fabricInfo.

@Luligu Luligu closed this as completed Jul 1, 2024
@genehand
Copy link
Author

genehand commented Jul 1, 2024

All good here again with 1.3.8, thx!

@Luligu
Copy link
Owner

Luligu commented Jul 1, 2024

Great!
Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants