Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libdnf doesn't properly support multiple gpg public keys in repo config files, breaking microdnf #1588

Open
jessecooper opened this issue Jul 5, 2022 · 3 comments
Assignees

Comments

@jessecooper
Copy link

Version Info:

bash-4.2# rpm -aq | grep microdnf
microdnf-2-8.el7.x86_64

Taken from the yum man page:

Multiple URLs may be specified here in the same manner as the baseurl option (above). If a GPG key is required to install a package from a repository, all keys specified for that repository will be installed.

dnf/yum are able to accept multiple gpgkey keys like in the following example of mysql repo definition:

[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Microdnf will throw the following error until the secondary key is removed:

(microdnf:25): libdnf-WARNING **: 20:42:52.540: Skipping refresh of mysql80-community: Failed to download gpg key for repo 'mysql80-community': Curl error (37): Couldn't read a file:// file for file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022;file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022;file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql]
@jrohel jrohel self-assigned this Jul 11, 2022
@jrohel
Copy link
Contributor

jrohel commented Jul 12, 2022

Microdnf supports multiple public gpg repo keys. The problem is in the multi-line notation in the configuration file.
Try to write all the keys on one line. Example:
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Dnf supports the non-standard multi-line extension of the INI format. Using single-line notation is a more compatible approach.
Multiple keys on a single line are supported in both dnf and microdnf.

@jessecooper
Copy link
Author

@jrohel Thank you for the response it is good to understand there is a behavior difference between microdnf and dnf. I am sure this is going to trip people up and cause people to have to troubleshoot the issue as I did.

Would making it the same be too much overhead for microdnf?

@Conan-Kudo
Copy link
Member

This is a libdnf bug rather than a microdnf bug, since the INI parsing is happening there.

@Conan-Kudo Conan-Kudo transferred this issue from rpm-software-management/microdnf Nov 28, 2022
@Conan-Kudo Conan-Kudo changed the title microdnf is unable to accept multiple repo gpg public keys libdnf doesn't properly support multiple gpg public keys in repo config files breaking microdnf Nov 28, 2022
@Conan-Kudo Conan-Kudo changed the title libdnf doesn't properly support multiple gpg public keys in repo config files breaking microdnf libdnf doesn't properly support multiple gpg public keys in repo config files, breaking microdnf Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants