undefined symbol XML_SetHashSalt

Hello.
In my system log, I see the following error message:

unattended-upgrade-shutdown[2878]: /usr/bin/python3: symbol lookup error: /usr/bin/python3: undefined symbol: XML_SetHashSalt
Can you help me find the cause and solve this problem?
I’m not sure I’m posting in the right section. Please move this request to the correct thread.

(This is a perfectly fine section - general questions and requests for help go here.)

That’s a very odd error. My gut feeling is that it’s because two things got upgraded at different points, or one of them failed to upgrade. Are there any other errors in the log?

I’m guessing that this showed up during or after an upgrade (the name “unattended-upgrade-shutdown” suggests after), and so the first question is: did the system come back up again?

Assuming that it does, try launching /usr/bin/python3 and see if you can use XML features:

>>> import xml.etree.ElementTree as ET
>>> ET.fromstring("<greeting>Hello, world</greeting>")
<Element 'greeting' at 0x7f1649600d60>

That may trigger the error again. If it doesn’t, it’s entirely possible that it was a transient error, caused by a temporary mismatch between binaries.

Hello.

Thank you for your interest in my problem. I checked the update log, but haven’t found any old entries with the error yet.
Running the command /usr/bin/python3 fails with the error /usr/bin/python3: symbol lookup error: /usr/bin/python3: undefined symbol: XML_SetHashSalt

I also tried a harmless apt update and the output shows the message:
E: Problem executing scripts APT::Update::Post-Invoke-Success ‘if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi’
E: Sub-process returned an error code

Okay, so there is definitely a problem.

Yeah that doesn’t look good. Looks like you have a damaged system.

Start with sudo apt -f install and see if you can get something from that; it should try to repair any half-installed packages. I’m not sure what exactly is going on with the cnf-update-db though.

apt -f install
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
0 upgraded, 0 newly installed, 0 to remove and 579 not upgraded.

It’s look good.

It remains to figure out Python

Good. I don’t know where I’d look next for problems, but you may find it helpful to remove and reinstall some key packages.