Open jandeschuttere opened 2 years ago
ads documentation ads source (message by IssueLinks)
Same issue on the raspberry pi 4 running Home Assistant OS. Had to revert back to 2022.6.7
I have to still look further into the problem - time.. you precious thing - as I'm afraid this plugin has less usage and therefor less priority.
From what I gather it looks like the internals use https://github.com/stlehmann/pyads and the issues could be related to the python 3.10 upgrade
so looks like /usr/local/lib/python3.10/site-packages/pyads/adslib.so
is indeed an x86-64 type, as identified via file
/usr/local/lib/python3.10/site-packages/pyads/adslib.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, with debug_info, not stripped
meaning this is incorrectly packaged with an arm container, can this be looked into?
For those looking for a (dirty) workaround the package from the working version is compatible it seems with the new release. Assuming you are using docker the following steps might help you out until this gets a fix:
Given: containerA is the name of your working container, containerB is the name of the new container with the faulty adslib.
docker cp containerA:/usr/local/lib/python3.9/site-packages/pyads /tmp
docker stop containerA
docker start containerB
docker cp /tmp/pyads containerB:/usr/local/lib/python3.10/site-packages/
docker restart containerB
If you are not using docker, the digest is basically.. take the pyads lib from the working version, copy it in the location that the new homeassistant build is using.
@frenck sorry to tag you personally but as you have ads integration tagged in recent PR https://github.com/home-assistant/core/pull/74522 I just wanted to check if above was solved through that PR? (the PR changes were simply too big for sieving through)
For those looking for a (dirty) workaround the package from the working version is compatible it seems with the new release. Assuming you are using docker the following steps might help you out until this gets a fix:
Given: containerA is the name of your working container, containerB is the name of the new container with the faulty adslib.
docker cp containerA:/usr/local/lib/python3.9/site-packages/pyads /tmp docker stop containerA docker start containerB docker cp /tmp/pyads containerB:/usr/local/lib/python3.10/site-packages/ docker restart containerB
If you are not using docker, the digest is basically.. take the pyads lib from the working version, copy it in the location that the new homeassistant build is using.
I tried to get the workaround working for me without docker, but it seems the directory is not there you described. There is no python3.9 folder. I am using core 2022.06.7 an got access with the Terminal & SSH Addon. May you give me a hint what I am doing wrong?
Thanks a lot.
I've not tried the core installation but according to the information it is using the python venv method. You could identify the locations python is using by doing python -m site
or python -m site --user-site
and go through the listed directories to find the pyads
site-package. Once you've found this you could copy it (you could use scp
or rsync
for this if using a terminal and the installation is remote) to your local system and identify the location of the pyads
site-package on the new installation and move them there.
I've not tried the core installation but according to the information it is using the python venv method. You could identify the locations python is using by doing
python -m site
orpython -m site --user-site
and go through the listed directories to find thepyads
site-package. Once you've found this you could copy it (you could usescp
orrsync
for this if using a terminal and the installation is remote) to your local system and identify the location of thepyads
site-package on the new installation and move them there.
Thanks for the hints, but this doesn't worked for me either.
I got the workaround now working with the Add-on: SSH & Web Terminal.
With this Add-on I could connect to HassOS via SSH and use the "docker" workaround described above.
Thanks a lot guys! hopefully this will be fixed soon!
I don't have much experience with Python, but I have a ton of experience with ADS communications and all things TwinCAT-related. Let me know if I can be of any assistance in fixing this issue.
Thanks for reaching out! From what I gather this is a build issue on this project instead of having an actual issue with the library or the communication itself. Mainly because the library provided is bundled but is simply targeting the wrong cpu architecture and switching to the right one causes no issues.
I have scavanged a bit through the various repositories of this project to see if I can identify the build process itself to see if I can spot an issue there (f.i. a cache layer of some sorts during the build process) but have not yet found it.
I am not able to find this location : /usr/local/lib/python3.9/site-packages/pyads Can some one help me, Im running HassIO I do have: /usr/local/lib but no python folder
https://github.com/home-assistant/core/issues/74067#issuecomment-1216265836 might be able to help you locate the packages that your installation is using
it will show the base directory/directories in which python is running, one of them should have a subdirectory pyads
I am not able to find this location : /usr/local/lib/python3.9/site-packages/pyads Can some one help me, Im running HassIO I do have: /usr/local/lib but no python folder
I got the same issue at first. I needed to use for the ssh connection the SSH & Web Terminal Addon with disabled protection mode. After that I could locate the directory
I am not able to find this location : /usr/local/lib/python3.9/site-packages/pyads Can some one help me, Im running HassIO I do have: /usr/local/lib but no python folder
I got the same issue at first. I needed to use for the ssh connection the SSH & Web Terminal Addon with disabled protection mode. After that I could locate the directory
Unfortunately i dont have version 12.0.2. but 9.6.1 and i don't have the protection mode option
I am not able to find this location : /usr/local/lib/python3.9/site-packages/pyads Can some one help me, Im running HassIO I do have: /usr/local/lib but no python folder
I got the same issue at first. I needed to use for the ssh connection the SSH & Web Terminal Addon with disabled protection mode. After that I could locate the directory
Unfortunately i dont have version 12.0.2. but 9.6.1 and i don't have the protection mode option
Its from the Community Addon Store. I couldnt use the "official" Addon and got the same issue as you with it.
i have the addon installed, what next? I still only see the /usr/local/lib and no more. Do i need to login to a higher level, docker?
What is the output of python -m site
and python -m site --user-site
when you are logged in through ssh?
maybe a faster way is the next few lines, each line is after an enter. After the first one you will enter the interactive shell of python and each line will be prefixed with >>>
so don't be alarmed
python
import pyads
print(pyads.__file__)
exit()
the print action will show you a location, in my current case this prints/usr/local/lib/python3.10/site-packages/pyads/__init__.py
.. this could be different in your case.
More importantly, this tells you where the package is situated, in this case that means /usr/local/lib/python3.10/site-packages/pyads
.. that is the directory you can use to move the working pyads into a home assistance version that has the corrupted pyads
i have the addon installed, what next? I still only see the /usr/local/lib and no more. Do i need to login to a higher level, docker?
Do you have disabled the protection mode? What core version are you running right now?
Yes protection is disabled. Home Assistant 2022.9.4 Supervisor 2022.08.6 Operating System 9.0 Frontend-versie: 20220907.2 - latest
Yes protection is disabled. Home Assistant 2022.9.4 Supervisor 2022.08.6 Operating System 9.0 Frontend-versie: 20220907.2 - latest
are you using the "docker" command to copy the file in the container (container name: homeassistant) like this?
docker cp /backup/pylib/pyads homeassistant:/usr/local/lib/python3.10/site-packages/
When i try: python -m site I get command not found
What is the output of
python -m site
andpython -m site --user-site
when you are logged in through ssh?I get : command not found I am logged in thru the addon: ssh & WebTerminal
@Jeroen45: have you tried to copy the files with the docker command within the homeassistant container I mentioned bevor?
I am almost there to log in with HassOS SSH port 22222 Configurator to get to the root level
@Jeroen45 I have the same issue, can't log with enough rights, so neither python commands nor python folder is available: anyhow I fixed my setup with the docker commands just like @C0D3-IT was suggesting as originally posted by @jandeschuttere (by the way, thank you very much!)
@Jeroen45 I have the same issue, can't log with enough rights, so neither python commands nor python folder is available: anyhow I fixed my setup with the docker commands just like @C0D3-IT was suggesting as originally posted by @jandeschuttere (by the way, thank you very much!)
I am not able to go outside the docker to the root, to do the docker commands just like @C0D3-IT and @jandeschuttere. Still looking into this
Please help, i am not a python programmer. I am not able to go outside the HA docker. I have monitor, keybord connected to my Raspberry pi4. How can i find the path to where the python is installed?
I'm afraid I'm not acquainted with HassOS myself, to be able to fix the issue it's a requirement to get access to the python runtime executing home assistant so that you can copy the working python code specifically for this functionality to replace the faulty one. I guess the home assistant community forum will have had similar questions (how to get into to the root system hassOS is running in), or is at least a bigger chance for you to be able to find someone who has such experience.
Once you are able to have that (basically see that python
is a supported command) you have all information in this thread on how to find the path where you can find that library. If you are at that point and you do not seem to be able to copy it over, give a shout and I'm happy to support you further given the circumstance you are in at that point (please add some explanation of the situation in that case, if no docker
is in play in this case I would go for an option like using scp
which is a very common way to transfer files between servers)
Thanks for the help... Lot of learning for me.. will be continued.
@Jeroen45 I'm far from a specialist, but I think you're tying to find / execute the python things in the SSH docker. Try using this post to gain access to the actual home assistant docker where python is installed.
Basically: log in with SSH and execute this command:
docker exec -it HomeAssistant bash
Now you'll be able to find python and pyads.
I'm having the same issue and it took me several hours to come to this point, basically because I was unaware Home Assistant runs in a docker container in the OS. Now all I need is a working version of the pyads folder (preferably without first reverting to the old version of Home assistant OS)
Question: is there a way to get access to the files of the HomeAssistant container through the samba add-on, or would I need to install samba in the container? Would that be OK to do? (It would be much easier to just copy the files from one PI to another using my pc...
The files in the end need to be in the system running home assistant (the system running python basically). So if you are using a container that would mean it needs to be inside the container.
However, if you are running a container, nothing is stopping you from specifying a volume mount to that directory from your host system, which is how I'm doing it now. That makes managing the samba share much easier in your case.
and ofc, stressing that this is all to alleviate a build issue, once that is been solved all of this is ofc no longer required. I have not yet found where it actually is going wrong though, I'm not so familiar with the home assistant build system, or python build systems in general
However, if you are running a container, nothing is stopping you from specifying a volume mount to that directory from your host system, which is how I'm doing it now. That makes managing the samba share much easier in your case.
Nothing except a general lack of knowledge of Linux-based OS'es and docker containers :-) It's time to expand my knowledge on this. I'll give it a try later this week. Thanks a lot for your kind reply.
I connected a monitor and keybord, i can find the /usr/local/lib/python3.9/site-packages/pyads folder. But where to store these files to later copy them into the /usr/local/lib/python3.10/site-packages/pyads folder
you could scp/rsync it to a computer on the network and when upgraded, move it back.. not sure if any other directories will not be touched by this, hence the "be sure" approach
Yes, i managed to kopie the files to a folder on my laptop, using Winscp. copied them back to the python3.10 folder. ADS is working now. Many many thanks to you guys...
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
I updates right now to 2022.12.9 and the bug is still there. Only the mentioned workaround above works, but we will see how long.
Maybe somebody with the knowledge about the pylib generation can fix this finally? That would be great!
As @C0D3-IT wrote above, neither 2022.12.9 fixes: the workaround does. As evaluated by other users (much more skilled than I am about it, for sure!), the problem resides into the management of pyads with the latest (June 2022?) wheels package management: https://github.com/home-assistant/wheels-custom-integrations/issues/651 could somebody help, please?!?
I updates right now to 2022.12.9 and the bug is still there. Only the mentioned workaround above works, but we will see how long.
Maybe somebody with the knowledge about the pylib generation can fix this finally? That would be great!
Could you explain me better which one is it your work arround?
Did someone find solution for this issue??
I found that in manifest file there is pyads ==3.2.2
Last pyads version is 3.3.9, maybe old version is imported and is not supported python 3.10.
I'll try to find some time to investigate that breadcrumb this evening or the coming days, that might indeed be an interesting path to explore! 👍 (or if someone is already doing so, by all means let it be known so we're not both spending time ;-))
I updates right now to 2022.12.9 and the bug is still there. Only the mentioned workaround above works, but we will see how long. Maybe somebody with the knowledge about the pylib generation can fix this finally? That would be great!
Could you explain me better which one is it your work arround?
as soon as you have an older working copy of pyads folder (it was ok till 2022.05, for sure) you can back-up it: after updating to lastest homeassistant version, you can override the new non-working pyads folder with the older one you backed-up.
I took the docker commands to backup/override the pyads folders from here: https://github.com/home-assistant/core/issues/74067#issuecomment-1179256015
more details here: https://github.com/home-assistant/core/issues/74952#issuecomment-1404854509
While wanting to test this I pulled in the latest docker image provided for home assistant (image tag f0af2244da02
) I do not have any issues atm. Although the adslib.so
file that is introduced for the pyads
module is stil x86_64
Can anyone else verify as well that I'm not having a fluke on my end?
Still doesn't work for me.
I have RP4 Home Assistant 2023.2.0b3 Supervisor 2023.01.1 Operating System 9.5
and below log:
Can anyone else verify as well that I'm not having a fluke on my end?
Updatet my HA core to 2023 version and still not working. Had to copy the old working folder to make everything working again, as described in this post
Yes, i managed to kopie the files to a folder on my laptop, using Winscp. copied them back to the python3.10 folder. ADS is working now. Many many thanks to you guys...
@Jeroen45 could you explain how you connect via Winscp? I'm connected but i'm not able to find the python folder
Still doesn't work for me.
Thank you for checking, will check why mine isn't causing any issues and try to re-iterate on the possible solution that was identified. I'm not able to commit to this in the next few days however, I'll plan something in during next week 👍
The problem
When starting the latest docker on a raspberry pi 4 the ADS integration seems to be broken, sounds like a build problem targeting the wrong architecture.
I've had a couple of issues (like MySql 8 suddenly requiring the
mysql_native_password
plugin instead of the previously already workingcaching_sha2_password
) which I was able to work around but this one is blocking for me as it completely breaks the integration with my Beckhoff which is at the heart of my home control.Labels provided through this image are:
Labels of the image that is still working for me:
What version of Home Assistant Core has the issue?
core-2022.7.0.dev20220627
What was the last working version of Home Assistant Core?
core-2022.6.0.dev20220506
What type of installation are you running?
Home Assistant Container
Integration causing the issue
ADS
Link to integration documentation on our website
https://www.home-assistant.io/integrations/ads/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?