Z2M Impossible to update after switching to V2 - Error with package-lock.json #372

Closed
opened 2025-11-20 04:47:35 -05:00 by saavagebueno · 7 comments
Owner

Originally created by @AURELB87 on GitHub (Jan 18, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

Zigbee2MQTT

📂 What was the exact command used to execute the script?

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/develop/ct/zigbee2mqtt.sh)"

📝 Provide a clear and concise description of the issue.

Hello,

I upgraded to v2 of Zigbee2MQTT by following the procedure: Everything is working fine.
Koenkk made an important modification on the dev branch so I tried to update the script before to see how to use the dev branch.

By doing an update command, I have the 1st error output.
After backup, I deleted these 2 folders and I tried to execute again the update command. I had the 2nd error output:

So I have two questions:

  1. How to solve this issue ?
  2. How to use the dev branch ?

Thank you.

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

🔄 Steps to reproduce the issue.

Paste the full error output (if available).

1st Error:

ERROR: Backup directory exists. May be previous restoring was failed?

  1. Save 'data-backup' and 'data' dirs to safe location to make possibility to restore config later.
  2. Manually delete 'data-backup' dir and try again

2nd Error:

Generating a backup of the configuration...
Checking if any changes were made to package-lock.json...
error: pathspec 'package-lock.json' did not match any file(s) known to git
Failed to check package-lock.json.

🖼️ Additional context (optional).

Originally created by @AURELB87 on GitHub (Jan 18, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? Zigbee2MQTT ### 📂 What was the exact command used to execute the script? bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/develop/ct/zigbee2mqtt.sh)" ### 📝 Provide a clear and concise description of the issue. Hello, I upgraded to v2 of Zigbee2MQTT by following the procedure: Everything is working fine. Koenkk made an important modification on the dev branch so I tried to update the script before to see how to use the dev branch. By doing an update command, I have the 1st error output. After backup, I deleted these 2 folders and I tried to execute again the update command. I had the 2nd error output: So I have two questions: 1) How to solve this issue ? 2) How to use the dev branch ? Thank you. ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 🔄 Steps to reproduce the issue. - ### ❌ Paste the full error output (if available). 1st Error: > ERROR: Backup directory exists. May be previous restoring was failed? > 1. Save 'data-backup' and 'data' dirs to safe location to make possibility to restore config later. > 2. Manually delete 'data-backup' dir and try again 2nd Error: > Generating a backup of the configuration... > Checking if any changes were made to package-lock.json... > error: pathspec 'package-lock.json' did not match any file(s) known to git > Failed to check package-lock.json. ### 🖼️ Additional context (optional). -
Author
Owner

@DomJeal commented on GitHub (Jan 18, 2025):

I had a few errors trying to update to Z2M also, I just recreated the container in the end.
Migration is simple you can just backup the /data folder & transfer it to the new container.

@DomJeal commented on GitHub (Jan 18, 2025): I had a few errors trying to update to Z2M also, I just recreated the container in the end. Migration is simple you can just backup the /data folder & transfer it to the new container.
Author
Owner

@AURELB87 commented on GitHub (Jan 18, 2025):

OK I think about that too. So I just to create a new LXC with the script and copy the data folder and that all? I will return automatically in V2?

@AURELB87 commented on GitHub (Jan 18, 2025): OK I think about that too. So I just to create a new LXC with the script and copy the data folder and that all? I will return automatically in V2?
Author
Owner

@DomJeal commented on GitHub (Jan 18, 2025):

Here's what I did:

  • Backed up the LXC with Proxmox (just in case)
  • Copied the /opt/zigbee2mqtt folder to my PC
  • Stopped & removed the existing Z2M LXC
  • Created a new Z2M LXC using the script
  • Confirmed it was running version 2 (settings > about)
  • Stopped the Z2M service in the container (systemd stop zigbee2mqtt)
  • Copied the /data folder from my PC to /opt/zigbee2mqtt
  • Started the Z2M service (systemd stop zigbee2mqtt)
@DomJeal commented on GitHub (Jan 18, 2025): Here's what I did: - Backed up the LXC with Proxmox (just in case) - Copied the /opt/zigbee2mqtt folder to my PC - Stopped & removed the existing Z2M LXC - Created a new Z2M LXC using the script - Confirmed it was running version 2 (settings > about) - Stopped the Z2M service in the container (systemd stop zigbee2mqtt) - Copied the /data folder from my PC to /opt/zigbee2mqtt - Started the Z2M service (systemd stop zigbee2mqtt)
Author
Owner

@AURELB87 commented on GitHub (Jan 18, 2025):

OK thanks! Any idea to how to use the dev branch ? How do you copy easily without samba?

@AURELB87 commented on GitHub (Jan 18, 2025): OK thanks! Any idea to how to use the dev branch ? How do you copy easily without samba?
Author
Owner

@DomJeal commented on GitHub (Jan 18, 2025):

You would have to modify the script to pull a different branch as it pulls latest.

https://github.com/community-scripts/ProxmoxVE/blob/main/install/zigbee2mqtt-install.sh

EDIT: Looks like Z2M have instructions on how to switch to the dev branch

https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html

Side note: I feel like doing either would break updateability with the community script, I wouldn't recommend it.

@DomJeal commented on GitHub (Jan 18, 2025): You would have to modify the script to pull a different branch as it pulls latest. https://github.com/community-scripts/ProxmoxVE/blob/main/install/zigbee2mqtt-install.sh EDIT: Looks like Z2M have instructions on how to switch to the dev branch https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html Side note: I feel like doing either would break updateability with the community script, I wouldn't recommend it.
Author
Owner

@AURELB87 commented on GitHub (Jan 18, 2025):

@Jealy91 OK thanks a lot. I will recreate my container and won't do anything else, just waiting the next release ... ;)

@AURELB87 commented on GitHub (Jan 18, 2025): @Jealy91 OK thanks a lot. I will recreate my container and won't do anything else, just waiting the next release ... ;)
Author
Owner

@MickLesk commented on GitHub (Jan 18, 2025):

Next time Look at Changelog. there is an marked Breaking Change & there are some instructions

@MickLesk commented on GitHub (Jan 18, 2025): Next time Look at Changelog. there is an marked Breaking Change & there are some instructions
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#372