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

Aptly 1.6.0 - Cannot Create Snapshot on Mirror with no Packages (Example debian-security non-free) #1416

Open
4 tasks done
bille747 opened this issue Jan 8, 2025 · 2 comments · Fixed by #1422
Open
4 tasks done
Assignees
Labels
bug please confirm resolved We believe the issue is resolved ! if so, please close the issue, thanks ;-)
Milestone

Comments

@bille747
Copy link

bille747 commented Jan 8, 2025

Detailed Description

When mirroring a repo that doesn't currently have any packages (In my case, debian-security's non-free component), Aptly 1.6.0 fails to create a snapshot, stating that the mirror has not been updated.

Aptly 1.6.0 behavior:

Create mirror:

aptly mirror create -architectures=amd64,arm64,armhf -with-udebs debian-bookworm-security-non-free https://deb.debian.org/debian-security/ bookworm-security updates/non-free

Downloading: https://deb.debian.org/debian-security/dists/bookworm-security/InRelease
gpgv: can't allocate lock for '/root/.gnupg/trustedkeys.gpg'
gpgv: Signature made Wed Jan 8 19:17:26 2025 UTC
gpgv: using RSA key ED541312A33F1128F10B1C6C54404762BBB6E853
gpgv: Good signature from "Debian Security Archive Automatic Signing Key (11/bullseye) [email protected]"
gpgv: Signature made Wed Jan 8 19:17:27 2025 UTC
gpgv: using RSA key B0CAB9266E8C3929798B3EEEBDE6D2B9216EC7A8
gpgv: Good signature from "Debian Security Archive Automatic Signing Key (12/bookworm) [email protected]"

Mirror [debian-bookworm-security-non-free]: https://deb.debian.org/debian-security/ bookworm-security [udeb] successfully added.
You can run 'aptly mirror update debian-bookworm-security-non-free' to download repository contents.

Update mirror:

aptly mirror update debian-bookworm-security-non-free

Downloading: https://deb.debian.org/debian-security/dists/bookworm-security/InRelease
gpgv: can't allocate lock for '/root/.gnupg/trustedkeys.gpg'
gpgv: Signature made Wed Jan 8 19:17:26 2025 UTC
gpgv: using RSA key ED541312A33F1128F10B1C6C54404762BBB6E853
gpgv: Good signature from "Debian Security Archive Automatic Signing Key (11/bullseye) [email protected]"
gpgv: Signature made Wed Jan 8 19:17:27 2025 UTC
gpgv: using RSA key B0CAB9266E8C3929798B3EEEBDE6D2B9216EC7A8
gpgv: Good signature from "Debian Security Archive Automatic Signing Key (12/bookworm) [email protected]"
Downloading & parsing package files...
Downloading: https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/binary-amd64/Packages.xz
Downloading: https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/debian-installer/binary-amd64/Packages.xz
Downloading: https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/binary-arm64/Packages.xz
Downloading: https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/debian-installer/binary-arm64/Packages.xz
Downloading: https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/binary-armhf/Packages.xz
Downloading: https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/debian-installer/binary-armhf/Packages.xz
Building download queue...
Download queue: 0 items (0 B)

Mirror debian-bookworm-security-non-free has been updated successfully.

Create snapshot:

aptly snapshot create debian-bookworm-security-non-free-$(date +'%Y%m%d') from mirror debian-bookworm-security-non-free

ERROR: unable to create snapshot: mirror not updated

In the previous release of Aptly (1.5.0+ds1-1+b4), aptly will successfully create a snapshot of an empty mirror.

Aptly 1.5.0 behavior:

Create mirror:

aptly mirror create -architectures=amd64,arm64,armhf -with-udebs debian-bookworm-security-non-free https://deb.debian.org/debian-security/ bookworm-security updates/non-free

Downloading https://deb.debian.org/debian-security/dists/bookworm-security/InRelease...
Success downloading https://deb.debian.org/debian-security/dists/bookworm-security/InRelease
gpgv: can't allocate lock for '/root/.gnupg/trustedkeys.gpg'
gpgv: Signature made Wed Jan 8 19:17:26 2025 UTC
gpgv: using RSA key ED541312A33F1128F10B1C6C54404762BBB6E853
gpgv: Good signature from "Debian Security Archive Automatic Signing Key (11/bullseye) [email protected]"
gpgv: Signature made Wed Jan 8 19:17:27 2025 UTC
gpgv: using RSA key B0CAB9266E8C3929798B3EEEBDE6D2B9216EC7A8
gpgv: Good signature from "Debian Security Archive Automatic Signing Key (12/bookworm) [email protected]"

