Page MenuHomePhabricator

Upgrading: Possible issue with `xhpast` database for installs that upgraded between October 8, 2012 and October 9, 2012
Closed, ResolvedPublic

Description

When upgrading this install, I hit this problem when applying the xhpast rename:

>>> [10] <query> RENAME TABLE secure_xhpastview.xhpastview_parsetree
  TO secure_xhpast.xhpast_parsetree
<<< [10] <query> 3,472 us
[2015-11-16 16:45:15] EXCEPTION: (AphrontQueryException) #7: Error on rename of './secure_xhpastview/xhpastview_parsetree.frm' to './secure_xhpast/xhpast_parsetree.frm' (Errcode: 2) at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:311]

That's failing because the xhpast database does not exist. It doesn't exist because Phabricator believes it already exists, so it does not recreate it:

$ ./bin/storage status
...
phabricator:db.xhpast                                     Applied     -            db   xhpast
....

The date of the patch application is October, 2012:

mysql> select FROM_UNIXTIME(1349752436);
+---------------------------+
| FROM_UNIXTIME(1349752436) |
+---------------------------+
| 2012-10-09 03:13:56       |
+---------------------------+
1 row in set (0.00 sec)

Modern quickstart.sql does not reference this database. I don't recall what happened with in 2012. We might be fine (whatever happened might be unique to this install) but there may be a more widespread issue here.

Related Objects

Event Timeline

epriestley raised the priority of this task from to Low.
epriestley updated the task description. (Show Details)
epriestley added subscribers: epriestley, joshuaspence.

It looks like this database did exist as of D3659, but the name was mistaken (pushed as xhpast, should have been xhprof). It was renamed in D3670.

So this should only affect installs which upgraded in a 23-hour window between October 8, 2012 and October 9, 2012, which may reasonably just be us.

If you're a different install and encounter this, a workaround is to run this command:

mysql> CREATE DATABASE phabricator_xphast;

That will let the normal upgrade process continue normally.

epriestley renamed this task from Upgrading: Possible issue with `xhpast` database to Upgrading: Possible issue with `xhpast` database for installs that upgraded between October 8, 2012 and October 9, 2012.Nov 16 2015, 10:06 PM

@mbishopim3, yeah, looks like you're lucky winner #2 on this. Your workaround (creating the database) was correct.

Excellent, thanks for following up! I am glad it wasn't just some strange issue for just us.

epriestley claimed this task.

I'm going to assume we're in the clear on this.