sync fails under certain conditions due to python3-apt not being installed
Ticket moved to GitHub: "pulp/pulp_deb/398":https://github.com/pulp/pulp_deb/issues/398
A katello user here: https://projects.theforeman.org/issues/31701 reported this. When syncing a deb repo (unsure which one), it errors with:
/usr/lib/python3.6/site-packages/debian/deb822.py:727 UserWarning: Parsing of Deb822 data with python3-apt's apt_pkg was requested but this package is not importable. Is python3-apt installed?
Looking at the code, the default value for use_apt_pkg is True: https://salsa.debian.org/python-debian-team/python-debian/-/blob/master/lib/debian/deb822.py#L2331
and pulp isn't overriding it: https://github.com/pulp/pulp_deb/blob/ff7bf434b0c3aabdf165f2f9793f4acce668c724/pulp_deb/app/tasks/synchronizing.py#L546
so its defaulting to True.
A full traceback isn't available, nor what repository they were syncing, but we could ask for that info if needed.
Updated by quba42 almost 3 years ago
I have noticed this warning in the past, I just never noticed any actual failures or adverse effects resulting from it.
Looking at the original Katello bug report I am not 100% sure what exactly failed, and if it is really related to the warning.
That being said I should probably stop kicking that particular can down the road and investigate.
With respect to the warning I guess there are two possibilities:
- Stop requesting "parsing of Deb822 data with python3-apt's apt_pkg"
- Simply add
python3-aptto the pulp_deb dependencies.
I have no idea which is better or if this will solve the issue. Perhaps we can ask the user with the problem to retest the sync after manually installing the
python3-apt package? (Though I am also not sure if this package is available on RPM based setups...)
Updated by knzivid over 2 years ago
I noticed the same while syncing
pulp_1 | /usr/local/lib/python3.6/site-packages/debian/deb822.py:740: UserWarning: Parsing of Deb822 data with python3-apt's apt_pkg was requested but this package is not importable. Is python3-apt installed? pulp_1 | warnings.warn(msg)
I can retest the sync after installing python3-apt. Is there an ubuntu based docker image for pulp similar to pulp/pulp-oci-images?
Updated by quba42 over 2 years ago
The short answer is: I don't think there is a pulp container image running on Debian or Ubuntu.
pulp_installer repo, there is a
pulp3-sandbox-debian10 Vagrant box which might be the closest thing. Alternatively it might be possible to install libapt and python-apt on top of the existing CentOS container image, but that would certainly require some tinkering.