Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento 2.0.x and 2.1.x does not respect table prefix during installation #5688

Closed
stamster opened this issue Jul 18, 2016 · 5 comments
Closed
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@stamster
Copy link

Steps to reproduce

  1. Install Magento from official 2.1.0.tar.gz archive here on GitHub.
  2. Fill out DB settings as ususal, alongside with table prefix (i.e. 'my_')
  3. Begin installation procedure

Expected result

Installation finished w/o any errors.

Actual result

Installation is incomplete.
Check the console log for errors before trying again

Magento fails with [ERROR] exception 'PDOException'!

So Magento fails here big time with NOT respecting table prefix entered during installation, instead it CHECKS for actual data from old installation with DIFFERENT table prefix?! It even checks entire database for each table like admin_user table which does not have any prefix and complains that email is already taken etc if you really don't have any table prefix.

TABLES CREATED DURING INSTALLATION: van_cache, van_cache_tag, van_flag, van_session, van_setup_module, van_store_website and after this it just fails.

How in the world this is possible, or is it a new requirement for M2 to have empty database, i.e. table prefixes are not supported any more?

This is issue is present from v.2.0.4+ as I experienced it multiple times.

Here's a full stack trace.

Installation is incomplete.
Check the console log for errors before trying again. 



Starting Magento installation:
File permissions check...

Required extensions check...

Enabling Maintenance Mode...

Installing deployment configuration...

