ADS integration breaks after update of core on RPi4

I had my Beckhoff ADS integration working since a couple of months.
Yesterday I did an update of the core and now none of the ADS sensors is found anymore.
Log says:

Logger: homeassistant.setup
Source: setup.py:162
First occurred: 00:51:36 (1 occurrences)
Last logged: 00:51:36

Setup failed for ads: Unable to import component: Exception importing homeassistant.components.ads

Logger: homeassistant.config
Source: loader.py:627
First occurred: 00:51:30 (289 occurrences)
Last logged: 00:51:36

Platform error: binary_sensor
Platform error: sensor
Platform error: light
Platform error: switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 618, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 635, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/src/homeassistant/homeassistant/components/ads/__init__.py", line 10, in <module>
    import pyads
  File "/usr/local/lib/python3.10/site-packages/pyads/__init__.py", line 12, in <module>
    from .ads import open_port, close_port, get_local_address, read_state, \
  File "/usr/local/lib/python3.10/site-packages/pyads/ads.py", line 18, in <module>
    from .pyads_ex import (
  File "/usr/local/lib/python3.10/site-packages/pyads/pyads_ex.py", line 82, in <module>
    _adsDLL = ctypes.CDLL(adslib)
  File "/usr/local/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: Error relocating /usr/local/lib/python3.10/site-packages/pyads/adslib.so: unsupported relocation type 7

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 877, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 627, in get_platform
    raise ImportError(
ImportError: Exception importing homeassistant.components.ads.binary_sensor

Any suggestions? I did 2 updates as first did not work, so I am not sure anymore if my core-2022.7.5 is the earliest to fail.

SYSTEM INFO:

Version core-2022.7.5
Installationstyp Home Assistant OS
Entwicklung false
Supervisor true
Docker true
Benutzer root
Virtuelle Umgebung false
Python-Version 3.10.5
Betriebssystemfamilie Linux
Betriebssystem-Version 5.15.32-v8
CPU-Architektur aarch64
Zeitzone UTC
Configuration Directory /config

ANY ideas?
Thanks,
Mike

Same problem here. ADS integration worked with version 2022.6.7. Not anymore with 2022.7.6.
See also https://github.com/home-assistant/core/issues/74952.
I downgraded: ha core update --version 2022.6.7

Semi OT, and I am embarrassed to ask.

I did not manage to downgrade :frowning:

  1. No full backup
  2. When I do a fresh install with an old image I always ended up with the latest core anyway, apparently it does an Autoupdate on first run / install?
    Can someone point me to a working way on how to get an old core running?
    Thanks !!
    Mike

Same problem here! Today I tested the latest release. Still same error, ADS is broken.
Log shows:

  File "/usr/src/homeassistant/homeassistant/components/ads/__init__.py", line 10, in <module>
    import pyads
  File "/usr/local/lib/python3.10/site-packages/pyads/__init__.py", line 12, in <module>
    from .ads import open_port, close_port, get_local_address, read_state, \
  File "/usr/local/lib/python3.10/site-packages/pyads/ads.py", line 18, in <module>
    from .pyads_ex import (
  File "/usr/local/lib/python3.10/site-packages/pyads/pyads_ex.py", line 82, in <module>
    _adsDLL = ctypes.CDLL(adslib)
  File "/usr/local/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: Error relocating /usr/local/lib/python3.10/site-packages/pyads/adslib.so: unsupported relocation type 7
2022-08-04 17:49:06.079 ERROR (MainThread) [homeassistant.config] Platform error: binary_sensor

Will this be fixed? Or is support for ADS stopped?

For the moment I have to revert to my backup with the latest working version: 2022.6.7

Samen issue here. Reverting to the last (albeit partial) backup and it’s back online.
Hopefully it will be fixed: I have the impression ads is not the most sexy integration and could use some attention.

1 Like

Same issue here. Thing is: It’s working on a VM, but not on RPI install.
Perhaps something wrong with pyads ?

Same here. had to downgrade to version core 2022.6.7 to get ADS working again.

I turned my ADS off in configuration.yaml as soon as the new build broke it. I am now running 2022.8.7 and tried to turn it back on thinking it might be fixed. But, when I checked my configuration, I got the “Invalid” message, so I commented it out again.

Anyone know the current status of the ADS feature in core?

I’m trying to add the ADS integration but I get the invalid message also. Any news on the subject?

For everybody who had it working and it broke on 2022.7.x - you can revert the core back to 2022.6.7 and it will work again. (I have gone back for now, until it is fixed.)

See How do I install core-2022.6.x from scratch on RPi? - #2 by tom_l

Will there be a fix apart from reverting back to 2022.6.7?

Is this issue on RPI install allready solved in the latest 2023.2.5 ?

Unfortunately the problem still exists.
This Github topic provides a workaround:

Hi All,

Having the same issue while integrating my Beckhoff CX1010 into home assistant.
Finally i fixed this by putting the complete integration in Node Red.

I’ve used the node-red-contrib-ads-client for adding the ADS functionality to my Home Assistant.

Hopefully this will help some of you to get ADS running again.

Running:
Home Assistant 2023.6.3
Supervisor 2023.06.4
Operating System 10.3
RPI 3

Apparently nothing has changed on this issue.

can someone from the @homeassistant team look into this.
As in Allow for platform dependent builds by SaWey · Pull Request #363 · stlehmann/pyads · GitHub mentioned, the ads implementation there is working. it’s somehow homeassistant manages their dependencies.
ads is a core feature of home assistant. So it’s very annoying, that such a bug exists since 2 years