Numpy errors after moving HA-core from SDcard to USB-SSD

I have a nice working version of HA-Core running on an SDcard on an R-Pi4. I shutdown cleanly made a dd copy to an SSD over USB and booted. It seems to run ok, but HA now fails with a lot of numpy errors (?!).
I booted the old SDcard, and everything workes fine.
Then I copied card again, this time with rpi-clone, and the same thing. Lots of numpy errors when booting the SSD.

Jan 13 14:22:40 heart hass[635]: Traceback (most recent call last):
Jan 13 14:22:40 heart hass[635]:   File "/srv/homeassistant/lib/python3.13/site-packages/numpy/_core/__init__.py", line 23, in <module>
Jan 13 14:22:40 heart hass[635]:     from . import multiarray
Jan 13 14:22:40 heart hass[635]:   File "/srv/homeassistant/lib/python3.13/site-packages/numpy/_core/multiarray.py", line 10, in <module>
Jan 13 14:22:40 heart hass[635]:     from . import overrides
Jan 13 14:22:40 heart hass[635]:   File "/srv/homeassistant/lib/python3.13/site-packages/numpy/_core/overrides.py", line 7, in <module>
Jan 13 14:22:40 heart hass[635]:     from numpy._core._multiarray_umath import (
Jan 13 14:22:40 heart hass[635]:         add_docstring,  _get_implementing_args, _ArrayFunctionDispatcher)
Jan 13 14:22:40 heart hass[635]: ImportError: /srv/homeassistant/lib/python3.13/site-packages/numpy/_core/../../numpy.libs/libgfortran-daac5196-038a5e3c.so.5.0.0: invalid ELF header
Jan 13 14:22:40 heart hass[635]: During handling of the above exception, another exception occurred:
Jan 13 14:22:40 heart hass[635]: Traceback (most recent call last):
Jan 13 14:22:40 heart hass[635]:   File "/srv/homeassistant/lib/python3.13/site-packages/numpy/__init__.py", line 114, in <module>
Jan 13 14:22:40 heart hass[635]:     from numpy.__config__ import show_config
Jan 13 14:22:40 heart hass[635]:   File "/srv/homeassistant/lib/python3.13/site-packages/numpy/__config__.py", line 4, in <module>
Jan 13 14:22:40 heart hass[635]:     from numpy._core._multiarray_umath import (
Jan 13 14:22:40 heart hass[635]:     ...<3 lines>...
Jan 13 14:22:40 heart hass[635]:     )
Jan 13 14:22:40 heart hass[635]:   File "/srv/homeassistant/lib/python3.13/site-packages/numpy/_core/__init__.py", line 49, in <module>
Jan 13 14:22:40 heart hass[635]:     raise ImportError(msg)
Jan 13 14:22:40 heart hass[635]: ImportError:
Jan 13 14:22:40 heart hass[635]: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Jan 13 14:22:40 heart hass[635]: Importing the numpy C-extensions failed. This error can happen for
Jan 13 14:22:40 heart hass[635]: many reasons, often due to issues with your setup or how NumPy was
Jan 13 14:22:40 heart hass[635]: installed.
Jan 13 14:22:40 heart hass[635]: We have compiled some common reasons and troubleshooting tips at:
Jan 13 14:22:40 heart hass[635]:     https://numpy.org/devdocs/user/troubleshooting-importerror.html
Jan 13 14:22:40 heart hass[635]: Please note and check the following:
Jan 13 14:22:40 heart hass[635]:   * The Python version is: Python3.13 from "/srv/homeassistant/bin/python3.13"
Jan 13 14:22:40 heart hass[635]:   * The NumPy version is: "2.2.0"
Jan 13 14:22:40 heart hass[635]: and make sure that they are the versions you expect.
Jan 13 14:22:40 heart hass[635]: Please carefully study the documentation linked above for further help.
Jan 13 14:22:40 heart hass[635]: Original error was: /srv/homeassistant/lib/python3.13/site-packages/numpy/_core/../../numpy.libs/libgfortran-daac5196-038a5e3c.so.5.0.0: invalid ELF header

I’m clueless… How can moving a partition, cause this type of errors?

nm… I removed all partitions on the SSD, and redid the rpi-clone and then it seems to work. I can only guess that the dd somehow made something corrupt and that the rpi-clone (rsync) didnt “see” it and just jumped over it.

Anyway sorry to have nothing to contribute…

1 Like