Installing database schema:
Schema creation/updates:
Module 'Magento_Store':
Installing schema...
[ERROR] exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table `mage21`.`van_store_group` (errno: 121 "Duplicate key on write or update")' in /var/www/html/m21vanilla/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/html/m21vanilla/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/html/m21vanilla/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/html/m21vanilla/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#3 /var/www/html/m21vanilla/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /var/www/html/m21vanilla/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE IF...', Array)
#5 /var/www/html/m21vanilla/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(452): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE IF...', Array)
#6 /var/www/html/m21vanilla/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(507): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('CREATE TABLE IF...', Array)
#7 /var/www/html/m21vanilla/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(1993): Magento\Framework\DB\Adapter\Pdo\Mysql->query('CREATE TABLE IF...')
#8 /var/www/html/m21vanilla/app/code/Magento/Store/Setup/InstallSchema.php(159): Magento\Framework\DB\Adapter\Pdo\Mysql->createTable(Object(Magento\Framework\DB\Ddl\Table))
#9 /var/www/html/m21vanilla/setup/src/Magento/Setup/Model/Installer.php(843): Magento\Store\Setup\InstallSchema->install(Object(Magento\Setup\Module\Setup), Object(Magento\Setup\Model\ModuleContext))
#10 /var/www/html/m21vanilla/setup/src/Magento/Setup/Model/Installer.php(779): Magento\Setup\Model\Installer->handleDBSchemaData(Object(Magento\Setup\Module\Setup), 'schema')
#11 [internal function]: Magento\Setup\Model\Installer->installSchema()
#12 /var/www/html/m21vanilla/setup/src/Magento/Setup/Model/Installer.php(344): call_user_func_array(Array, Array)
#13 /var/www/html/m21vanilla/setup/src/Magento/Setup/Controller/Install.php(109): Magento\Setup\Model\Installer->install(Array)
#14 /var/www/html/m21vanilla/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\Install->startAction()
#15 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /var/www/html/m21vanilla/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#17 /var/www/html/m21vanilla/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /var/www/html/m21vanilla/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /var/www/html/m21vanilla/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#20 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#21 /var/www/html/m21vanilla/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#22 /var/www/html/m21vanilla/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#23 /var/www/html/m21vanilla/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#24 /var/www/html/m21vanilla/setup/index.php(31): Zend\Mvc\Application->run()
#25 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table `mage21`.`van_store_group` (errno: 121 "Duplicate key on write or update"), query was: CREATE TABLE IF NOT EXISTS `van_store_group` (
`group_id` smallint UNSIGNED NOT NULL auto_increment COMMENT 'Group Id' ,
`website_id` smallint UNSIGNED NOT NULL default '0' COMMENT 'Website Id' ,
`name` varchar(255) NOT NULL COMMENT 'Store Group Name' ,
`root_category_id` int UNSIGNED NOT NULL default '0' COMMENT 'Root Category Id' ,
`default_store_id` smallint UNSIGNED NOT NULL default '0' COMMENT 'Default Store Id' ,
PRIMARY KEY (`group_id`),
INDEX `STORE_GROUP_WEBSITE_ID` (`website_id`),
INDEX `STORE_GROUP_DEFAULT_STORE_ID` (`default_store_id`),
CONSTRAINT `STORE_GROUP_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `van_store_website` (`website_id`) ON DELETE CASCADE
) COMMENT='Store Groups' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci' in /var/www/html/m21vanilla/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235
Stack trace:
#0 /var/www/html/m21vanilla/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/m21vanilla/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#2 /var/www/html/m21vanilla/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/html/m21vanilla/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE IF...', Array)
#4 /var/www/html/m21vanilla/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(452): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE IF...', Array)
#5 /var/www/html/m21vanilla/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(507): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('CREATE TABLE IF...', Array)
#6 /var/www/html/m21vanilla/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(1993): Magento\Framework\DB\Adapter\Pdo\Mysql->query('CREATE TABLE IF...')
#7 /var/www/html/m21vanilla/app/code/Magento/Store/Setup/InstallSchema.php(159): Magento\Framework\DB\Adapter\Pdo\Mysql->createTable(Object(Magento\Framework\DB\Ddl\Table))
#8 /var/www/html/m21vanilla/setup/src/Magento/Setup/Model/Installer.php(843): Magento\Store\Setup\InstallSchema->install(Object(Magento\Setup\Module\Setup), Object(Magento\Setup\Model\ModuleContext))
#9 /var/www/html/m21vanilla/setup/src/Magento/Setup/Model/Installer.php(779): Magento\Setup\Model\Installer->handleDBSchemaData(Object(Magento\Setup\Module\Setup), 'schema')
#10 [internal function]: Magento\Setup\Model\Installer->installSchema()
#11 /var/www/html/m21vanilla/setup/src/Magento/Setup/Model/Installer.php(344): call_user_func_array(Array, Array)
#12 /var/www/html/m21vanilla/setup/src/Magento/Setup/Controller/Install.php(109): Magento\Setup\Model\Installer->install(Array)
#13 /var/www/html/m21vanilla/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\Install->startAction()
#14 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#15 /var/www/html/m21vanilla/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#16 /var/www/html/m21vanilla/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#17 /var/www/html/m21vanilla/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /var/www/html/m21vanilla/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#19 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#20 /var/www/html/m21vanilla/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#21 /var/www/html/m21vanilla/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#22 /var/www/html/m21vanilla/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#23 /var/www/html/m21vanilla/setup/index.php(31): Zend\Mvc\Application->run()
#24 {main}
@stamster stamster changed the title Magento 2.1.0 does not respect table prefix during installation Magento 2.0.x and 2.1.x does not respect table prefix during installation Jul 18, 2016
@stamster
Copy link
Author

At least someone to confirm this issue?!
It's very easy to reproduce.

@stamster
Copy link
Author

Thanks @andimov !

@katmoon
Copy link
Contributor

katmoon commented Aug 29, 2016

Hi @stamster

Thanks for reporting it!
I've logged it internally as MAGETWO-57755

Thanks,
Kateryna.

@katmoon katmoon added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Aug 29, 2016
mmansoor-magento pushed a commit that referenced this issue Sep 13, 2016
mmansoor-magento pushed a commit that referenced this issue Sep 13, 2016
Bug fixes:
* MAGETWO-57755: [GITHUB] Magento 2.0.x and 2.1.x does not respect table prefix during installation #5688
* MAGETWO-58081: [GitHub] Magento2 SSL Installation httpss:// #6262
* MAGETWO-57743: Fix Catalog integration tests on Travis CI
@katmoon
Copy link
Contributor

katmoon commented Sep 13, 2016

The issue has been resolved.
@stamster, thanks one more time for reporting it.

@katmoon katmoon closed this as completed Sep 13, 2016
@stamster
Copy link
Author

@katmoon You're welcome, I'm glad that it is fixed.

okorshenko pushed a commit that referenced this issue Dec 14, 2016
… respect table prefix during installation #5688 - for 2.0
okorshenko pushed a commit that referenced this issue Dec 14, 2016
… respect table prefix during installation #5688 - for 2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

3 participants