Aptly - Error decoding mirror: Time.UnmarshalBinary: unsupported version

By xngo on April 8, 2020

I was upgrading Aptly from version 1.3 to version 1.4 and I got the following error message:

aptly mirror list
Error decoding mirror: Time.UnmarshalBinary: unsupported version
Error decoding mirror: Time.UnmarshalBinary: unsupported version
Error decoding mirror: Time.UnmarshalBinary: unsupported version
Error decoding mirror: Time.UnmarshalBinary: unsupported version

Solution

The error is caused by the new version of msgpack library. It reads data expecting the new format but my aptly database is using the old format. For more details, see https://github.com/aptly-dev/aptly/issues/791.

The only way that I found to resolve my issue is to delete ~/.aptly/db/ directory. This will erase all Aptly data. For my case, it doesn't matter because I drop and re-create mirrors every time that I run my update scripts.

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.