magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

New Setup System #673

Closed tzyganu closed 9 years ago

tzyganu commented 10 years ago

I know that the setup system available since alpha 96 is just at the beginning and you already know some issues about it but I thought to add some in here:

verklov commented 10 years ago

@tzyganu, thanks for this bunch of comments and questions! We will have them reviewed and provide you with the feedback.

peterjaap commented 10 years ago

A few extra points;

peterjaap commented 10 years ago

Also, the installer is extremely slow, it appears it is hanging. It's stuck on 5%; screenshot 2014-10-02 11 08 16

It's not really stuck since in my process list I see different queries from time to time. It's been hanging at 5% for well over 10 minutes now, but the query has only been running for 117 seconds, so it appears it is edging forwards but very slowly. The full query is;

| Id     | User      | Host            | db                 | Command | Time | State | Info                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
+--------+-----------+-----------------+--------------------+---------+------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 572272 | peterjaap | localhost       | peterjaap_magento2 | Query   |  117 | NULL  | SELECT `T`.`TABLE_NAME`, `TC`.`CONSTRAINT_NAME`, `TC`.`CONSTRAINT_TYPE`, `KCU`.`COLUMN_NAME`, `RC`.`MATCH_OPTION`, `RC`.`UPDATE_RULE`, `RC`.`DELETE_RULE`, `KCU`.`REFERENCED_TABLE_SCHEMA`, `KCU`.`REFERENCED_TABLE_NAME`, `KCU`.`REFERENCED_COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`TABLES` T INNER JOIN `INFORMATION_SCHEMA`.`TABLE_CONSTRAINTS` TC ON `T`.`TABLE_SCHEMA`  = `TC`.`TABLE_SCHEMA` AND `T`.`TABLE_NAME`  = `TC`.`TABLE_NAME` LEFT JOIN `INFORMATION_SCHEMA`.`KEY_COLUMN_USAGE` KCU ON `TC`.`TABLE_SCHEMA`  = `KCU`.`TABLE_SCHEMA` AND `TC`.`TABLE_NAME`  = `KCU`.`TABLE_NAME` AND `TC`.`CONSTRAINT_NAME`  = `KCU`.`CONSTRAINT_NAME` LEFT JOIN `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS` RC ON `TC`.`CONSTRAINT_SCHEMA`  = `RC`.`CONSTRAINT_SCHEMA` AND `TC`.`CONSTRAINT_NAME`  = `RC`.`CONSTRAINT_NAME` WHERE `T`.`TABLE_NAME` = 'core_translate' AND `T`.`TABLE_TYPE` IN ('BASE TABLE', 'VIEW') AND `T`.`TABLE_SCHEMA` = 'peterjaap_magento2' ORDER BY CASE `TC`.`CONSTRAINT_TYPE` WHEN 'PRIMARY KEY' THEN 1 WHEN 'UNIQUE' THEN 2 WHEN 'FOREIGN KEY' THEN 3 ELSE 4 END, `TC`.`CONSTRAINT_NAME`, `KCU`.`ORDINAL_POSITION` |

My colleague is trying an install on a different machine and his install is progressing slowly. He's at 7% after 20 minutes, mine is still stuck at 5%.

Real time update; finally at 6% \o/

tzyganu commented 10 years ago

@peterjaap If you are patient enough you will see it go up to 166% :smile: . I'm not kidding, this actually happened to me. I think it's because there are extra lines added to the install log and the percentage is based on the number of lines in the log.

peterjaap commented 10 years ago

Weird. It just fell back to 4%;

Starting Magento installation: 
File permissions check... 
Installing deployment configuration... 
Installing database schema: 
Schema creation/updates: 
Module 'Magento_Core': 
Include /home/peterjaap/magento/magento2/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php 
antonmakarenko commented 10 years ago

Thanks everyone for the detailed reports. We addressed some of the issues you mentioned and fixed them already, but they will be rolled out later with one of the next releases.

@tzyganu

The setup page is still accessible after installing Magento

We are aware of this issue. Also nothing prevents running several installation processes at the same time, which will lead to unexpected outcome. We intend to fix it by implementing some sort of locking/transaction of installation process.

If the setup is a kind of a "standalone" application is there any need for the Magento_Install module?

Once the new Setup application has all the features as the former Magento_Install module, we'll delete the latter and all its related code from Magento application.

If I install Magento 2 over an existing database (sample data) that already contains some records in the authorization_role table...

We have fixed it already

Is there really a need to run the data updates with the exec command? It seams to me like it introduces an unnecessary dependency.

Data "fixture" updates require a full-blown Magento application. For now the simplest solution to isolate it from Magento setup application is to run exec. We'll consider other implementation after refactoring the rest of installation logic (see note about Magento_Install above)

The install log file is named install.log. I think it's better to have a unique name.

As I said above, we'll revisit it during implementation of the "transaction"

@peterjaap

For language, it says 'United State'.

For now, we removed the language selector and dictionaries. It is not implemented yet. But thanks for pointing out.

When using a quite long domain for the Magento installation, the input field for the Admin Address pretty much disappears (see screenshot).

Noted for the Install Wizard UX work

Also, the installer is extremely slow, it appears it is hanging. It's stuck on 5%;

We are aware of the issue and working on the fix. To mitigate, try increasing memory limits in your MySQL server to these values or greater:

innodb_buffer_pool_size=800M
innodb_log_file_size=300M

@tzyganu

If you are patient enough you will see it go up to 166%

Fixed already (will be published soon)

WouterSteen commented 10 years ago

Last night I let the installer run. Last thing I see in the console is: php -f magento2/dev/shell/run_data_fixtures.php 2>&1

Then it crashes with this error: [ERROR] exception 'Exception' with message 'exec() returned error [255] PHP Fatal error: Call to a member function addStreamLog() on a non-object in /home/wouter/magento2/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php on line 682' in /home/wouter/magento2/setup/module/Magento/Setup/src/Model/Installer.php:230 Stack trace:

0 /home/wouter/magento2/setup/module/Magento/Setup/src/Model/Installer.php(146): Magento\Setup\Model\Installer->installDataFixtures()

1 /home/wouter/magento2/setup/module/Magento/Setup/src/Controller/Install/StartController.php(93): Magento\Setup\Model\Installer->install(Array)

2 /home/wouter/magento2/setup/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(83): Magento\Setup\Controller\Install\StartController->indexAction()

3 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))

4 /home/wouter/magento2/setup/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))

5 /home/wouter/magento2/setup/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

6 /home/wouter/magento2/setup/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(117): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

7 /home/wouter/magento2/setup/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))

8 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))

9 /home/wouter/magento2/setup/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))

10 /home/wouter/magento2/setup/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

11 /home/wouter/magento2/setup/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(313): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

12 /home/wouter/magento2/setup/index.php(61): Zend\Mvc\Application->run()

13 {main}

WouterSteen commented 10 years ago

So I ran this command in the console again: php -f magento2/dev/shell/run_data_fixtures.php 2>&1 Without a error message.

When I hit try again, the installer is insta ready and the installation is a succes :)

peterjaap commented 10 years ago

@antonmakarenko my innodb settings were;

innodb_buffer_pool_size = 2G innodb_log_file_size = 512M innodb_read_io_threads=64 innodb_write_io_threads=64 innodb_additional_mem_pool_size = 256M innodb_io_capacity=5000 innodb_thread_concurrency=0 tmp_table_size = 256M max_heap_table_size = 64M key_buffer_size = 64M read_buffer_size = 128M

So the workaround to increase this doesn't work.

melvyn-sopacua commented 10 years ago

These MySQL settings are relative. Advising them to a fixed value has no upside. The innodb_buffer_pool_size should be at least as large as the sum of all database tables and indexes. If /not/ using innodb_file_per_table this would be the size of the ibdata* files in the MySQL storage directory (/var/lib/mysql on linuces). Otherwise, this information can be obtained by querying the information_schema database. Tools like mysqltuner.pl or tuning-primer can simplify this task.

antonmakarenko commented 10 years ago

@WouterSteen

PHP Fatal error: Call to a member function addStreamLog() on a non-object in ...

We have reproduced this error and working on a fix. Thanks for reporting.

antonmakarenko commented 10 years ago

@peterjaap

On my dev machine the full install takes ~5 minutes. I'm not sure what other settings can help, so here is the full list of settings in my.ini:

max_connections=100
query_cache_size=0
table_cache=256
tmp_table_size=205M
thread_cache_size=8
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=410M
key_buffer_size=36M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_additional_mem_pool_size=27M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=14M
innodb_buffer_pool_size=800M
innodb_log_file_size=300M
innodb_thread_concurrency=10

After we fix the performance issue with adapters, we expect installation to perform similar to Magento 1 (which was around 30 seconds).

tzyganu commented 10 years ago

@antonmakarenko The 166% hasn't bee fixed in alpha98 either.
Here is a screenshot from my install : 166 The last line in the log at that moment was PHP_PATH/php -f MAGENTO_ROOT/dev/shell/run_data_fixtures.php 2>&1

antonmakarenko commented 10 years ago

Hi @tzyganu The changeset with latest fixes of Setup application is still in the queue to our mainline repo. Most likely it will get into the next release (alpha99)

Den4ik commented 10 years ago

I think it would be better to get site url on Web Configuration step instead using 'http://example.com/'

verklov commented 10 years ago

Issue referenced in the changelog by mistake instead of internally fixed bug. The team is in progress on this one.

van-gog commented 10 years ago

During installation, when magento trying to install data fixtures, I'm getting this errors:

PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class Magento\Store\Model\StoreManagerInterface does not exist' in /var/www/mage2/lib/internal/Magento/Framework/Code/Reader/ClassReader.php:47
Stack trace:
#0 /var/www/mage2/lib/internal/Magento/Framework/Code/Reader/ClassReader.php(47): ReflectionParameter->getClass()
#1 /var/www/mage2/lib/internal/Magento/Framework/ObjectManager/Definition/Runtime.php(62): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Store\\M...')
#2 /var/www/mage2/lib/internal/Magento/Framework/ObjectManager/Factory/Factory.php(186): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\\Store\\M...')
#3 /var/www/mage2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(74): Magento\Framework\ObjectManager\Factory\Factory->create('Magento\\Store\\M...', Array)
#4 /var/www/mage2/var/generation/Magento/Store/ in /var/www/mage2/lib/internal/Magento/Framework/Module/Setup.php on line 498
mazhalai commented 10 years ago

@van-gog Please clear your var/generation directory and try again.

van-gog commented 10 years ago

@mazhalai this helped. Thanks

tanya-soroka commented 10 years ago

@tzyganu, may I ask you to provide a real use-case of having ability to run 2 install processes on the same machine at the same time? It will helps us to understand if we should block or allow this ability. Thank you in advance.

tzyganu commented 10 years ago

@tanya-soroka Sure. Here is one scenario. It is not very probable but it's possible.
If a company uses the same same machine as a staging server for multiple projects (and this is very likely) and 2 projects start at about the same time (this is not very likely but could happen) and the devs install Magento on staging at about the same time ... see where I'm going with this?.
I know I have a better chance of winning the lottery than this happening, but it's better to be safe than sorry.

Morgon commented 10 years ago

As far as the 'exec' goes, what else is setup is supposed to do after installing the fixtures? I ran the install line manually, then realized the store had to be taken out of Maintenance mode. Fixtures are 88/93 steps. If Maintenance is one step, what are the last four items?

The exec should definitely be addressed and the install made to be more flexible. For example, check for exec() first, and if not, provide the user with additional CLI commands. composer is already a requirement, so it's not like they won't already be on the command line.

buskamuza commented 9 years ago

@Morgon , last steps now are:

You can find list of all steps in the installation model - https://github.com/magento/magento2/blob/master/setup/module/Magento/Setup/src/Model/Installer.php#L235, they are declared first end then executed one by one (you can approximately find last steps, while real number depends on number of install scripts)

muasir commented 9 years ago

@tzyganu we have fixed most of the issues listed in this post. I am closing this issue, as fixed. Feel free to open new issue if we missed anything.

tzyganu commented 9 years ago

@muasir everything seams to work now. Thank the team from me for the great job.

Janesmith03 commented 4 months ago

The issues you’ve mentioned about the Magento 2 setup, such as the accessible setup page post-installation and the use of hardcoded values in setup models, are crucial points that need addressing to ensure a secure and efficient Magento 2 installation. It's important to follow best practices for a secure and optimized Magento 2 setup. For step-by-step instructions and solutions to common setup challenges, you might want to explore detailed Magento 2 setup guides available online.