Aptly seems to keep repo pool metadata independent of the package metadata. They both keep the package signatures, and they had better match or there is no way to recover.
For unknown reasons, I have a repo where these have become different on a few packages. Most of the time this does not cause an issue, but when it causes a problem I have to resort to backups to recover. I have a suspicion that there is a locking issue between the API and the CLI interfaces, but cannot confirm that as the cause.
I can very easily reproduce the problem at will with a known set of packages. The problem is not identifiable until you attempt to publish the repository.
E.g:
$ aptly repo copy app-production app-dev my-package_1.4-3.2_amd64
$ aptly publish drop app
$ aptly snapshot drop snap-app-dev-latest
$ aptly snapshot create snap-app-dev-latest from repo app-dev
$ aptly publish snapshot \
-distribution=company-app \
-component=dev,testing,stable,production \
snap-app-dev-latest \
snap-app-testing-latest \
snap-app-stable-latest \
snap-app-production-latest
Loading packages...
Generating metadata files and linking package files...
ERROR: unable to publish: unable to process packages: error linking file to /home/me/.aptly/public/pool/dev/m/my-package/my-package_1.4-3.2_amd64.deb: file already exists and is different
I am unable to fix this using any identified mechanism. Running aptly db cleanup and/or aptly db recover do not fix this. It may be possible to hand-insert the correct metadata in the repo, but that is probably at least a day of hacking that I would like to avoid every time this bug hits me.
The root cause of the problem appears to be aptly incorrectly using the somehow-damaged metadata from the repo instead of the metadata from the package, leading to a metadata mismatch that is only detected at publish time.
I'm currently using Aptly-1.0.1, the latest available. This version has been updated several times over the last several years. Is there a version of Aptly that will always update the repo metadata using the package metadata instead of the current broken behaviour? Or, is there a tool or undocumented command or flag to correct the pool metadata to match the actual packages?
--
You received this message because you are subscribed to the Google Groups "aptly-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aptly-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
At some time in the past and for unknown reasons, a duplicate package occurred.
Since aptly package show did not handle this situation, Andrey recommended that I locate the duplicate using the find command, which found several copies of 2 different files with the same name in the pool/ and public/pool/ dirs.
So, there was a duplicate situation created at some time in the past.
The one referenced in the Packages file for the known repo was the one being used by everyone, so I deleted the other one in 2 places and ran aptly db cleanup. This discovered the 2 files removed, and fixed the db. Re-publishing the repo now succeeds.
Thank you Andrey!!