magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Unable to install magento2 after taking the latest code from github

Open sakashNeev opened this issue 12 years ago • 31 comments

When I check my apache error log. It gives me the following error:-

PHP Fatal error: Class 'Zend\Mvc\Service\ServiceManagerConfig' not found in /var/www/magento2/setup/index.php on line 32

sakashNeev avatar Sep 16 '14 11:09 sakashNeev

Get latest code and try again to install.

hafeez3000 avatar Sep 16 '14 11:09 hafeez3000

Tried with the fresh code the problem still persists:-

[Tue Sep 16 18:05:40 2014] [error] [client 127.0.0.1] PHP Warning: include(vendor/autoload.php): failed to open stream: No such file or directory in /var/www/magento2/setup/index.php on line 25 [Tue Sep 16 18:05:40 2014] [error] [client 127.0.0.1] PHP Warning: include(): Failed opening 'vendor/autoload.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/magento2/setup/index.php on line 25 [Tue Sep 16 18:05:40 2014] [error] [client 127.0.0.1] PHP Fatal error: Class 'Zend\Mvc\Service\ServiceManagerConfig' not found in /var/www/magento2/setup/index.php on line 32

The warnings in this case is beacuse of composer.phar not being present (which should be noted is not available with the checkout ).

I checked at the below loaction : /var/www/magento2/lib/internal/Zend Mvc folder doesn't seem to be present.

sakashNeev avatar Sep 16 '14 12:09 sakashNeev

Same errors here. But, even if you resolve autoloader and dependencies with Composer, setup isn't working properly. The worst thing is, I can't run Magento on previous database because something is changed on log tabels or similar and I can't re-install :(

ivanweiler avatar Sep 16 '14 14:09 ivanweiler

Please run composer install within the setup directory before setup.

mazhalai avatar Sep 16 '14 15:09 mazhalai

Thanks mazhalai , that did help solve the above error ! However it is now stuck with the below error:

[Wed Sep 17 10:12:14 2014] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'Zend\I18n\Exception\ExtensionNotLoadedException' with message 'Zend\I18n\Translator component requires the intl PHP extension' in /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php:257\nStack trace:\n#0 /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php(353): Zend\I18n\Translator\Translator->getLocale()\n#1 /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/Mvc/I18n/Translator.php(73): Zend\I18n\Translator\Translator->translate('An error occurr...', 'default', NULL)\n#2 /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/Translate.php(38): Zend\Mvc\I18n\Translator->translate('An error occurr...', 'default', NULL)\n#3 [internal function]: Zend\I18n\View\Helper\Translate->__invoke('An error occurr...')\n#4 /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php(399): call_user_func_array(Objec in /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php on line 257

Which suggests me to install php5-intl extension.

However after doing that the following error comes up:-

A 404 error occurred Page not found.

The requested controller could not be mapped to an existing controller class.

Controller: Magento\Setup\Controller\En_US\IndexController(resolves to invalid controller class or alias: Magento\Setup\Controller\En_US\IndexController)

No Exception available

sakashNeev avatar Sep 17 '14 04:09 sakashNeev

Just confirming that the problem exists. New setup isn't working after you resolve dependencies with composer install, you get described 404 errors.

ivanweiler avatar Sep 18 '14 11:09 ivanweiler

Setup won't run at all because my Magento2 is in subfolder (www.example.com/magento2/) and it seems Magento\Setup\Mvc\Router\Http\Setup::match() is not aware of that, namespace/controller is resolved wrong there because of subfolder.

I tweaked it and manage to run new setup. While installing (on empty db) there was one error in setup console: [ERROR] exception 'PDOException' with message 'SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'crc_string'' in C:\wamp\www\magento2\setup\vendor\zendframework\zendframework\library\Zend\Db\Adapter\Driver\Pdo\Connection.php:435 .. #4 C:\wamp\www\magento2\app\code\Magento\Core\sql\core_setup\upgrade-1.6.0.2-1.6.0.3.php(50): Magento\Framework\DB\Adapter\Pdo\Mysql->addColumn('core_translate', 'crc_string', Array) .. [SUCCESS] Magento_Core ... installed [SUCCESS] Magento_Authorization ... installed .. [SUCCESS] Magento_CurrencySymbol ... installed [SUCCESS] Magento_Wishlist ... installed [SUCCESS] Artifact ... installed

Tables were created, so I tried to run Magento, but it crashed with following message: "Looks like database is outdated. Please, use setup tool to perform update"

Hope it helps ..

ivanweiler avatar Sep 19 '14 09:09 ivanweiler

I can confirm ivanweiler findings at my local install with alpha95. Alpha 94 works fine though but only with old database and trying to upgrade doesn't work (do not have error at hand).

Marko-M avatar Sep 19 '14 09:09 Marko-M

Here are the list of steps I followed. And where I got stuck. Listing them here in case someone else wants to take over.

  1. git clone this repo
  2. composer install in the root of the project
  3. composer install in the setup folder
  4. Enabled php_intl extension
  5. Created a virtual host magento2.local. as @ivanweiler pointed out, the install gives an error when on a subfolder.
  6. Finally was able to rung the install. I was happy, but wait...there's more.
  7. 2.4 eternities later I found the Artefact installed message but the installer was only at 96 percent.
  8. Still got the error because magento tests the module version for the modules that don't have a setup script. So I manually added them to the core_resource table
    
    INSERT INTO core_resource values ('dhl_setup', '2.0.0.0', '2.0.0.0');
    INSERT INTO core_resource values ('fedex_setup', '2.0.0.0', '2.0.0.0');
    INSERT INTO core_resource values ('checkout_setup', '1.6.0.0', '1.6.0.0');
    INSERT INTO core_resource values ('groupedproduct_setup', '0.0.1', '0.0.1');
    INSERT INTO core_resource values ('ogone_setup', '1.6.0.0', '1.6.0.0');
    INSERT INTO core_resource values ('configurableproduct_setup', '1.0.0.0', '1.0.0.0');
    INSERT INTO core_resource values ('usps_setup', '2.0.0.0', '2.0.0.0');
    
    9.I found that the data install/update scripts never run. So I looked in the install script and manually executed from cli > php dev/shell/run_data_fixtures.php. I'm not sure but maybe step 8 can be skipped. I only realized that the data is not there only after inserting the values in core_resource.

At this point I get an error saying "Current store is not active" on frontend and I can access the admin login page but I'm not able to login.

I will add more details as soon as I find them.

tzyganu avatar Sep 19 '14 12:09 tzyganu

Correction for steps 8 and 9. If you first run the data updates script you don't need to insert the values in the core_resource table.
Just run UPDATE core_resource set version = data_version; because the version field for the modules mentioned at step 8 is NULL and you still get the database not up to date error.

tzyganu avatar Sep 19 '14 13:09 tzyganu

OK. I've done it. Here are the steps I've taken. Sorry for kind of spamming this, but I think it's important to have a clean view.:

  1. git clone this repo

  2. composer install in the root of the project

  3. composer install in the setup folder

  4. Enabled php_intl extension

  5. Created a virtual host magento2.local. as @ivanweiler pointed out, the install gives an error when on a subfolder.

  6. Edit /setup/module/Magento/Setup/src/Model/AdminAccount.php and replace $this->setup->getConnection()->insert($this->setup->getTable('admin_role'), $role, true); with $this->setup->getConnection()->insert($this->setup->getTable('authorization_role'), $role, true); because the table admin_role is renamed to authorization_role in the /app/code/Magento/Authorization/sql/authorization_setup/install-1.0.0.0.php install script.

  7. Run installer - grow a beard maybe while it's running because it takes a loooong time.

  8. After seeing the message Artefact installed look in the admin_user table. If a user is there it means it is stuck either on updating the app/etc/local.xml or while running the data updates.

  9. run > php dev/shell/run_data_fixtures.php for data updates

  10. Run UPDATE core_resource set version = data_version because some modules are taken into consideration when running the data updates but not the schema updates.

  11. Change in Magento\Store\Model\StorageFactory::__construct parameters

    $defaultStorageClassName = 'Magento\Store\Model\Storage\DefaultStorage', to
    $defaultStorageClassName = 'Magento\Store\Model\Storage\Db',
    Maybe this last step is wrong, but if I change it it works. If I don't...I get 'current store is not enabled'.

tzyganu avatar Sep 19 '14 14:09 tzyganu

@tzyganu Thank you very much for such a detailed report. We have already fixed most of the issues you described and prepping them for pushing to GitHub.

And we are aware of the performance issue you pointed out in the # 7 (that one is not fixed yet)

antonmakarenko avatar Sep 19 '14 14:09 antonmakarenko

Setup really sucks and it takes so long. My Setup stucks at 5% and jump to 20% and stucks again. I'm running the setup on a 24 core 64GB Ram Server with Percona and PHP5 FPM and nginx. Magento 1.9 is installed in 30sec. Installation is now running 14min and catalog_products table are finished. I will post a screen shot of table creation when it is finished.

SRaromicon avatar Sep 19 '14 16:09 SRaromicon

Thank you all for reporting this issue, discussing it here and providing useful details to the team! The team reported of fixing this issue internally. The code with the fix must be now available on the GitHub deployed in version 0.1.0-alpha96. We are closing this issue.

verklov avatar Sep 19 '14 17:09 verklov

The issue is not fixed. Installation stops at 96% and it is very slow. There some strange SQL Selects at Setup. They take 8 Seconds and will be performed on every connect to database.

547 Query SELECT DATABASE() 547 Query SELECT 'T'.'TABLE_NAME', 'T'.'TABLE_TYPE', 'V'.'VIEW_DEFINITION', 'V'.'CHECK_OPTION', 'V'.'IS_UPDATABLE' FROM 'INFORMATION_SCHEMA'.'TABLES'T LEFT JOIN 'INFORMATION_SCHEMA'.'VIEWS' V ON 'T'.'TABLE_SCHEMA' = 'V'.'TABLE_SCHEMA' AND 'T'.'TABLE_NAME' = 'V'.'TABLE_NAME' WHERE 'T'.'TABLE_TYPE' IN ('BASE TABLE', 'VIEW') AND 'T'.'TABLE_SCHEMA' = 'magento2'

140919 20:29:39 547 Query SELECT 'C'.'ORDINAL_POSITION', 'C'.'COLUMN_DEFAULT', 'C'.'IS_NULLABLE', 'C'.'DATA_TYPE', 'C'.'CHARACTER_MAXIMUM_LENGTH', 'C'.'CHARACTER_OCTET_LENGTH', 'C'.'NUMERIC_PRECISION', 'C'.'NUMERIC_SCALE', 'C'.'COLUMN_NAME', 'C'.'COLUMN_TYPE' FROM 'INFORMATION_SCHEMA'.'TABLES'T INNER JOIN 'INFORMATION_SCHEMA'.'COLUMNS'C ON 'T'.'TABLE_SCHEMA' = 'C'.'TABLE_SCHEMA' AND 'T'.'TABLE_NAME' = 'C'.'TABLE_NAME' WHERE 'T'.'TABLE_TYPE' IN ('BASE TABLE', 'VIEW') AND 'T'.'TABLE_NAME' = 'core_theme_files' AND 'T'.'TABLE_SCHEMA' = 'magento2'

