canonical / craft-archives

A library for handling archives/repositories in Craft applications
https://canonical-craft-archives.readthedocs-hosted.com
GNU Lesser General Public License v3.0
0 stars 8 forks source link

Key conflict on noble due to `http` vs `https` #139

Open tigarmo opened 6 days ago

tigarmo commented 6 days ago

Bug Description

Related to #129 , the following specification on noble:

package-repositories:
  - type: apt
    url: https://archive.ubuntu.com/ubuntu
    suites: [noble]
    components: [main]
    architectures: [i386]
    key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C
    key-server: keyserver.ubuntu.com

... fails with:

2024-11-22 10:00:27.608 Refreshing repositories
2024-11-22 10:00:27.608 Executing: ['apt-get', 'update']
2024-11-22 10:00:27.615 :: E: Conflicting values set for option Signed-By regarding source https://archive.ubuntu.com/ubuntu/ noble: /etc/apt/keyrings/craft-991BC93C.gpg != /usr/share/keyrings/ubuntu-archive-keyring.gpg
2024-11-22 10:00:27.615 :: E: The list of sources could not be read.

From the logs, it looks like craft-archives is reading the existing sources but ignoring them because their url is http and not https:

2024-11-22 10:00:27.601 Looking for existing sources files for url 'https://archive.ubuntu.com/ubuntu' and suites ['noble']
2024-11-22 10:00:27.601 Reading sources in '/etc/apt/sources.list.d/ubuntu.sources' looking for 'https://archive.ubuntu.com/ubuntu/'
2024-11-22 10:00:27.602 Source does not have a matching url: http://archive.ubuntu.com/ubuntu/
2024-11-22 10:00:27.602 Source does not have a matching url: http://security.ubuntu.com/ubuntu/
2024-11-22 10:00:27.602 No existing sources found

To Reproduce

.

part yaml

package-repositories:
  - type: apt
    url: https://archive.ubuntu.com/ubuntu
    suites: [noble]
    components: [main]
    architectures: [i386]
    key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C
    key-server: keyserver.ubuntu.com

Relevant log output

.
syncronize-issues-to-jira[bot] commented 6 days ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3714.

This message was autogenerated