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

Zigbee2Mqtt update fails #1315

Closed
1 of 2 tasks
derolli1976 opened this issue Jan 7, 2025 · 13 comments
Closed
1 of 2 tasks

Zigbee2Mqtt update fails #1315

derolli1976 opened this issue Jan 7, 2025 · 13 comments
Labels
not a script issue This is not a script issue

Comments

@derolli1976
Copy link

βœ… 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?

update

πŸ“ Provide a clear and concise description of the issue.

The container installed is a couple of months old version 1.42.
When trying to execute the update command to update to version 2.0.0 the script fails with the message attached.
2025-01-07 17 43 12

βš™οΈ What settings are you using?

  • Default Settings
  • Advanced Settings

πŸ–₯️ Which Linux distribution are you using?

Debian 12

πŸ”„ Steps to reproduce the issue.

  1. Have a running LXC container
  2. Execute "update" in the shell

❌ Paste the full error output (if available).

2025-01-07 17 43 12

πŸ–ΌοΈ Additional context (optional).

No response

@MickLesk
Copy link
Member

MickLesk commented Jan 7, 2025

Have you read the PR & Discussion?

@MickLesk MickLesk added the not a script issue This is not a script issue label Jan 7, 2025
@derolli1976
Copy link
Author

Sorry, but I cannot find anything related. Would you mind, sharing the PR in question please?

@derolli1976
Copy link
Author

Thanks, but I don't see a relation to the issue above. The PR and discussion seems to be about some name resolver issue in alpine, but I am trying to update the Z2M container under debian.
The new Z2M version is downloaded correctly (the file is present in /opt/ but the installation seems to fail.

Maybe I just don't see the connection here, but if this isn't a script issue. Do you happen to know the cause and a possible solution?

@michelroegl-brunner
Copy link
Member

My bad, typo on my side: #1221

@derolli1976
Copy link
Author

Ah thanks! I totally did not see this whole thread. Sorry for the hassle.

@Tuxdiver
Copy link

Tuxdiver commented Jan 8, 2025

Let me add something here: I had the same problem and I think, there is something missing in the update script:

cd /opt
wget -q "https://github.com/Koenkk/zigbee2mqtt/archive/refs/tags/${RELEASE}.zip"
unzip -q ${RELEASE}.zip
mv zigbee2mqtt-${RELEASE} /opt/zigbee2mqtt
rm -rf /opt/zigbee2mqtt/data

The old /opt/zigbee2mqtt directory is never deleted or moved, so the zigbee2mqtt-${RELEASE} directory will be moved INSIDE the old directory and all following steps fail of course.

So there should be a mv /opt/zigbee2mqtt /opt/z2m_backup/ or something like that before the mv zigbee2mqtt-${RELEASE} /opt/zigbee2mqtt

@gorbunovav
Copy link

@MickLesk there is definitively a bug in the update script - it will not work for any further updates too.

@spec997
Copy link

spec997 commented Jan 11, 2025

Hi, I’m experiencing the exact same issue and can’t update from version 1.42.0 to 2.0.0 Is there any chance the update script could be fixed?

@gorbunovav
Copy link

@spec997 the update script doesn't handle the migration from pre-2.0 to 2.0, so it makes more sense to follow instructions from the related PR #1221 description

@MickLesk
Copy link
Member

You can Install a new LXC and migrate data from older lxc.

Nobody know the exactly state from every Z2M lxc.

@gorbunovav
Copy link

gorbunovav commented Jan 11, 2025

@MickLesk the issue is not with the state of Z2M lxc.

The new version of the script tries to do the following:

mv zigbee2mqtt-${RELEASE} /opt/zigbee2mqtt

But the directory /opt/zigbee2mqtt is already there (there is a check for its presence at the beginning of the script and then it is never removed during the update process).
So the line above will put the new release directory inside the /opt/zigbee2mqtt instead of replacing it.

If you already have 2.0.0 in /opt/zigbee2mqtt the script will not fail because you have pnpm-lock.yaml in /opt/zigbee2mqtt, but the actual update will not happen either.

@spec997
Copy link

spec997 commented Jan 11, 2025

Hello, thanks for the quick response. In my case, the best option was to follow steps 1 through 6 from #1221. Once I confirmed everything was working, I shut down the machine and then copied the configuration.yaml, database.db, and state.json files. After that, I created a new machine using the script from Proxmox VE Helper-Scripts Finally, I restored the files, restarted, and everything worked as it should. Thanks for your help!

@BSkando
Copy link

BSkando commented Jan 12, 2025

Hello, thanks for the quick response. In my case, the best option was to follow steps 1 through 6 from #1221. Once I confirmed everything was working, I shut down the machine and then copied the configuration.yaml, database.db, and state.json files. After that, I created a new machine using the script from Proxmox VE Helper-Scripts Finally, I restored the files, restarted, and everything worked as it should. Thanks for your help!

This is what worked for me. Could not get the migration to work properly otherwise. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a script issue This is not a script issue
Projects
None yet
Development

No branches or pull requests

7 participants