Skip to content

Instantly share code, notes, and snippets.

@alfredbez
Last active May 28, 2020 13:26
Show Gist options
  • Save alfredbez/e03e3797d2cf73c40969b8fa452ea76a to your computer and use it in GitHub Desktop.
Save alfredbez/e03e3797d2cf73c40969b8fa452ea76a to your computer and use it in GitHub Desktop.
OXID error: Table 'oxid.oxv_oxshops_0' doesn't exist

Problem

This error is logged in oxideshop.log:

Base table or view not found: 1146 Table 'oxid.oxv_oxshops_0' doesn't exist at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:42, Doctrine\\DBAL\\Driver\\PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'oxid.oxv_oxshops_0' doesn't exist at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:80, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'oxid.oxv_oxshops_0' doesn't exist at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:75)
[stacktrace]
#0 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/Database/Adapter/Doctrine/Database.php(601): OxidEsales\\EshopCommunity\\Core\\Database\\Adapter\\Doctrine\\Database->convertException(Object(Doctrine\\DBAL\\Exception\\TableNotFoundException))
#1 /var/www/html/vendor/oxid-esales/oxideshop-ee/Core/Model/BaseModel.php(660): OxidEsales\\EshopCommunity\\Core\\Database\\Adapter\\Doctrine\\Database->select('select `oxv_oxs...', Array)
#2 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/Model/BaseModel.php(725): OxidEsales\\EshopEnterprise\\Core\\Model\\BaseModel->getRecordByQuery('select `oxv_oxs...')
#3 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/Model/BaseModel.php(677): OxidEsales\\EshopCommunity\\Core\\Model\\BaseModel->assignRecord('select `oxv_oxs...')
#4 /var/www/html/vendor/oxid-esales/oxideshop-ee/Core/Model/BaseModel.php(154): OxidEsales\\EshopCommunity\\Core\\Model\\BaseModel->load(1)
#5 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/Config.php(2017): OxidEsales\\EshopEnterprise\\Core\\Model\\BaseModel->load(1)
#6 /var/www/html/vendor/oxid-esales/oxideshop-ee/Core/Config.php(543): OxidEsales\\EshopCommunity\\Core\\Config->getActiveShop()
#7 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Application/Controller/Admin/AdminController.php(140): OxidEsales\\EshopEnterprise\\Core\\Config->getActiveShop()
#8 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Application/Controller/Admin/AdminController.php(123): OxidEsales\\EshopCommunity\\Application\\Controller\\Admin\\AdminController->_getEditShop(1)
#9 /var/www/html/vendor/oxid-esales/oxideshop-ee/Application/Controller/Admin/AdminController.php(21): OxidEsales\\EshopCommunity\\Application\\Controller\\Admin\\AdminController->__construct()
#10 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/UtilsObject.php(232): OxidEsales\\EshopEnterprise\\Application\\Controller\\Admin\\AdminController->__construct()
#11 /var/www/html/source/oxfunctions.php(103): OxidEsales\\EshopCommunity\\Core\\UtilsObject->oxNew('OxidEsales\\\\Esho...')
#12 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(385): oxNew('OxidEsales\\\\Esho...')
#13 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(277): OxidEsales\\EshopCommunity\\Core\\ShopControl->_initializeViewObject('OxidEsales\\\\Esho...', NULL, NULL, NULL)
#14 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(142): OxidEsales\\EshopCommunity\\Core\\ShopControl->_process('OxidEsales\\\\Esho...', NULL, NULL, NULL)
#15 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/Oxid.php(27): OxidEsales\\EshopCommunity\\Core\\ShopControl->start()
#16 /var/www/html/source/index.php(16): OxidEsales\\EshopCommunity\\Core\\Oxid::run()
#17 /var/www/html/source/admin/index.php(12): require_once('/var/www/html/s...')
#18 {main}
"] []

Explanation

oxshops is a multilanguage table, so you will have some views with language-suffixes like oxv_oxshops_de, oxv_oxshops_en, etc. The shop can not load the language abbreviation somehow, that's why \OxidEsales\EshopCommunity\Core\Language::getLanguageAbbr returns just 0 instead of a language-string. This looks like a bug to me btw.

The problem is most likely, that you do not have the aLanguageParams anymore in your oxconfig table.

Solution

Insert this to your db:

INSERT INTO oxconfig (OXID, OXSHOPID, OXVARNAME, OXVARTYPE, OXVARVALUE)
VALUES (
  md5(rand()),
  1, # <-- this is your shop-id
  'aLanguageParams',
  'aarr',
  ENCODE('a:1:{s:2:"de";a:3:{s:6:"baseId";i:0;s:6:"active";s:1:"1";s:4:"sort";s:1:"1";}}', 'fq45QS09_fqyx09239QQ')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment