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

New Setup System #673

Closed
tzyganu opened this issue Sep 23, 2014 · 26 comments
Closed

New Setup System #673

tzyganu opened this issue Sep 23, 2014 · 26 comments
Assignees

Comments

@tzyganu
Copy link
Contributor

tzyganu commented Sep 23, 2014

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:

  • The setup page is still accessible after installing Magento
  • If the setup is a kind of a "standalone" application is there any need for the Magento_Install module?
  • If I install Magento 2 over an existing database (sample data) that already contains some records in the authorization_role table (old admin_role table), where the role_name Administrators has an other id beside 1 I cannot login in the backend because the parent role is hardcoded in Magento\Setup\Model\AdminAccount.
  • Is there really a need to run the data updates with the exec command? It seams to me like it introduces an unnecessary dependency. Some servers may not allow this. If it's necessary, maybe a check should be made and notify the user that the server does not allow exec.
  • The install log file is named install.log. I think it's better to have a unique name. If I run 2 install processes on the same machine at the same time the file is locked by the first install and I cannot see the progress on my second install. I know this is a rare case, but still....
@verklov verklov self-assigned this Sep 29, 2014
@verklov
Copy link
Contributor

verklov commented Sep 29, 2014

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

@peterjaap
Copy link
Contributor

A few extra points;

  • For language, it says 'United State'. First of all, this should be 'United States' and second of all, 'United States' is not a language, it's a country. It should read 'English (United States)' or similar.
  • When using a quite long domain for the Magento installation, the input field for the Admin Address pretty much disappears (see screenshot).
    screenshot 2014-10-02 10 39 32
  • It is not possible to check the checkbox to install Sample Data (it is disabled - why?).

@peterjaap
Copy link
Contributor

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
Copy link
Contributor Author

tzyganu commented Oct 2, 2014

@peterjaap If you are patient enough you will see it go up to 166% 😄 .
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
Copy link
Contributor

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 

@tanya-soroka tanya-soroka assigned tanya-soroka and unassigned verklov Oct 2, 2014
@antonmakarenko
Copy link

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
Copy link

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
Copy link

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
Copy link
Contributor

@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
Copy link

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
Copy link

@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
Copy link

@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
Copy link
Contributor Author

tzyganu commented Oct 6, 2014

@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
Copy link

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
Copy link
Contributor

Den4ik commented Oct 11, 2014

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

