Cornered trying to upgrade Python to avoid 3.8 deprecation

Hi all

Not sure if someone else has experienced this, and found a solution around it.

I am on HA 2021.10.7 running on a Python 3.8 venv in a RPi4 (Buster). Due to the impending deprecation of 3.8, I decided to move to 3.9 in advance.

While 3.9 successfully installed in a new venv, I got a libffi.so.7 not found error when I tried to start HA. I had to resort to symlinking to lubffi.so.6 as I couldn’t find a way to get .7 installed properly. Has anyone found a way to get libffi.so.7 installed?

Then I decided to bite the bullet and upgrade from Buster to Bullseye as apparently that had .7. Indeed it did, but I had issues starting up my mosquitto broker (start up script seems to have broken). While most integrations worked, obviously MQTT based ones like Tasmota didn’t… By then it was well past midnight, so the quickest way to bed was run from backup (back to Buster, Python 3.8, etc).

As I didn’t spend any time finding out why Mosquitto didn’t start upon upgrade to Bullseye (apart from the error resulted from not being able to write to pid file), would be interested to know if this was a known issue with a fix. I prefer not to debug this on the fly on a live system that my family uses.

So basically, I am currently cornered. I could run 3.9 with the symlink for libffi.so.7 but I prefer not to unless I an assured nothing bad will happen.

Cheers
Joe

Not much help, but I do run native mosquitto on Bullseye, both on 64bit (RbPi4) and 32bit (RbPi2)

Thanks - eventually got that working… the issue was related to migrating from mosquitto v1 to v2 and some incompatibilities. After a couple more issues with RPi.gpio, etc, finally now have Python 3.9 on Bullseye!

The libffi.so.7 issue remains something to be aware of for those who are happily on Buster and need to upgrade from Python 3.8 to 3.9 because of the upcoming deprecation. It drove me to upgrade the OS to Bullseye and in the process encounter a number of non-HA related issues.

Thanks for the above @JoeSydney . I had the exact same experience yesterday night and decided to roll back to a trusted backup: Python3.8.5 on Buster.
Still keen though to have a prepared set up, so I also feel the need to move to Bullseye and Python3.9.5 with the latest HomeAssistant.

How did you upgrade to Bullseye? The Raspberry OS community advises a clean install. Did you do that or did you follow the upgrade procedures that are widely spread?

I did the upgrade rather than clean install. I had issues the first try, rolled back the entire system, and then on the second try, things worked out. The 1st failure was due to the mosquitto upgrade which I had not been prepared for.

Good luck!

Have you tried this suggestion:

wget "https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz"
tar zxf libffi-3.3.tar.gz
cd libffi-3.3
./configure
sudo make install
sudo ldconfig

Good tip for others who may have this issue. I am now on Bullseye as it was a matter of time before I did that anyway…

Cheers
Joe