Zwavejs2mqtt: [question] Unable to update zwave-js config on Docker

Created on 1 May 2021  Â·  10Comments  Â·  Source: zwave-js/zwavejs2mqtt

I see there is a new config version of zwave-js but i'm not able to update it, this is the error message :

17:15:18.466 DRIVER Config update failed: Package manager exited with code 1 Error updating root package.json: This directory tree does not contain a direc tory with package.json and a lockfile!

question

All 10 comments

I have the same issue on HA Supervised.

Same story. Perhaps this is because current directory is .../bin.

Same Error on my Installation. Docker with using a local folder on a RPI4

If using volumes I saw this note was added to the readme file:

If you want to support devices config updates you also need to setup a volume on /usr/src/app/node_modules/@zwave-js/config:

docker run --rm -it -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 --mount source=zwave-config,target=/usr/src/app/node_modules/@zwave-js/config zwavejs/zwavejs2mqtt:latest

I'm not using volumes and use a local folder to store data, and the config updated fine with no errors for me:

2021-05-02 15:22:07.856 INFO ZWAVE: Calling api installConfigUpdate with args: [ [length]: 0 ]
2021-05-02 15:22:08.471 INFO ZWAVE: Success zwave api call installConfigUpdate { success: true, message: 'Success zwave api call', result: false }

Update - Maybe it isn't working for me. While I'm not getting any errors, the config update keeps showing "available" even after a restart. I'm only getting the two log entries I posted above when I click it.

The only volume defined by K8S@home chart is /usr/src/app/store, which makes total sense.
Making .../node_modules user-controlled sounds unwise.
Since the chart uses the "legitimate" container image, the issue is perhaps either in the Dockerfile (not the relevant config is pulled), or in the build process (obsolete layer persists), or in the whole bundle behaviour, attempting to alter supposedly read-only files.

I run z2m in Docker, and was having the same experience as @mwav3: I received the same success messages when running the update (no errors), but the config update bubble did not go away.

I was able to manually update the config by connecting to a shell inside the Docker container (in my case, docker-compose exec zwave2mqtt /bin/sh). Once I was inside the container, I ran npm update @zwave-js/config which updated a bunch of packages.

After that update finished, I re-ran the config update from within the z2m web UI. The log output was the same, but the 2nd log message took a long time to come through (≈40s), and the update bubble went away. See timestamps:

2021-05-02 22:53:42.994 INFO ZWAVE: Calling api installConfigUpdate with args: [ [length]: 0 ]
2021-05-02 22:54:22.354 INFO ZWAVE: Success zwave api call installConfigUpdate { success: true, message: 'Success zwave api call', result: true }

The update bubble is still gone after a z2m reboot and a config update check.

This is certainly not a fix, but it is a workaround in case someone needs an updated config (or just wants the bubble to go away).

Thanks this command worked. I did get some warnings when running npm update @zwave-js/config

/usr/src/app # npm update @zwave-js/config
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.

added 676 packages, changed 2 packages, and audited 2266 packages in 43s

186 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
npm notice New minor version of npm available! 7.6.0 -> 7.11.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.11.2
npm notice Run npm install -g [email protected] to update!
npm notice 
/usr/src/app # 

Also took a few minutes to update but it worked and the bubble is gone

2021-05-02 19:42:54.989 INFO ZWAVE: Calling api installConfigUpdate with args: [ [length]: 0 ]
2021-05-02 19:46:00.574 INFO ZWAVE: Success zwave api call installConfigUpdate { success: true, message: 'Success zwave api call', result: true }

I was about to post this as a bug and found this issue.

I can confirm that the above command does indeed cause the update notification to go away.

But I'm not sure what was supposed to be updated.

the notification said that "zwave-js 7.3.1-some_date_value" was available. After running the above command, then restarting the container, then clicking the update from within the notification box and waiting for the notification to clear I still have zwave-js version 7.3.0.

Is that expected or should have the zwave-js version been updated?

This is the first time I've ever noticed that notification icon in the top corner or at least the first time I've actually seen an active notification.

@finity69x2 this is updating the z-wave js _config_ package, which is published separately. Being published separately means (ostensibly) people can pull down updates to device configuration without having to update the entire z-wave js core package. Edit: to clarify, the config package is versioned separately from z-wave js itself, so the version of z-wave js will not change when you update the config package.

7.3.1-20210502 was current until about 25 minutes ago, when 7.3.1-20210503 was published. Interestingly enough, I did not have a problem updating to that version using the standard z2m UI.

The problem is that the config update tries to bump the config version by looking for package-lock.json but ATM I'm deleting it in Dockerfile here. @airdrummingfool the second time you tried to run the update it worked because after you manually installed it the package-lock.json has been recreated

Was this page helpful?
0 / 5 - 0 ratings