Updating to current hotfix version 1.2.87 seems to fail with Traceback on /usr/lib/cnf-update-db

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Updating to current hotfix version 1.2.87 seems to fail with Traceback on /usr/lib/cnf-update-db

L0 Member

Attempting to upgrade one of our Expedition instances to 1.2.87 and receiving this error. I'm not sure if it is safe to ignore it or not. This is after following another thread on 4-24 regarding issues with rabbitmq install and getting past that.

 

Ign:15 https://conversionupdates.paloaltonetworks.com expedition-updates/ Translation-en
Ign:16 https://conversionupdates.paloaltonetworks.com expedition-updates/ Translation-en_US
Traceback (most recent call last):
File "/usr/lib/cnf-update-db", line 8, in <module>
from CommandNotFound.db.creator import DbCreator
File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 12, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Reading package lists... Done
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
root@expedition1:/home/expedition#

3 REPLIES 3

L4 Transporter

Hi @stevelove 

Could you try to reinstall the package phyton3-apt. Execute the below commands:

sudo apt remove python3-apt
sudo apt install python3-apt

Let me know if that works.

Best,

David

Thanks. That did work to get me past the update part. Running the install though seems to give me similar errors.

 

expedition@expedition1:~$ sudo apt-get install expedition-beta
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
accountsservice apport-symptoms dconf-gsettings-backend dconf-service distro-info gir1.2-packagekitglib-1.0 glib-networking glib-networking-common glib-networking-services gsettings-desktop-schemas
libaccountsservice0 libappstream4 libdconf1 libglib2.0-bin libgstreamer1.0-0 libpackagekit-glib2-18 libproxy1v5 libsoup2.4-1 libstemmer0d packagekit packagekit-tools python3-automat python3-click
python3-colorama python3-constantly python3-debian python3-distro-info python3-entrypoints python3-gdbm python3-hamcrest python3-httplib2 python3-hyperlink python3-incremental python3-keyring
python3-launchpadlib python3-lazr.restfulclient python3-lazr.uri python3-problem-report python3-pyasn1 python3-pyasn1-modules python3-requests-unixsocket python3-secretstorage python3-service-identity
python3-simplejson python3-systemd python3-twisted python3-twisted-bin python3-wadllib python3-zope.interface
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
expedition-beta
1 upgraded, 0 newly installed, 0 to remove and 104 not upgraded.
Need to get 45.0 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://conversionupdates.paloaltonetworks.com expedition-updates/ expedition-beta 1.2.87 [45.0 MB]
Fetched 45.0 MB in 41s (1,088 kB/s)
(Reading database ... 92144 files and directories currently installed.)
Preparing to unpack .../expedition-beta_1.2.87_amd64.deb ...
Unpacking expedition-beta (1.2.87) over (1.2.85) ...
Setting up expedition-beta (1.2.87) ...
DEPRECATION: distro-info 0.23ubuntu1 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of distro-info or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
DEPRECATION: python-debian 0.1.36ubuntu1 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of python-debian or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
DEPRECATION: distro-info 0.23ubuntu1 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of distro-info or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
DEPRECATION: python-debian 0.1.36ubuntu1 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of python-debian or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
DEPRECATION: distro-info 0.23ubuntu1 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of distro-info or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
DEPRECATION: python-debian 0.1.36ubuntu1 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of python-debian or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
rm: cannot remove '/opt/Spark/spar/jars/log4j-1.2.17.jar': No such file or directory
Checking for old projects and Devices what are not Encrypted
DEPRECATION: distro-info 0.23ubuntu1 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of distro-info or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
DEPRECATION: python-debian 0.1.36ubuntu1 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of python-debian or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Traceback (most recent call last):
File "/usr/bin/firewall-cmd", line 24, in <module>
from gi.repository import GObject
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
from . import _gi
ImportError: cannot import name '_gi' from 'gi' (/usr/lib/python3/dist-packages/gi/__init__.py)
Traceback (most recent call last):
File "/usr/bin/firewall-cmd", line 24, in <module>
from gi.repository import GObject
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
from . import _gi
ImportError: cannot import name '_gi' from 'gi' (/usr/lib/python3/dist-packages/gi/__init__.py)
Impossing PHP CLI 7.0
Make /tmp writable by Apache2
its recommended to run after install: apt-get -y -f install
its recommended to run after install: sudo apt-get autoremove
expedition@expedition1:~$

Hi @stevelove 

 

Although the reported issue the update to expedition 1.2.87 should be good, as well as all Expedition features.

 

I guess the issue on your environment is due to the phyton3 set-up versions. The OS is using phyton3.7 instead of phyton3.8.

You can check that executing: phyton3 --version

To recover the python3.8 as default for the OS you have a couple of paths:

1) I recommend re-executing the script so the BPA will keep using the python 3.7 while the OS the python3.8:

/var/www/html/OS/BPA/updateBPA306.sh

2) Or in case your VM has not internet connections execute the below commands:

# Recover python3.8 as default python version
sudo rm /usr/bin/python3
sudo ln -s /usr/bin/python3.8 /usr/bin/python3
sudo python3.8 /var/www/html/OS/BPA/get-pip.py
sudo rm /usr/local/bin/pip3
sudo ln -s /usr/local/bin/pip /usr/local/bin/pip3 

Note: I recommend to take a VM snapshot prior to the execution of above script or commands.

Let me know if that works on your environment,

Best regards,

David

  • 1551 Views
  • 3 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!