Need Help: Aptly unrecoverable corruption issue

472 views
Skip to first unread message

john....@gmail.com

unread,
Jan 19, 2015, 9:59:35 AM1/19/15
to aptly-...@googlegroups.com
Help! I'm in an interesting situation where $HOME/.aptly/public/pool/main/e/$PKG_NAME is present, but cannot be detected. I have carefully verified that the package is not in any repo or snapshot, so this is an orphan. I do not know what the scenario is for how this happened.

On first glance, I can re-add the package using aptly add repo, which does nothing successfully, and the existing pool content is not altered. If I then try to publish the repo, it fails with (xxx inserted to obscure names):

ERROR: unable to publish: unable to process packages: error linking file to /home/xxx/.aptly/public/pool/main/e/xxx/xxx-1a6_amd64.deb: file already exists and is different

I've tried db cleanup and even db recover, both with no effect. I'm unaware of any command to reconcile the db with the actual pool contents.

This is obviously a major bug, so here is my bug report. This was a fresh install of aptly 0.8 on a Ubuntu 14.04 platform. There appears to be no mechanism to relate files in the pool back to the db entries.

So, onwards. I have about 200 local packages in the multiple repositories, along with some key ubuntu mirrors. How do I recover from this bug? Is it safe to simply delete the unknown pool content and add it again?

Also, since my confidence in aptly is now severely shaken, how do I detect this bug occurence when it happens the next time, and recover from it in the future?

Andrey Smirnov

unread,
Jan 19, 2015, 10:15:30 AM1/19/15
to john....@gmail.com, aptly-...@googlegroups.com
Hi John!

Good news: this is not a bug in aptly, and this could be easily fixed.

When you publish several snapshots all repositories to the same prefix (under different distribution names), they all share common package pool (/home/xxx/.aptly/public/pool/main/ in your case). If you have two packages with different contents, but same version, name and architecture, they would end up having the same file name in that pool directory. Of course it's not possible to have two different files having same filename. aptly error says that file already exists and aptly would refuse to overwrite it by default.

There are several ways to deal with that:

1. This is intentional: you have two packages with same arch, name and version and different contents. You should publish repositories with such packages under different prefixes (prefix is parameter to aptly publish snapshot|repo). They would have separate pool directories, problem is fixed.
2. You have two duplicate packages, but you don't need them: find offending packages using `aptly package show --with-references --with-files xxx_1a6_amd64`. It should display two packages with different contents and all repos/snapshots that reference them. Drop published repository you don't need anymore, it should remove package file from the pool.
3. You don't have duplicate packages, and this file is in the package pool due to some unfinished publish operation or anything else. If you don't need it, you can just remove it by hand or do `aptly publish repo -force-overwrite` to overwrite such files.



--
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-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages