XF 2.2 F\Db\InvalidQueryException: xf_post: MySQL query error [1177]: Can't open table

Triops

Well-known member
I have now tried several times, lengthily and carefully, to migrate testwise my Xenforo 1.5 to 2.2.4 in a local XAMPP instance.

XAMPP for Win10 64bit: x64-7.2.34-2-VC15
PHP Version: 7.2.34
xf_post is InnoDB and utf8_general_ci

The local copy of my LIVE-Xenforo 1.5 is fully executable and shows no errors on that installation. This was only possible up to XAMPP 7.2, in versions 7.3 and 7.4 the pages were destroyed with PHP errors and not executable.

Upgrade to 2.0.0 Alpha and then to 2.1.0 run cleanly.

In step 10 of 2.2.0, the following error always occurs. Continuing is impossible.

exception.png


Code:
XF\Db\InvalidQueryException: xf_post: MySQL query error [1177]: Can't open table in src\XF\Db\AbstractStatement.php at line 228
XF\Db\AbstractStatement->getException() in src\XF\Db\Mysqli\Statement.php at line 196
XF\Db\Mysqli\Statement->getException() in src\XF\Db\Mysqli\Statement.php at line 77
XF\Db\Mysqli\Statement->execute() in src\XF\Db\AbstractAdapter.php at line 94
XF\Db\AbstractAdapter->query() in src\XF\Db\Schema\AbstractDdl.php at line 151
XF\Db\Schema\AbstractDdl->apply() in src\XF\Db\SchemaManager.php at line 149
XF\Db\SchemaManager->alterTable() in src\XF\Install\InstallHelperTrait.php at line 675
XF\Install\Upgrade\AbstractUpgrade->alterTable() in src\XF\Install\Upgrade\2020010-220a.php at line 282
XF\Install\Upgrade\Version2020010->step10() in src\XF\Install\Controller\Upgrade.php at line 175
XF\Install\Controller\Upgrade->actionRun() in src\XF\Mvc\Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 261
XF\Mvc\Dispatcher->dispatchFromMatch() in src\XF\Mvc\Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src\XF\App.php at line 2326
XF\App->run() in src\XF.php at line 488
XF::runApp() in install\index.php at line 14

The error occurs both when upgrading in the browser and within the console with
Code:
php cmd.php xf:upgrade
:


1619711338345.png

From then on MySQL is also somehow "broken", even after a restart, and throws errors at SQL statements in phpmyadmin and the MySQL server stops / goes away:

1619711512646.png


Next I would try to upgrade to Xenforo 2.1 with PHP 7.2.34, then replace the XAMPP 7.2 with 7.3 or even 7.4 and upgrade to Xenforo 2.2. But since that means some work, I'd rather ask for advice and help beforehand.

Thanks in advance!
 
Last edited:
Solution
Since no suggestions came, but the error occurred 5 times reproducibly, I experimented further.

In short: it is not due to the XAMPP / PHP version, 7.2 is fine.
I finally copied the XAMPP instance to another disk (a very old WD Black HDD) and adjusted the paths in the .ini files - now the update to 2.2 runs through.

So, for whatever reason, it must have been a problem with the original 1TB EVO SSD and that, although the different instances and copies certainly had different areas for the table xf_posts - nevertheless, the error always occurred exactly there, but only on that SSD. The SSD seems to be 100% in order, a large part of my daily work data is stored there and there has never been a dropout, not even now - just during the...

Triops

Well-known member
Since no suggestions came, but the error occurred 5 times reproducibly, I experimented further.

In short: it is not due to the XAMPP / PHP version, 7.2 is fine.
I finally copied the XAMPP instance to another disk (a very old WD Black HDD) and adjusted the paths in the .ini files - now the update to 2.2 runs through.

So, for whatever reason, it must have been a problem with the original 1TB EVO SSD and that, although the different instances and copies certainly had different areas for the table xf_posts - nevertheless, the error always occurred exactly there, but only on that SSD. The SSD seems to be 100% in order, a large part of my daily work data is stored there and there has never been a dropout, not even now - just during the update to Xenforo 2.2.

Maybe it will help some others who also experience the error message.
 
Solution
Top