Failed upgrade v3.0.6

It turns out this problem exists in versions v3.0.x.
I had to upgrade to v3.1.x, and the rebuild is succeeding now.