Mirror [debian-bookworm-security-non-free]: https://deb.debian.org/debian-security/ bookworm-security [udeb] successfully added.
You can run 'aptly mirror update debian-bookworm-security-non-free' to download repository contents.

Update mirror:

aptly mirror update debian-bookworm-security-non-free

Downloading https://deb.debian.org/debian-security/dists/bookworm-security/InRelease...
Success downloading https://deb.debian.org/debian-security/dists/bookworm-security/InRelease
gpgv: can't allocate lock for '/root/.gnupg/trustedkeys.gpg'
gpgv: Signature made Wed Jan 8 19:17:26 2025 UTC
gpgv: using RSA key ED541312A33F1128F10B1C6C54404762BBB6E853
gpgv: Good signature from "Debian Security Archive Automatic Signing Key (11/bullseye) [email protected]"
gpgv: Signature made Wed Jan 8 19:17:27 2025 UTC
gpgv: using RSA key B0CAB9266E8C3929798B3EEEBDE6D2B9216EC7A8
gpgv: Good signature from "Debian Security Archive Automatic Signing Key (12/bookworm) [email protected]"
Downloading & parsing package files...
Downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/binary-amd64/Packages.xz...
Success downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/binary-amd64/Packages.xz
Downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/debian-installer/binary-amd64/Packages.xz...
Success downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/debian-installer/binary-amd64/Packages.xz
Downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/binary-arm64/Packages.xz...
Success downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/binary-arm64/Packages.xz
Downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/debian-installer/binary-arm64/Packages.xz...
Success downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/debian-installer/binary-arm64/Packages.xz
Downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/binary-armhf/Packages.xz...
Success downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/binary-armhf/Packages.xz
Downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/debian-installer/binary-armhf/Packages.xz...
Success downloading https://deb.debian.org/debian-security/dists/bookworm-security/updates/non-free/debian-installer/binary-armhf/Packages.xz
Building download queue...
Download queue: 0 items (0 B)

Mirror debian-bookworm-security-non-free has been successfully updated.

Create snapshot:

aptly snapshot create debian-bookworm-security-non-free-$(date +'%Y%m%d') from mirror debian-bookworm-security-non-free

Snapshot debian-bookworm-security-non-free-20250108 successfully created.
You can run 'aptly publish snapshot debian-bookworm-security-non-free-20250108' to publish snapshot as Debian repository.

Troubleshooting steps

  • Manually investigated the debian-security repo and confirmed that non-free does not have any packages
  • Search through Github Issues for similar issue
  • Installed Aptly nightly and confirmed the issue persists
  • Revert to Aptly 1.5.0 to confirm this issue does not occur

Context

Even though the repo currently doesn't contain any packages, it may at some point. Back in Aptly 1.5.0, I could continue with the rest of the steps for merging the snapshots and publish but with 1.6.0, this prevents a later snapshot merge because that snapshot was never created in the first place.

Possible Implementation

Aptly should still consider a mirror updated when the mirror contains no packages.

Your Environment

In my environment, I use aptly to mirror the debian repo (bookwork, bookworm-updates, bookworm-security) split by components and then merge the components (with latest only) of 3 sources together and finally publish it.

@neolynx neolynx self-assigned this Jan 8, 2025
@neolynx neolynx added the bug label Jan 8, 2025
@neolynx neolynx added this to the 1.6.x milestone Jan 8, 2025
@neolynx
Copy link
Member

neolynx commented Jan 11, 2025

Hi ! thanks for reporting :)

I was able to reproduce the issue with:

aptly mirror create -ignore-signatures non-free https://security.debian.org/debian-security bookworm-security updates/non-free
aptly mirror update -ignore-signatures non-free
aptly snapshot create oh-snap from mirror non-free

resulting in:

ERROR: unable to create snapshot: mirror not updated

I will investigate...

@neolynx
Copy link
Member

neolynx commented Jan 13, 2025

merged to master, pleased test the Ci build !

@neolynx neolynx reopened this Jan 13, 2025
@neolynx neolynx added the please confirm resolved We believe the issue is resolved ! if so, please close the issue, thanks ;-) label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug please confirm resolved We believe the issue is resolved ! if so, please close the issue, thanks ;-)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants