• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • Table 'x.xf_vw_upgradelog' doesn't exist src/XF/Db/AbstractStatement.php:228

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: Table 'x.xf_vw_upgradelog' doesn't exist src/XF/Db/AbstractStatement.php:228

    • Issue Tools
      • View Changes
    1. issueid=6197 May 1, 2021 4:10 AM
      Alfa1 Alfa1 is offline
      Distinguished Member
      Table 'x.xf_vw_upgradelog' doesn't exist src/XF/Db/AbstractStatement.php:228

      XF\Db\Exception: Batch install error: MySQL statement prepare error [1146]: Table 'x.xf_vw_upgradelog' doesn't exist src/XF/Db/AbstractStatement.php:228

      Generated by: Alfa1 May 1, 2021 at 9:05 AM

      Stack trace

      REPLACE INTO `xf_vw_upgradelog` (`upgradetype`, `version`) VALUES ('ACT','0.0.0')
      ------------

      #0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1146, '42S02')
      #1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1146, '42S02')
      #2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
      #3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
      #4 src/addons/vw/vw/_core/controller/db/xf2.php(117): XF\Db\AbstractAdapter->query('REPLACE INTO `x...')
      #5 src/addons/vw/vw/_core/model/db/mysql/vw.php(1386): vw_DB_Controller_XF2->query_write('REPLACE INTO `x...')
      #6 src/addons/vw/vw/_core/model/db/mysql/vw.php(1310): vw_DB_MySQL_Model->shutdown_or_run('REPLACE INTO `x...', false)
      #7 src/addons/vw/vw/Setup.php(876): vw_DB_MySQL_Model->replace(Array)
      #8 src/addons/vw/vw/Setup.php(925): vw\vw\Setup->vwStopProcessing(NULL)
      #9 src/XF/Job/AddOnInstallBatch.php(297): vw\vw\Setup->upgrade(Array)
      #10 src/XF/Job/AddOnInstallBatch.php(89): XF\Job\AddOnInstallBatch->stepAction(Object(XF\Timer))
      #11 src/XF/Job/Manager.php(258): XF\Job\AddOnInstallBatch->run(8)
      #12 src/XF/Job/Manager.php(200): XF\Job\Manager->runJobInternal(Array, 8)
      #13 src/XF/Job/Manager.php(116): XF\Job\Manager->runJobEntry(Array, 8)
      #14 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 8)
      #15 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
      #16 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(SV\UserMentionsImprovements\XF\Admin\Controller\To ols), NULL)
      #17 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\UserMentionsImprovements\XF\Admin\Controller\To ols), NULL)
      #18 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
      #19 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
      #20 src/XF.php(488): XF\App->run()
      #21 admin.php(13): XF::runApp('XF\\Admin\\App')
      #22 {main}

      Request state

      array(4) {
      ["url"] => string(33) "/test2-xf/admin.php?tools/run-job"
      ["referrer"] => string(61) "-xf/admin.php?tools/run-job"
      ["_GET"] => array(1) {
      ["tools/run-job"] => string(0) ""
      }
      ["_POST"] => array(3) {
      ["_xfRedirect"] => string(97) "-xf/admin.php?add-ons/install-from-archive-complete&batch_id=10"
      ["_xfToken"] => string(8) "********"
      ["only_ids"] => string(3) "160"
      }
      }
    Issue Details
    Issue Number 6197
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Install / Upgrade
    Status Fixed
    Priority 2 - Fatal / Database Errors
    Affected Version 4.1.1
    Fixed Version 4.1.1
    Milestone (none)
    Software DependencyXenForo 2.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. May 1, 2021 1:58 PM
      pegasus pegasus is offline
      VaultWiki Team
      For this to happen, it suggests that:
      1. Your database logged a completed upgrade step, but did not actually perform the same step that logs it, OR
      2. Your XenForo setting values are from a later VaultWiki version than you are running (like if you cloned a pre-4.1.1 database but then imported all setting values from when you had 4.1.1 installed), OR
      3. You are attempting to upgrade VaultWiki to 4.1.1 but VaultWiki is not actually installed (few or no tables exist), OR
      4. You already upgraded to 4.1.1 on XenForo 1.x, and you are now running the upgrade script again after having upgraded XenForo to 2.x.

      If your database error complains that x.xf_vw_upgradelog doesn't exist, run the following database queries:
      Code:
      DELETE FROM vw_patchinfo
      WHERE `version` = '4.1.1' AND
      `label` = 'x_upgradelog'
      This should rule out the first 1.

      For #2, do an admin search for "vw_version_string". It should be an option called "VaultWiki version" which, based on your database state, should be no higher in value than "4.1.0". If this says "4.1.1", and this was an upgrade from XF 1.x that was actually running 4.1.1, see below.

      For #4, a number of file edits will be needed. These are currently untested. In src/addons/vw/vw/Setup.php, find:
      Code:
      protected function vwStopProcessing(&$result)
      Replace with:
      Code:
      protected function vwStopProcessing(&$result, $preUpState = '0.0.0')
      Find:
      Code:
      		\vw_DB::get()->query()->replace(array(
      			'table' => 'vw_upgradelog',
      			'values' => array(
      				array(
      					'upgradetype' => "'ACT'",
      					\vw_DB::get()->query()->wrap('version') => "'0.0.0'"
      				)
      			)
      		));
      Replace with (probably a scrollbar here):
      Code:
      		$oldver = \vw_Hard_Core::model('Settings')->get('vw_version_string');
      
      		if (\vw_Hard_Core::model('Version')->compare($preUpState, '4.1.1') == -1)
      		{
      			\vw_Hard_Core::model('Settings')->set('vw_version_string', $preUpState);
      		}
      
      		\vw_DB::get()->query()->replace(array(
      			'table' => 'vw_upgradelog',
      			'values' => array(
      				array(
      					'upgradetype' => "'ACT'",
      					\vw_DB::get()->query()->wrap('version') => "'0.0.0'"
      				)
      			)
      		));
      
      		\vw_Hard_Core::model('Settings')->set('vw_version_string', $oldver);
      Find:
      Code:
      if (!isset($version['X2']))
      BEFORE it, add:
      Code:
      $last = '0.0.0';
      Find (2x):
      Code:
      if ($this->vwStopProcessing($result))
      Replace with (2x):
      Code:
      if ($this->vwStopProcessing($result, $last))
      More information about how this database was made would be helpful.
      Reply Reply  
    2. May 1, 2021 2:47 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      What I did was: upgrade a XF1.5 install to XF2.2 using CLI. (addons all disabled)
      Then I upgraded VW 4.1.1 PL1 for xf1 to 4.1.1 PL3 for XF2 using the XF2 addon installer. This failed with the above error. When I retry I get the following warning:
      This add-on contains 36 files which have unexpected contents.
      If I ignore that then I get the same error.

      I've just ran the query and there were 0 rows affected.
      An admin search for vw_version_string only results in the related phrases.
      Reply Reply  
    3. May 1, 2021 3:56 PM
      pegasus pegasus is offline
      VaultWiki Team
      Please see situation #4 in the post above.
      Reply Reply  
    4. May 2, 2021 1:56 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      This allowed me to start the upgrade, but 23 hours later the upgrade is still running. I'm doubtful its leading anywhere.
      What I find odd is that XF lists that there are 36 VW files that do not have expected contents and its contents are now different than when the package was uploaded.
      Reply Reply  
    5. May 3, 2021 12:55 AM
      pegasus pegasus is offline
      VaultWiki Team
      It is possible you somehow got stuck in an infinite loop. At this point I would ask you to exit the upgrade and submit a ticket. But do not roll back. We can start it where it left off once we check on its status.
      Reply Reply  
    6. August 8, 2021 3:51 PM
      pegasus pegasus is offline
      VaultWiki Team
      Another user was able to supply the information needed to diagnose the infinite loop.

      This occurs when the forum had VaultWiki 4.1.1 on XenForo 1.x already, upgrades to XenForo 2.x, then upgrades VaultWiki to the XenForo 2.x version. It occurs due to a difference in naming conventions between some database tables starting at 4.1.1 depending on the forum platform. When selecting which naming convention to use, simply checking the version number was not enough. We also needed to check the last recorded platform version. Due to the difference in naming convention, while in the in-between 1.x/2.x state, VaultWiki was unable to find its upgrade log records, so because it didn't know what step it was at, it kept running step 1 of the XF 1.x -> XF 2.x pre-upgrade preparation steps repeatedly.

      This correction has been applied to the July patches for 4.1.1 and 4.1.2 respectively. The patch now checks both the VW version and the last known platform version when determining the location of the upgrade log.
      Reply Reply  
    7. September 23, 2021 12:12 PM
      Forsaken Forsaken is offline
      Junior Member
      I'm getting something I'm assuming that is related to the fix of this issue:

      Code:
      #0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL statement...', 1146, '42S02')
      #1 src/XF/Db/Mysqli/Statement.php(41): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1146, '42S02')
      #2 src/XF/Db/Mysqli/Statement.php(56): XF\Db\Mysqli\Statement->prepare()
      #3 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
      #4 src/addons/vw/vw/_core/controller/db/xf2.php(117): XF\Db\AbstractAdapter->query('REPLACE INTO `v...')
      #5 src/addons/vw/vw/_core/model/db/mysql/vw.php(1386): vw_DB_Controller_XF2->query_write('REPLACE INTO `v...')
      #6 src/addons/vw/vw/_core/model/db/mysql/vw.php(1310): vw_DB_MySQL_Model->shutdown_or_run('REPLACE INTO `v...', false)
      #7 src/addons/vw/vw/Setup.php(891): vw_DB_MySQL_Model->replace(Array)
      #8 src/addons/vw/vw/Setup.php(991): vw\vw\Setup->vwStopProcessing(NULL, '0.0.0')
      #9 src/XF/Job/AddOnInstallBatch.php(299): vw\vw\Setup->upgrade(Array)
      #10 src/XF/Job/AddOnInstallBatch.php(91): XF\Job\AddOnInstallBatch->stepAction(Object(XF\Timer))
      #11 src/XF/Job/Manager.php(260): XF\Job\AddOnInstallBatch->run(8)
      #12 src/addons/Hampel/JobRunner/XF/Job/Manager.php(87): XF\Job\Manager->runJobInternal(Array, 8)
      #13 src/XF/Job/Manager.php(202): Hampel\JobRunner\XF\Job\Manager->runJobInternal(Array, 8)
      #14 src/addons/Hampel/JobRunner/XF/Job/Manager.php(80): XF\Job\Manager->runJobEntry(Array, 8)
      #15 src/XF/Job/Manager.php(118): Hampel\JobRunner\XF\Job\Manager->runJobEntry(Array, 8)
      #16 src/XF/Admin/Controller/Tools.php(122): XF\Job\Manager->runByIds(Array, 8)
      #17 src/XF/Mvc/Dispatcher.php(352): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
      #18 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(NF\Discord\XF\Admin\Controller\Tools), NULL)
      #19 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(NF\Discord\XF\Admin\Controller\Tools), NULL)
      #20 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
      #21 src/XF/App.php(2345): XF\Mvc\Dispatcher->run()
      #22 src/XF.php(512): XF\App->run()
      #23 admin.php(13): XF::runApp('XF\\Admin\\App')
      #24 {main}
      My table is xf_vw_upgradelog.
      Reply Reply  
    8. September 23, 2021 12:38 PM
      pegasus pegasus is offline
      VaultWiki Team
      I think that would occur if you have completed upgrading to 4.1.1 without it logging that you finished upgrading to 4.1.1. I am not sure how that would happen. Do you know what version you originally installed?

      I believe if you originally installed version 4.1.1 or later, this situation is also possible. In src/addons/vw/vw/Setup.php, find:
      Code:
      if ($version AND !isset($version['F']))
      BEFORE it, add:
      Code:
      		if (
      			$version AND
      			!isset($version['X2']) AND
      			\vw_Hard_Core::model('DB')->prefix('vw_upgradelog') == 'xf_vw_upgradelog'
      			// must have been a fresh install
      		)
      		{
      			$version['X2'] = '4.1.1';
      			$version['steps']['X2'] = array(0, 0);
      
      			$log[] = array(
      				'upgradetype' => "'X2'",
      				'version' => "'4.1.1'",
      				'step' => 0,
      				'offset' => 0
      			);
      		}
      This should detect this situation (X2 not having a value even though the table name was already in the X2 format) and adjust the log entries as necessary.
      Reply Reply  
    9. September 23, 2021 6:34 PM
      Forsaken Forsaken is offline
      Junior Member
      Quote Originally Posted by pegasus
      I think that would occur if you have completed upgrading to 4.1.1 without it logging that you finished upgrading to 4.1.1. I am not sure how that would happen. Do you know what version you originally installed?

      I believe if you originally installed version 4.1.1 or later, this situation is possible. In src/addons/vw/vw/Setup.php, find:
      Code:
      if ($version AND !isset($version['F']))
      BEFORE it, add:
      Code:
      		if (
      			$version AND
      			!isset($version['X2']) AND
      			\vw_Hard_Core::model('DB')->prefix('vw_upgradelog') == 'xf_vw_upgradelog'
      			// must have been a fresh install
      		)
      		{
      			$version['X2'] = '4.1.1';
      			$version['steps']['X2'] = array(0, 0);
      
      			$log[] = array(
      				'upgradetype' => "'X2'",
      				'version' => "'4.1.1'",
      				'step' => 0,
      				'offset' => 0
      			);
      		}
      This should detect this situation (X2 not having a value even though the table name was already in the X2 format) and adjust the log entries as necessary.
      That fixed the issue.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 7:54 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.