Last modified: 2014-11-10 11:42:14 UTC
The updater fails if the wb_terms table is missing, but there are already entities stored on some wiki pages. The reason is that SqlStore::doSchemaUpdates will (correctly) register Wikibase.sql for execution if wb_tables is missing, but then calls SqlStore::rebuild() before Wikibase.sql actually got executed. This causes rebuild() to fail, because the tables that it's trying to populate are not there yet. This is triggered by a rare edge case - usually, the database tables will be present if there are already entities (creating entities would be impossible without them). So the state that triggers this error can only be the result of tempering or failure in the database (in my case: a result of trying to debug the updater itself). The solution would be to wrap SqlStore::rebuild() in a maintenance script (we need that anyway) and register it for later execution, instead of executing it right away.
Let's be realistic. Not going to happen...