`140919 20:29:41 547 Query 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_theme_files' AND 'T'.'TABLE_TYPE' IN ('BASE TABLE', 'VIEW') AND 'T'.'TABLE_SCHEMA' = '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'``

SRaromicon avatar Sep 19 '14 20:09 SRaromicon

I can confirm SRaromicon findings. Setup dies at 96%.

Marko-M avatar Sep 19 '14 20:09 Marko-M

You're right. The new setup installer is broken now. The fix will be available with one of the next publications. Meanwhile, please, use old CLI installation script:

php –f dev/shell/install.php -- --license_agreement_accepted yes --locale en_US --timezone "America/Los_Angeles" --default_currency USD --db_host localhost --db_name magento2 --db_user root --url "http://magento2.lh/" --use_rewrites no --use_secure_admin yes --admin_lastname Admin --admin_firstname Admin --admin_email "[email protected]" --admin_username admin --admin_password password --use_secure no --secure_base_url "https://magento2.lh/" --cleanup_database --skip_url_validation yes

Just substitute necessary values with yours.

buskamuza avatar Sep 19 '14 20:09 buskamuza

Thanks @buskamuza, shell install works fine. One thing to note, it's required to add --user_pass argument if database user has password set.

Marko-M avatar Sep 20 '14 08:09 Marko-M

Yes shell install works fine and it's really fast and has no performance issues. Only the db_pass parameter is missing in the example of the installer.php

SRaromicon avatar Sep 20 '14 10:09 SRaromicon

Steps I followed:-

  1. git clone https://github.com/magento/magento2.git

  2. Ran composer install inside the setup directory

  3. Create vhost with name magento2-local.com

  4. Provide necessary file permissions

  5. Try GUI install, which I gave up after 5% and checked in database as were only 13 tables created.

  6. Delete local.xml

  7. Try installing via command line

root@INPUNNEEV003:/var/www/magento2# php –f dev/shell/install.php -- --license_agreement_accepted yes --locale en_US --timezone "America/Los_Angeles" --default_currency USD --db_host localhost --db_name magento2 --db_user root --db_pass root --url "http://magento2-local.com/" --use_rewrites no --use_secure_admin yes --admin_lastname Admin --admin_firstname Admin --admin_email "[email protected]" --admin_username admin --admin_password password --use_secure no --secure_base_url "https://magento2-local.com/" --cleanup_database --skip_url_validation yes
Could not open input file: –f
  1. Try removing -f from above command
root@INPUNNEEV003:/var/www/magento2# php dev/shell/install.php -- --license_agreement_accepted yes --locale en_US --timezone "America/Los_Angeles" --default_currency USD --db_host localhost --db_name magento2 --db_user root --db_pass root --url "http://magento2-local.com/" --use_rewrites no --use_secure_admin yes --admin_lastname Admin --admin_firstname Admin --admin_email "[email protected]" --admin_username admin --admin_password password --use_secure no --secure_base_url "https://magento2-local.com/" --cleanup_database --skip_url_validation yes
exception 'Exception' with message 'Recoverable Error: Object of class Magento\Framework\Message\Error could not be converted to string in /var/www/magento2/app/code/Magento/Install/App/Console.php on line 123' in /var/www/magento2/lib/internal/Magento/Framework/App/ErrorHandler.php:77
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(4096, 'Object of class...', '/var/www/magent...', 123, Array)
#1 /var/www/magento2/app/code/Magento/Install/App/Console.php(123): implode('\n', Array)
#2 /var/www/magento2/app/code/Magento/Install/App/Console.php(159): Magento\Install\App\Console->_handleInstall(Object(Magento\Install\Model\Installer\Console))
#3 /var/www/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(203): Magento\Install\App\Console->launch()
#4 /var/www/magento2/dev/shell/install.php(107): Magento\Framework\App\Bootstrap->run(Object(Magento\Install\App\Console))
#5 {main}
  1. The tables seem to have been created. There are 309 of them.

  2. Try http://magento2-local.com/admin as well as http://magento2-local.com/ it gives 404 page.

For me neither the command line install works nor the GUI

sakashNeev avatar Sep 22 '14 09:09 sakashNeev