aptly icon indicating copy to clipboard operation
aptly copied to clipboard

Mirrors and Snapshots unreadable after aptly upgrade

Open bsundsrud opened this issue 12 years ago • 14 comments

After upgrading from a locally built 0.6 version to the debian repo 0.7 version, we're receiving the following error on aptly mirror list:

2014/07/31 11:17:58 Error decoding mirror: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:17:58 Error decoding mirror: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:17:58 Error decoding mirror: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:17:58 Error decoding mirror: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:17:58 Error decoding mirror: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:17:58 Error decoding mirror: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:17:58 Error decoding mirror: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:17:58 Error decoding mirror: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:17:58 Error decoding mirror: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:17:58 Error decoding mirror: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
No mirrors found, create one with `aptly mirror create ...`.

And the following on aptly snapshot list:

2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128
2014/07/31 11:21:58 Error decoding snapshot: codec.decoder: readContainerLen: Unrecognized descriptor byte: hex: 80, dec: 128

No snapshots found, create one with `aptly snapshot create...`.

We've currently rolled back to the 0.6 version and things are working, but is there any way forward for us without re-creating everything under aptly 0.7?

I've also upgraded aptly on a different server from 0.6 to 0.7 (both versions came from the debian repo) and that one worked fine. I didn't install the 0.6 version and it may have been a build of master (version reports 0.6~dev).

bsundsrud avatar Jul 31 '14 16:07 bsundsrud

@bsundsrud what version of go have you been using to build 0.6~dev version? Could it be that it was go 1.1?

smira avatar Aug 05 '14 12:08 smira

Looks like it was actually go 1.0, the system golang was installed via the Ubuntu Trusty repos (installed version is golang-go 2:1-5)

bsundsrud avatar Aug 05 '14 13:08 bsundsrud

The release version of Trusty has golang-go 2:1.2.1 -- you might have a leftover from a Trusty beta?

sodabrew avatar Aug 05 '14 13:08 sodabrew

Sorry, the server isn't Trusty, it's actually Precise.

bsundsrud avatar Aug 05 '14 14:08 bsundsrud

Yes, precise looks more like that... let me try to reproduce that and look for the fix. Actually go1.0 has never been supported for aptly.

smira avatar Aug 05 '14 17:08 smira

Yeah I noticed that. Don't spend too much time on it, I've already planned out how to do a more manual migration. This should probably be chalked up to "doing unsupported things is dangerous". I found the old checkout, it was built off of bc7972ff6 which is basically 0.5.

bsundsrud avatar Aug 05 '14 18:08 bsundsrud

@bsundsrud, I tried to track the issue which looks different, but most probably is the same. aptly built using go1.1 refuses to read DB generated by aptly built with go1.2+. The problem was that internal encoding of time.Time by msgpack library changes dramatically when going from go1.1 to go1.2. I wonder how this could have worked for go1.1.

I've already raised minimum version of go to 1.2 in documentation. Binary releases of aptly have always been built with go1.2+.

smira avatar Aug 05 '14 21:08 smira

Cool, thanks for the info.

bsundsrud avatar Aug 05 '14 21:08 bsundsrud

Please let me know if I could help with your DB migration. I've reproduced exactly the issue you've reported. I'll try to see if I could have a fix for that.

smira avatar Aug 05 '14 21:08 smira

Ok, the issue you reported is related directly to the time.Time encoding. I can try building a workaround.

smira avatar Aug 05 '14 21:08 smira

The fix is there, it would go into bugfix version aptly 0.7.1. I plan to release it tomorrow.

smira avatar Aug 05 '14 21:08 smira

aptly 0.7.1 has been released. @bsundsrud it should be able to read your DB without problems. You might need to do mirror update for all your mirrors to get internal date fixed, but this should be harmless.

smira avatar Aug 06 '14 10:08 smira

Thanks for the quick fix, it seems to be working after a mirror update to all the mirrors.

bsundsrud avatar Aug 06 '14 13:08 bsundsrud

how to do "aptly mirror update" for all mirrors when "aptly mirror list" gives only those errors and not the names of the mirrors?

jringoot avatar Jan 16 '20 09:01 jringoot