stas-demydiuk / domoticz-zigbee2mqtt-plugin

zigbee2mqtt plugin for domoticz
MIT License
136 stars 98 forks source link

[3.1-beta] (Zigbee2MQTT) failed to load 'plugin.py' #702

Closed pemca closed 2 years ago

pemca commented 3 years ago

Issue description Domoticz fails to load plugin

Additional information Zigbee2MQTT version: version 1.21.1 (commit #4a51e0c0) Python version: 2.7 and 3.7 Domoticz version: 2021.1 - newest stable release (april 2021) Plugin version: 3.10 beta

Logs Attach any additional logs here which might be useful: mqtt, domoticz, plugin logs 2021-09-07 21:31:42.415 Error: zigbee2: (Zigbee2MQTT) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/zigbee2mqtt/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'. 2021-09-07 21:31:42.415 Error: zigbee2: (zigbee2) Module Import failed, exception: 'ModuleNotFoundError' 2021-09-07 21:31:42.415 Error: zigbee2: (zigbee2) Module Import failed: ' Name: DomoticzEx' 2021-09-07 21:31:42.415 Error: zigbee2: (zigbee2) Error Line details not available.

secator76 commented 3 years ago

see: #695 for the solution. so we can't update the plugin if we don't use domoticz beta version??????

dobber81 commented 3 years ago

Correct.

hughb8on commented 3 years ago

Given the long gaps between stable domoticz releases, and many users' reluctance to install beta code on their production systems, I think it would be a good idea to keep a branch of the plugin available which doesn't require the DomoticzEx framework.

stas-demydiuk commented 3 years ago

@hughb8on you could continue using stable v.3.0 of the plugin, the new beta version is for individuals who want to overcome 255 devices limit which is possible only with the new DomoticzEx framework

hughb8on commented 3 years ago

Hi, yes, that's what I'll be doing. I see two problems though.

Firstly, there will be users who have done a 'git pull' without checking the Prerequisites notes. They may not have a backup or they may not know how to 'git reset' to an earlier commit point. Arguably that's "their problem" but it would be kind if there was a stable branch available to simplify things.

Secondly, and more importantly from my perspective, the next stable domoticz release may be a long way off - recently they've been a year apart but two-year gaps are not unusual. This means that any bug fixes, new devices and other improvements to the plugin will be missed by those who don't like the idea of running domoticz beta code.

sundodger commented 3 years ago

Hi, I am that person @hughb8on refers to. Just did an update and now all my zigbee devices are "offline". Update to Beta? in would but that is throwing an unable to communicate with server error. So how do i roll back the update?

eleutscher commented 3 years ago

Hi, I am that person @hughb8on refers to. Just did an update and now all my zigbee devices are "offline". So how do i roll back the update?

Same here. Never had a problem with the git pull till yesterday. If some could tell me how to get things working again that would be great. Thx

hughb8on commented 3 years ago

Make a backup (at a minimum the whole of the plugin folder) just in case. Then stop domoticz, cd into the plugin folder and do this: -

git log

That should show you a list of commit points and their dates, in descending order. Page down through it until you see a commit on Aug 23 at 22:18. You should see a a commit point "3725a295e12531e5c5f68d03d3e6f0c1f646b1ca". That's where you need to go back to.

To regress type this: -

sudo git reset --hard 3725a295e12531e5c5f68d03d3e6f0c1f646b1ca Edit: I see github edited my reply: you need to have the whole of the commit point from the git log results, all "3725a295e12531e5c5f68d03d3e6f0c1f646b1ca" except the quotes.

Restart domoticz. That should be all you have to do.

Bear in mind that although I'm pretty sure this will work, and I have tested it on my own system just now, I don't find myself having to do this often, so beware!

sundodger commented 3 years ago

Oh well, as i get a "fatal: your branch appears to be broken i seem to be in trouble until i can find a way to get the beta. Any other way to roll back? Edit, A restart of the Raspberry pi/Domoticz and the update showed up. Installed beta and up and running again. Thanks all.

eleutscher commented 3 years ago

@hughb8on Thx a lot! That did the trick. :-)

hughb8on commented 3 years ago

:-) it's good to have confirmation that works, thank you.

jupstra commented 3 years ago

@hughb8on this indeed did the trick! I didn't update for quite a while and unfortunately missed this issue in the various Prerequisites notes...

azsystem commented 3 years ago

This version should have number 4.x.x because it is not compatible with old version 3. Also a warning would be nice, as you did when introducing v3

stas-demydiuk commented 3 years ago

Yes, also think about that, but decided to go with 3.1 as there are no breaking changes comparing to the 3.0 version, I mean you could do the upgrade without the need to remove the previous version of the plugin as it was when you were updating 0.2.x to 3.0

Regarding the Domoticz version, plugin always expects that you are using the most recent version to the plugin release date. If it works with previous versions too that's awesome but that's not the goal as well as with zigbee2mqtt version

anixi commented 3 years ago

Make a backup (at a minimum the whole of the plugin folder) just in case. Then stop domoticz, cd into the plugin folder and do this: -

git log

That should show you a list of commit points and their dates, in descending order. Page down through it until you see a commit on Aug 23 at 22:18. You should see a a commit point "3725a295e12531e5c5f68d03d3e6f0c1f646b1ca". That's where you need to go back to.

To regress type this: -

sudo git reset --hard 3725a29 Edit: I see github edited my reply: you need to have the whole of the commit point from the git log results, all "3725a295e12531e5c5f68d03d3e6f0c1f646b1ca" except the quotes.

Restart domoticz. That should be all you have to do.

Bear in mind that although I'm pretty sure this will work, and I have tested it on my own system just now, I don't find myself having to do this often, so beware!

Hey @hughb8on I have the same problem here with the updated zigbee2mqtt plugin. However git log does not go back any further then September 4: commit c1f774d7ac454ffc6162522be6e06b7f8a75ee62 Date: Sat Sep 4 19:59:00 2021 +0300 Any solutions for this?

hughb8on commented 3 years ago

I am surprised you aren't seeing anything older than Sep 4 if you have followed the instruction to page down through the git log. If there's really nothing older then I guess you'll have to see if you have any more luck than I did persuading @stas-demydiuk to keep a stable branch available for those not wanting to switch to domoticz beta.

dobber81 commented 3 years ago

My git log shows releases from back in 2018. commit 5e8db58f808f87ba42ff143378cbc2f7ea70c312 Author: Stanislav Demydiuk stas-demydiuk@users.noreply.github.com Date: Sat Sep 15 15:46:03 2018 +0300

anixi commented 3 years ago

may be stupid question but in which terminal/directory do you do the git log command

hughb8on commented 3 years ago

.. as does mine.

dobber81 commented 3 years ago

/home/pi/domoticz/plugins/zigbee2mqtt/

hughb8on commented 3 years ago

@anixi If "git log" works and you see a commit on Sep 4 at 19:59 then you are in the right place. What do you see lower down in the log?

anixi commented 3 years ago

I see image

anixi commented 3 years ago

process seems still on going as I get the "terminal killing" warning when I want to close the window

hughb8on commented 3 years ago

ok, and if you press the down cursor do you not see earlier commits?

dobber81 commented 3 years ago

Or space to jump whole pages.

anixi commented 3 years ago

oeps, ..... yes I do see that, felling stupid as I used the scroll bar and nothing showed up! Think you saved my day, will continue the process!

hughb8on commented 3 years ago

No worries, most of the fun is in learning.

anixi commented 3 years ago

true, response is now "HEAD is now at 3725a29 Remove devices argument from Adapters" is that ok and can I start restarting Zigbee2MQtt and domoticz now?

hughb8on commented 3 years ago

Yes you can. "Remove devices argument from Adapters " is just what the author happened to name that particular commit point, not an error message or anything.

anixi commented 3 years ago

great, it works again, only my "friendly names" are back to codes have to work on that but that is another good learning exercise. Thanks a million!

klarf-pixel commented 2 years ago

Hi, I have the same error. The command (in the plugin folder) : sudo git reset --hard 3725a29 works, but in the next update we will have the same concerns?

hughb8on commented 2 years ago

That's right.

You cannot update the plugin again until you have updated Domoticz to a version which the plugin supports.

That means you must either switch to the Domoticz beta channel, or wait for a new Domoticz stable release.

pcousin1 commented 2 years ago

Installed z2m for the first time today, managed to follow this thread and get back to 23rd august. But I still have the same errors in the domoticz log after restarting. Any ideas please ?

jojo1985 commented 2 years ago

Make a backup (at a minimum the whole of the plugin folder) just in case. Then stop domoticz, cd into the plugin folder and do this: -

git log

That should show you a list of commit points and their dates, in descending order. Page down through it until you see a commit on Aug 23 at 22:18. You should see a a commit point "3725a295e12531e5c5f68d03d3e6f0c1f646b1ca". That's where you need to go back to.

To regress type this: -

sudo git reset --hard 3725a29 Edit: I see github edited my reply: you need to have the whole of the commit point from the git log results, all "3725a295e12531e5c5f68d03d3e6f0c1f646b1ca" except the quotes.

Restart domoticz. That should be all you have to do.

Bear in mind that although I'm pretty sure this will work, and I have tested it on my own system just now, I don't find myself having to do this often, so beware!

Works for me many thanks

fdammeke commented 2 years ago

I also bumped into this, new user, wanting to try the plugin together with the domoticz stable release, its a bit inconvenient, I'm not sure if people will find this bug report that easily and 'understand' what to do / what they're doing in git.

Maybe a wild idea, could you perhaps create github release tags following the domoticz releases? Or create a tag that is compatible with the domoticz stable release? I think v3.0 is a bit behind that 'breaking' commit id 3725a295?

Then add some small line to the docs regarding the domoticz release compatibility and the usage of git checkout tags/<tag> -b <branch>.

XSebastiaan commented 2 years ago

Noticed today that this is what's wrong in my Domoticz / Zigbee2MQTT setup.

What is the easiest way to update Domoticz to the beta version? (if possible with keeping my now connected devices)

Check for updates says there are no updates.

Version: 2021.1 Build Hash: 8547c5b7e Compile Date: 2021-04-17 17:29:11 dzVents Version: 3.1.7 Python Version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]

I have created a backup just to be sure.