Update Packages Errors

I have noticed that during the past few updates (on Ubuntu) that the following errors are being reported:

For Dovecot updates:

error: object file .git/objects/32/382b184a96e3aadadc00e547c77a9e00315b71 is empty
error: object file .git/objects/32/382b184a96e3aadadc00e547c77a9e00315b71 is empty

The last lines of the update (before ‘Running kernel seems to be up-to-date.’)
error: object file .git/objects/32/382b184a96e3aadadc00e547c77a9e00315b71 is empty
error: object file .git/objects/32/382b184a96e3aadadc00e547c77a9e00315b71 is empty
fatal: loose object 32382b184a96e3aadadc00e547c77a9e00315b71 (stored in .git/objects/32/382b184a96e3aadadc00e547c77a9e00315b71) is corrupt

Is this something to worry about?

This is about the git repo etckeeper manages. It appears to be corrupt for some reason. Usually that comes from a power outage or reboot or some other disruption to git while changes were being written. For some reason I have only ever seen this happen on Ubuntu systems (I don’t know if this is just because I have a bunch of Ubuntu systems I have to manage for work, and have fewer EL systems I manage for my own stuff, or if there’s something broken about the way etckeeper handles committing after package updates on deb based systems, maybe the trigger is more fragile there, causing some kind of race that causes corruption sometimes).

As for whether to worry: You don’t have working git on that directory anymore until you do something about it. New commits won’t work, and recovering old files won’t work.

For solving it, the second most upvoted answer on StackOverflow is probably the best one: https://stackoverflow.com/a/31110176 (But maybe read and decide for yourself what suits you best.)

I usually just take the lazy way out and delete the .git and run etckeeper init again. But, that blows away all history. If you think you might ever need to roll back a change in etc or recover something from the past, this is not the right thing.