home-assistant-matter-hub: [Bug] 3.0.0-alpha.69 failed to start
Version
3.0.0-alpha.69
Matter Controller
Alexa
Steps to reproduce
I’ve update to .3.0.0-alpha.69 from 3.0.0-alpha.68. After a reboot the add-on could not start anymore. Here the log: `s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [2m2025-02-14 14:40:28.157 FATAL [0;1;90mLogger [31mUnhandled error detected: [0;31mbridgeIds.map is not a function [2;39mat [0m_BridgeStorage.initialize[2m (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:938:17) at [0masync Environment.load[2m (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/environment/Environment.js:89:5) at [0masync _BridgeService.initialize[2m (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:3570:26) at [0masync Environment.load[2m (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/environment/Environment.js:89:5) at [0masync _WebApi.initialize[2m (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:3850:27)[0m file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:938 bridgeIds.map( ^
TypeError: bridgeIds.map is not a function at _BridgeStorage.initialize (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:938:17) at async Environment.load (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/environment/Environment.js:89:5) at async _BridgeService.initialize (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:3570:26) at async Environment.load (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/environment/Environment.js:89:5) at async _WebApi.initialize (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:3850:27)
Node.js v18.20.4 s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service base-addon-log-level: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service base-addon-log-level successfully stopped s6-rc: info: service base-addon-banner: stopping s6-rc: info: service base-addon-banner successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting
[34m-----------------------------------------------------------[0m [34m Add-on: Home-Assistant-Matter-Hub[0m [34m Publish your entities from Home Assistant to any Matter-compatible controller like Alexa, Apple Home or Google Home.[0m [34m-----------------------------------------------------------[0m [34m Add-on version: 3.0.0-alpha.69[0m [32m You are running the latest version of this add-on.[0m [34m System: Home Assistant OS 14.2 (amd64 / qemux86-64)[0m [34m Home Assistant Core: 2025.2.3[0m [34m Home Assistant Supervisor: 2025.02.1[0m [34m-----------------------------------------------------------[0m [34m Please, share the above information when looking for help[0m [34m or support in, e.g., GitHub, forums or the Discord chat.[0m [34m-----------------------------------------------------------[0m s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [2m2025-02-14 14:40:34.398 FATAL [0;1;90mLogger [31mUnhandled error detected: [0;31mbridgeIds.map is not a function [2;39mat [0m_BridgeStorage.initialize[2m (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:938:17) at [0masync Environment.load[2m (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/environment/Environment.js:89:5) at [0masync _BridgeService.initialize[2m (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:3570:26) at [0masync Environment.load[2m (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/environment/Environment.js:89:5) at [0masync _WebApi.initialize[2m (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:3850:27)[0m file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:938 bridgeIds.map( ^
TypeError: bridgeIds.map is not a function at _BridgeStorage.initialize (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:938:17) at async Environment.load (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/environment/Environment.js:89:5) at async _BridgeService.initialize (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:3570:26) at async Environment.load (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/environment/Environment.js:89:5) at async _WebApi.initialize (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:3850:27)
Node.js v18.20.4 s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service base-addon-log-level: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service base-addon-log-level successfully stopped s6-rc: info: service base-addon-banner: stopping s6-rc: info: service base-addon-banner successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped`
Now i’m back on the 68 Release and it works again.
Best regards Tobi
State and attributes
No response
Relevant log output
Documentation & Issues
- I have reviewed the documentation and the linked troubleshooting guide.
- I have searched the issues for a similar problem.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 19 (4 by maintainers)
Commits related to this issue
- fix(storage): fixed storage migration of the last release fixes #523 — committed to t0bst4r/home-assistant-matter-hub by t0bst4r 2 years ago
- fix(storage): fixed storage migration of the last release fixes #523 — committed to sparkym3/home-assistant-matter-hub by t0bst4r 2 years ago
Thank you all for the information. That was very helpful finding the race condition in the migration logic. A new release is on its way. (~5min)
It seems the migration has some issues with stringified json.
The main bridge config file under
/data/app.jsonon alpha-68 looks like this: ( For HA OS it’s/root/addon_configs/491eb00d_hamh/data/; id properly varies)On the first start after updating the migration creates a new sub-directory
appand splits it up into abridges.idsfile containing an array of all bridge ids and an additional file for each bridge e.g.bridges.836d976441f3411d9ffff06adc033aba:/data/app/bridges.ids:/data/app/bridges.836d976441f3411d9ffff06adc03:Migration log alpha68 -> alpha69
This all works fine. But after a restart it seems to run the migration again and stringifies the data:
/data/app/bridges.ids:/data/app/bridges.836d976441f3411d9ffff06adc03:Migration log after 1st restart on alpha69
After some quick testing I found out that at least on the docker image the migration seems to be very inconsistent and does not delete
/data/app.jsonand/data/BRIDGEID.jsoneverytime after migrating. This causes the migration to trigger again on restart but I haven’t had time to figure out why it saves the data as stringified json on the second migration.How to fix:
a) Wait for a fix b) Downgrade to alpha68
c) If you are impatient you can manually fix it by deleting the old storage files and converting the new config files back to plain json. Do this at your own risk. To convert the stringified json back to plain json you can use any online tool (like https://onlinestringtools.com/json-parse-string) or just use the command line. Here is how I did it on HomeAssistant os:
/root/addon_configs/491eb00d_hamh/data/(the addon id may vary?):appexists and that it contains the two mentioned files./root/addon_configs/491eb00d_hamh/data/delete the old fileapp.jsonand the bridge configBRIDGEID.json(or move them somewhere else)./root/addon_configs/491eb00d_hamh/data/appdirectory run the following two commands (replace with your id):If anyone is having this issue, you can load up a recent backup and restore ONLY the home assistant matter hub Add-on. It’s very fast and works great, I had no issue restoring to alpha 68