XF 2.2 Upgrade 2.1 -> 2.2_Beta5 Databasetable "schema conflicts" and missing column

Masetrix

Well-known member
Error 1:
  • ErrorException: Renamed table xf_api_login_token to xf_api_login_token__conflict6 to avoid schema conflict
  • src/XF/Error.php:75

  • Generiert von: Admin
  • 3 September 2020 um 10:08


Stack-Trace​


#0 src/XF.php(189): XF\Error->logError()
#1 src/XF/Db/Schema/Create.php(72): XF::logError()
#2 src/XF/Db/Schema/AbstractDdl.php(147): XF\Db\Schema\Create->getQueries()
#3 src/XF/Db/SchemaManager.php(186): XF\Db\Schema\AbstractDdl->apply()
#4 src/XF/Install/InstallHelperTrait.php(680): XF\Db\SchemaManager->createTable()
#5 src/XF/Install/Upgrade/2020010-220a.php(45): XF\Install\Upgrade\AbstractUpgrade->createTable()
#6 src/XF/Install/Controller/Upgrade.php(175): XF\Install\Upgrade\Version2020010->step1()
#7 src/XF/Mvc/Dispatcher.php(350): XF\Install\Controller\Upgrade->actionRun()
#8 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass()
#9 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch()
#10 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop()
#11 src/XF/App.php(2298): XF\Mvc\Dispatcher->run()
#12 src/XF.php(464): XF\App->run()
#13 install/index.php(14): XF::runApp()
#14 {main}


Status der Anfrage​


array(4) {
["url"] => string(30) "/install/index.php?upgrade/run"
["referrer"] => string(62) "https://test.elo-forum.org/install/index.php?upgrade/"
["_GET"] => array(1) {
["upgrade/run"] => string(0) ""
}
["_POST"] => array(1) {
["_xfToken"] => string(8) "********"
}
}
Before the upgrade there was no table "xf_api_login_token" in the database, why does adding it through the upgrade cause a schema error?


Error 2:
  • ErrorException: Renamed column xf_thread.vote_score to vote_score__conflict to avoid schema conflict
  • src/XF/Error.php:75

  • Generiert von: Admin
  • 3 September 2020 um 10:13


Stack-Trace​


#0 src/XF.php(189): XF\Error->logError()
#1 src/XF/Db/Schema/Column.php(393): XF::logError()
#2 src/XF/Db/Schema/Alter.php(238): XF\Db\Schema\Column->getDefinition()
#3 src/XF/Db/Schema/AbstractDdl.php(147): XF\Db\Schema\Alter->getQueries()
#4 src/XF/Db/SchemaManager.php(149): XF\Db\Schema\AbstractDdl->apply()
#5 src/XF/Install/InstallHelperTrait.php(670): XF\Db\SchemaManager->alterTable()
#6 src/XF/Install/Upgrade/2020010-220a.php(311): XF\Install\Upgrade\AbstractUpgrade->alterTable()
#7 src/XF/Install/Controller/Upgrade.php(175): XF\Install\Upgrade\Version2020010->step13()
#8 src/XF/Mvc/Dispatcher.php(350): XF\Install\Controller\Upgrade->actionRun()
#9 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass()
#10 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch()
#11 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop()
#12 src/XF/App.php(2298): XF\Mvc\Dispatcher->run()
#13 src/XF.php(464): XF\App->run()
#14 install/index.php(14): XF::runApp()
#15 {main}


Status der Anfrage​


array(4) {
["url"] => string(30) "/install/index.php?upgrade/run"
["referrer"] => string(65) "https://test.elo-forum.org/install/index.php?upgrade/run"
["_GET"] => array(1) {
["upgrade/run"] => string(0) ""
}
["_POST"] => array(4) {
["run_version"] => string(7) "2020010"
["step"] => string(2) "13"
["position"] => string(1) "0"
["_xfToken"] => string(8) "********"
}
}
Error 2 is a bit more extensive because a column is missing in the table after the upgrade.
Here are 2 examples, 1st picture before the upgrade, and picture 2 afterwards.

Picture 1, Table: xf_thread last columns before Upgrade:
1599123603116.png



After the Upgrade, column "liamw_threadsolutions_has_solution" is missing in xf_thread, after the upgrade...
1599124990284.png

The missing column has not moved to another position in the xf_thread table, I checked that - it is completely missing.

Bug?
 
Last edited:

Mike

XenForo developer
Staff member
Given your comments, those errors would seem to indicate certain upgrade steps were run multiple times. Assuming you didn't explicitly refresh the browser during the process, this could indicate something like a PHP crash (which triggers the step again).

You may wish to try upgrading via the command line by running php cmd.php xf:upgrade from within the main XF directory.

In terms of a column going missing, this isn't something I've ever seen reported before so it's hard to suggest why it would happen. There's no reason for the code to adjust a column it has no knowledge of.
 

Masetrix

Well-known member
@Mike,

Error 2 also exists with the command line, only the details of the message are a little different

Error 1: Fixed /upgrade from commandline...

Error 2:

  • ErrorException: Renamed column xf_thread.vote_score to vote_score__conflict to avoid schema conflict
  • src/XF/Error.php:75

  • Generiert von: Unbekanntes Konto
  • 3 September 2020 um 13:37


Stack-Trace​


#0 src/XF.php(189): XF\Error->logError()
#1 src/XF/Db/Schema/Column.php(393): XF::logError()
#2 src/XF/Db/Schema/Alter.php(238): XF\Db\Schema\Column->getDefinition()
#3 src/XF/Db/Schema/AbstractDdl.php(147): XF\Db\Schema\Alter->getQueries()
#4 src/XF/Db/SchemaManager.php(149): XF\Db\Schema\AbstractDdl->apply()
#5 src/XF/Install/InstallHelperTrait.php(670): XF\Db\SchemaManager->alterTable()
#6 src/XF/Install/Upgrade/2020010-220a.php(311): XF\Install\Upgrade\AbstractUpgrade->alterTable()
#7 src/XF/Cli/Command/Upgrade.php(136): XF\Install\Upgrade\Version2020010->step13()
#8 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\Upgrade->execute()
#9 src/vendor/symfony/console/Application.php(987): Symfony\Component\Console\Command\Command->run()
#10 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand()
#11 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun()
#12 src/XF/Cli/Runner.php(76): Symfony\Component\Console\Application->run()
#13 cmd.php(15): XF\Cli\Runner->run()
#14 {main}


Status der Anfrage​


array(1) {
["cli"] => string(18) "cmd.php xf:upgrade"
}
 
Top