magento-team added a commit that referenced this issue Oct 13, 2014
* Released Performance Toolkit
 * GitHub requests:
   * [#665](#665) -- Main menu event in wrong area
   * [#666](#666) -- Update di.xml
   * [#602](#602) -- Magento\Sales\Model\Order::getFullTaxInfo() incorrectly combines percentages
   * [#673](#673) -- Fixed fatal error during installation
 * Functional tests:
   * Updated API-functional test for Customer and Address metadata service
   * Add cross sell
   * Add a product to wishlist
   * Add up sell
   * Checkout with gift messages
   * Create an order from a customer
   * Create a shipment for offline payment methods
   * Delete a product from mini shopping cart
   * Reorder
   * Sales order report
   * Updating URL rewrites from a category page
 * Layout updates:
   * Moved layout files to the page_layout directory
   * Moved layout validation files to framework
 * Theme updates:
   * Blank Theme layouts & templates were unified
 * Search Library:
   * Added ability to aggregate queries for MySQL adapter
   * Implemented automatic range aggregation for MySQL adapter
 * Search module:
   * Introduced the Search module
   * Moved autocomplete to the Search module
   * Added base UI to the Search module
 * Documentation:
   * Added basic description of modules in the README.md files
 * Modularity:
   * Created API and script to get module and dependency information
 * Framework Improvements:
   * Decomposed heavy objects basing on profiling results
   * Refactored the getCustomAttributesCodes method in ProductService
   * Refactored Customer Model to use Group Model instead of Group Service
   * Updated Travis configuration to run "composer install"
 * Performance improvements:
   * Removed unnecessary "save order" call during order submission step
 * Fixed missing installation features of the new setup:
   * Added missing installation parameters: admin_no_form_key, order_increment_prefix, cleanup_database
   * Fixed the link to the license agreement in web installer
   * Fixed the web installation wizard which was stuck at 96%
 * Fixed bugs:
   * Fixed an issue where newly created attribute was always added to the Product Details tab
   * Fixed an issue where it was impossible to change the Stock Availability status of a product from the Advanced Inventory tab
   * Fixed an issue where the Stock Status value changed from In Stock to Out of Stock if quantity was not specified
   * Fixed an issue where performance toolkit failed in case of unknown argument
   * Fixed an issue where 404 error page was displayed instead of the URL Rewrite Information page
   * Fixed an issue where the Click for price link was not working if a product name contained quote mark
   * Fixed an issue where the Compare products link disappeared after switching to other page
   * Fixed an issue where the custom logo was not displayed on the category page
   * Fixed an XSS vulnerability in category name
   * Fixed an issue where a success save message was not displayed after saving a Search term
   * Fixed an issue with Google Analytics where it was impossible to add the code to the pages
   * Fixed an issue where import custom options grid was not displayed on the product creation page
   * Fixed an issue where it was impossible to retrieve a product collection from category in the "adminhtml" area
   * Fixed an issue where product attributes were absent on product creation form after switching to another product template
   * Fixed an issue where the 'URL key for specified store already exists.' error message was displayed when saving a configurable product with variations which have the same name
   * Fixed an issue where search in the Search Terms Report grid did not work
   * Fixed an issue where the unnecessary tab "General" was displayed on the Category page in the Admin panel
   * Fixed an issue where the Stock Status value changed from In Stock to Out of Stock if quantity was not specified for a configurable product when saving to a new template
   * Fixed an issue where product Stock Status was always set to 'In Stock' if product quantity was specified
   * Fixed an IE specific issue where for bundle products the Manage Stock option was reset to Yes
   * Fixed an issue where backorder messages were not displayed
   * Fixed an issue where the Price field was always required during Bundle product update using ProductService
   * Fixed an issue where product name was missing in the error message
   * Fixed an issue where configurable product did not contain a message to select options while adding product from wishlist to shopping cart
   * Fixed an issue where the Validate VAT Number button did not work during order creation in the Admin panel
   * Fixed an issue where Item qty in Wishlist got reset after update without changes
   * Fixed an issue where invoice amount was incorrect when items with discount were partially invoiced
   * Fixed product thumbnails alignment in the storefront
   * Fixed an issue where inactive Categories were not greyed out in the tree in the Admin panel
   * Fixed an issue where it was impossible to disable debug mode
   * Fixed the code sample in the index.php file
   * Removed language selector in the setup UI
   * Fixed an issue where setup was broken if db_prefix was used
   * Implemented usage of Symfony's PHPExecutableFinder for executing CLI tools
   * Fixed an issue with the Import/Export functionality
   * Fixed an issue with catalog product/category and category/product indexers invalidation after import
   * Fixed an issue with entering invalid date in the Product Views Report
   * Fixed an issue where it was impossible to view orders for customers from a deleted customer group
   * Fixed an issue where a duplicate customer record was created after adding an order from the Admin panel
   * Fixed an issue where it was impossible to log in to the Admin panel from the first attempt
@verklov
Copy link
Contributor

verklov commented Oct 14, 2014

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

@van-gog
Copy link

van-gog commented Oct 20, 2014

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
Copy link
Contributor

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

@van-gog
Copy link

van-gog commented Oct 20, 2014

@mazhalai this helped. Thanks

@tanya-soroka
Copy link

@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
Copy link
Contributor Author

tzyganu commented Nov 11, 2014

@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.

@maksek maksek added the PS label Nov 12, 2014
@Morgon
Copy link

Morgon commented Nov 18, 2014

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
Copy link
Contributor

@Morgon , last steps now are:

  • Installing data fixtures
  • Creating sales order increment prefix (if you used it)
  • Installing admin user
  • Enabling caches
  • Disabling Maintenance Mode
  • Post installation file permissions check (suggests to remove write permissions to app/etc directory)

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
Copy link

muasir commented Jan 23, 2015

@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.

@muasir muasir closed this as completed Jan 23, 2015
@tzyganu
Copy link
Contributor Author

tzyganu commented Jan 24, 2015

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

magento-team pushed a commit that referenced this issue Oct 21, 2015
[Merchant beta][Nord]Bug fixes
@Janesmith03
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests