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

{"message":"Invalid handler specified"} #2

Closed
kalaws opened this issue Dec 21, 2023 · 13 comments
Closed

{"message":"Invalid handler specified"} #2

kalaws opened this issue Dec 21, 2023 · 13 comments

Comments

@kalaws
Copy link

kalaws commented Dec 21, 2023

Appreciate the work. I can’t load config flow however. Getting the above error message.

Cheers

@kalaws
Copy link
Author

kalaws commented Dec 21, 2023

I see you just recently changed some directory name. According to below post, the error might be related to that.

https://community.home-assistant.io/t/error-adding-integration/485237/16

@kalaws
Copy link
Author

kalaws commented Dec 21, 2023

More specific log entry:

Error occurred loading flow for integration sungrow: cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)

@alangibson
Copy link
Owner

I see you just recently changed some directory name.

Domain and directory name are both "sungrow" so it shouldn't be that.

Error occurred loading flow for integration sungrow: cannot import name 'Defaults' from 'pymodbus.constants'

That would indicate that it's a version problem with pymodbus. Do you have the addon from https://github.com/bohdan-s/hassio-repository installed still?

@kalaws
Copy link
Author

kalaws commented Dec 22, 2023

No, don't have it installed. Very strange if it works for others.

@kalaws
Copy link
Author

kalaws commented Dec 23, 2023

I installed a fork of bohdan’s Hassio addon, which tried to solve the issue by allowing to “break system” related to some python stuff. Perhaps that might have something to do with it? Any idea how I might unbreak what it broke, or is it straight to restoring from backup?

@kalaws
Copy link
Author

kalaws commented Dec 23, 2023

# Install Python packages on system level --> PEP668
ENV PIP_BREAK_SYSTEM_PACKAGES=1

https://github.com/anthony-spruyt/hassio-repository/blob/5f97d9257b376ff7c1e908ef3a408f35736dcac8/SunGather/Dockerfile

@alangibson
Copy link
Owner

Are you running the Home Assistant OS, or did you install Home Assistant yourself on some existing OS? If it's the latter, run cat /usr/local/lib/python3.11/site-packages/pymodbus/version.py to see if you have 2.5.3 installed. Just look for this line: version = Version('pymodbus', 2, 5, 3). You may be able to fix it manually with pip uninstall pymodbus by just deleting the pymodbus module at /usr/local/lib/python3.11/site-packages/pymodbus.

If you're running Home Assistant OS, I've never accessed the core filesystem. They have a pretty complicated storage setup. I'd have to look into that.

@kalaws
Copy link
Author

kalaws commented Dec 23, 2023

Thanks. Unfortunately it’s the former!

@kalaws
Copy link
Author

kalaws commented Dec 23, 2023

I have no pymodbusfolder in the site-packages folder. But perhaps that other addon fork installed it at some other location, not tied to usr?

Also:
pip uninstall pymodbus returns WARNING: Skipping pymodbus as it is not installed

@kalaws
Copy link
Author

kalaws commented Dec 23, 2023

If I try to pip install pymodbus that works, but the same error persists. All my py stuff is in /usr/lib/python3.11/... rather than /usr/local/lib/python3.11/.... Perhaps that's a HA OS thing? Could the search path be altered?

@kalaws
Copy link
Author

kalaws commented Dec 25, 2023

Is there any easy way to turn the integration into something that might be run in AppDaemon instead? In AD I can load all the needed requirements.

@alangibson
Copy link
Owner

I'm not able to reproduce this at all, and I'm out of ideas as to how to fix it. Try posting a question on https://community.home-assistant.io/ and see if anyone there has any ideas. Maybe they'll at least know how to pull some useful debugging info for this problem.

@alangibson
Copy link
Owner

If you're still having trouble, maybe give @AlexanderLanin 's fork a try. That will probably become the official version anyway.

https://github.com/AlexanderLanin/homeassistant-sungrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants