I think this problem occurred after I accidentally ran two separate createrepo processes simultaneously on the same repository. Obviously that was my mistake, however it does reveal a bug in some uncommonly used part of the code. This may or may not be worth investigating. I figured since it has a stack trace it may be easy to debug. If not, try running two createrepo's at the same time, letting one or both crash, and then running a single createrepo against the partially created repo.