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

Start Cron Jobs After Install The Magento2 By Command Line , Admin Page Shown "There has been an error processing your request" #8187

Closed Sharpeli closed 7 years ago

Sharpeli commented 7 years ago

I installed the Magento CE 2.1.3 by the command line installation, and the installation is successfully completed ( [SUCCESS]: Magento installation complete. [SUCCESS]: Magento Admin URI: /admin) . After that, I set the cron jobs according to the instructions on http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-group , and I checked the file /var/www/magento/var/.setup_cronjob_status which was exist. But when I try to vist the admin page. It shown me an error page: There has been an error processing your request. Exception printing is disabled by default for security reasons.

The detailed exception are here: 1 exception(s): Exception #0 (RuntimeException): Can't create directory /var/www/magento/var/generation/Magento/Framework/Acl/Builder/.

Exception #0 (RuntimeException): Can't create directory /var/www/magento/var/generation/Magento/Framework/Acl/Builder/.

0 /var/www/magento/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\Framewo...')

1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\Framewo...')

2 [internal function]: spl_autoload_call('Magento\Framewo...')

3 /var/www/magento/vendor/magento/framework/ObjectManager/Relations/Runtime.php(38): class_exists('Magento\Framewo...')

4 /var/www/magento/vendor/magento/framework/Interception/Config/Config.php(153): Magento\Framework\ObjectManager\Relations\Runtime->has('Magento\Framewo...')

5 /var/www/magento/vendor/magento/framework/Interception/Config/Config.php(176): Magento\Framework\Interception\Config\Config->_inheritInterception('Magento\Framewo...')

6 /var/www/magento/vendor/magento/framework/Interception/ObjectManager/Config/Developer.php(61): Magento\Framework\Interception\Config\Config->hasPlugins('Magento\Framewo...')

7 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(70): Magento\Framework\Interception\ObjectManager\Config\Developer->getInstanceType('Magento\Framewo...')

8 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')

9 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')

10 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'aclBuilder', 'Magento\Framewo...')

11 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array)

12 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')

13 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')

14 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'aclPolicy', 'Magento\Framewo...')

15 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array)

16 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')

17 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')

18 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'authorization', 'Magento\Backend...')

19 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Backend...', Array, Array)

20 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Backend...')

21 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Backend...')

22 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Backend...', NULL, 'aclFilter', 'Magento\Backend...')

23 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Backend...', Array, Array)

24 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Backend...')

25 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Backend...')

26 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'generatorPool', 'Magento\Framewo...')

27 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array)

28 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')

29 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')

30 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'layout', 'Magento\Framewo...')

31 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array)

32 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')

33 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')

34 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'view', 'Magento\Backend...')

35 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Backend...', Array, Array)

36 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Backend...')

37 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Backend...')

38 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Backend...', NULL, 'context', 'Magento\Backend...')

39 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Backend...', Array, Array)

40 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Backend...', Array)

41 /var/www/magento/vendor/magento/framework/App/ActionFactory.php(40): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Backend...')

42 /var/www/magento/vendor/magento/framework/App/Router/Base.php(300): Magento\Framework\App\ActionFactory->create('Magento\Backend...')

43 /var/www/magento/vendor/magento/framework/App/Router/Base.php(161): Magento\Framework\App\Router\Base->matchAction(Object(Magento\Framework\App\Request\Http), Array)

44 /var/www/magento/vendor/magento/framework/App/FrontController.php(50): Magento\Framework\App\Router\Base->match(Object(Magento\Framework\App\Request\Http))

45 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))

46 /var/www/magento/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)

47 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')

48 /var/www/magento/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))

49 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

50 /var/www/magento/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)

51 /var/www/magento/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

52 /var/www/magento/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()

53 /var/www/magento/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))

54 {main}

Preconditions

Here are the running environment:

  1. Ubuntu 16.04
  2. Apache 2.4.18
  3. PHP 7.0.13
  4. MySQL 5.7.16
  5. Magento CE ver 2.1.3  - Added Dec 14, 2016

Steps to reproduce

Steps to reproduce this bug:

  1. Install prerequisites apache2, php, mysql.

  2. Download the Magneto CE 2.1.3 package, then extract it. cd /var/www tar xvzf ./Magento-CE-2_1_3_tar_gz-2016-12-13-09-08-39.tar.gz -C ./magento rm ./Magento-CE-2_1_3_tar_gz-2016-12-13-09-08-39.tar.gz

  3. Set file permissions before install it. cd /var/www/magento find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \; find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \; chmod u+x bin/magento

  4. Seting the apache2,PHP and create data table for magento.

    enable site magento and disable default site

    #  the content of  magento.conf 

    <VirtualHost *:80> DocumentRoot /var/www/magento <Directory /var/www/magento/> Options Indexes FollowSymLinks MultiViews AllowOverride All

    a2ensite magento.conf
    a2dissite 000-default.conf
    
    #configure PHP
    sed -i 's/memory_limit = 128M/memory_limit = 2G/' /etc/php/7.0/apache2/php.ini
    sed -i 's/memory_limit = -1/memory_limit = 2G/' /etc/php/7.0/cli/php.ini
    a2enmod rewrite
    phpenmod mcrypt

    create table

    service mysql start
    mysqladmin -u root password $DB_PASSWORD
    mysql -u root -e "create database magento; GRANT ALL ON magento.* TO magento@localhost     IDENTIFIED BY 'magento';" --password=$DB_PASSWORD
  5. Install Magento2 by command line cd /var/www/magento

    install the magento

    bin/magento setup:install --admin-firstname=$ADMIN_FIRSTNAME \
                                               --admin-lastname=$ADMIN_LASTNAME \
                                               --admin-email=$ADMIN_EMAIL \
                                               --admin-user=$ADMIN_USER \
                                               --admin-password=$ADMIN_PASSWORD \
                                               --db-name=$DB_NAME \
                                               --db-password=$DB_PASSWORD \
                                               --backend-frontname=$BACKEND_FRONTNAME \
                                               --base-url=$BASE_URL

    Installed Succeed [SUCCESS]: Magento installation complete. [SUCCESS]: Magento Admin URI: /admin

  6. Change file permissons after installation. echo "Changing file permissions..." chmod -R 777 vendor chmod -R 777 app/etc chmod -R 777 var chmod -R 777 pub/static

  7. Set Cron jobs service cron restart crontab -l > magentocron cat /cronjobs >> magentocron crontab magentocron rm magentocron

  8. Run Apache2 in the foreground apachectl -DFOREGROUND

Please be noticed that there hasn't show any error show on the terminal during I do the steps above.

Here are the system.log: [2017-01-19 02:09:57] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_2c7461af04bb11fe209659d7147d2c579 and handles default, cms_index_index, cms_page_view, cms_index_index_id_home: Please correct the XML data and try again. [] [] [2017-01-19 02:09:57] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_20a98983867a1770682b48d9a0ad63441 and handles 1column: Please correct the XML data and try again. [] [] [2017-01-19 02:09:57] main.CRITICAL: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2017-01-19 02:09:57] main.CRITICAL: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2017-01-19 02:09:57] main.CRITICAL: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2017-01-19 02:09:57] main.CRITICAL: Broken reference: the 'paypal.partner.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2017-01-19 02:09:57] main.CRITICAL: Broken reference: the 'bml.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2017-01-19 02:09:57] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_26f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data and try again. [] []

veloraven commented 7 years ago

@Sharpeli thank you for your report. Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result after steps. Otherwise it is harder to understand what exactly happens and what should have happen.

veloraven commented 7 years ago

According to contributor guide, tickets without response for two weeks should be closed. If this issue still reproducible please feel free to create the new one: format new issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result and specify Magento version.