magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Upgrade to Magento 2.0.1 failed

Open ifekaj opened this issue 10 years ago • 10 comments

I attempted an upgrade from Magento 2.0.0 to 2.0.1 using the setup wizard. On the last step, after I click on the upgrade button it shows the message "System Update Status: Update pending". After a few minutes installation fails with the following output in console:

error

PHP version is 7.0.2. There are no extensions installed

ifekaj avatar Jan 21 '16 16:01 ifekaj

@ifekaj is there any information in this file? var/update_status.log

mazhalai avatar Jan 21 '16 20:01 mazhalai

[2016-01-22 04:13:03 UTC] Job "maintenance_mode {"enable":true}" has been started
[2016-01-22 04:13:03 UTC] Magento maintenance mode is enabled.
[2016-01-22 04:13:03 UTC] Job "maintenance_mode {"enable":true}" has successfully completed
[2016-01-22 04:13:03 UTC] Content to write must be a valid JSON.

In addition, both automatic and manual rollback attempts fail. Manual rollback fails at the database file

ifekaj avatar Jan 22 '16 04:01 ifekaj

Not sure if it's related, but I found this in my ssl_error_log:

[Fri Jan 22 12:25:30.783316 2016] [:error] [pid 1363] [client XXX.XXX.XXX.XXX:40393] PHP Warning: fopen(/var/www/html/var/.update_error.flag): failed to open stream: Permission denied in /var/www/html/update/app/code/Magento/Update/Status.php on line 211, referer: https://www.example.com/update/index.php

[Fri Jan 22 12:25:30.785361 2016] [:error] [pid 1363] [client XXX.XXX.XXX.XXX:40393] PHP Fatal error: Uncaught RuntimeException: "/var/www/html/var/.update_error.flag" cannot be created. in /var/www/html/update/app/code/Magento/Update/Status.php:213\nStack trace:\n#0 /var/www/html/update/app/code/Magento/Update/Status.php(197): Magento\Update\Status->setFlagValue('/var/www/html/v...', true)\n#1 /var/www/html/update/index.php(54): Magento\Update\Status->setUpdateError(true)\n#2 {main}\n thrown in /var/www/html/update/app/code/Magento/Update/Status.php on line 213, referer: https://www.example.com/update/index.php

File .update_error.flag exists on that location, but is empty.

ifekaj avatar Jan 22 '16 06:01 ifekaj

Also got the same problem. I must mention that i changed the default magento chmod to be less strict or magento2 wont work on my webspace. Maybe this is related? https://github.com/magento/magento2/issues/2571

IceReaper avatar Jan 22 '16 13:01 IceReaper

@ifekaj There is a message "update application is not running". This indicates your cron jobs aren't set up properly. See this topic for information about that.

You can also run the update cron job manually, but you'll need to run it manually until upgrade completes. I believe the command syntax is:

php <your Magento install dir>/update/cron.php

Run it once a minute or so until upgrade completes. If it generates an error, let us know.

ghost avatar Jan 22 '16 14:01 ghost

Thank you for your reply. I have this in my crontab file:

*/1 * * * * php -c /etc /var/www/html/bin/magento cron:run
*/1 * * * * php -c /etc /var/www/html/update/cron.php
*/1 * * * * php -c /etc /var/www/html/bin/magento setup:cron:run

Crontab log file shows no errors as far as I can tell. Commands seem to be running fine

...
Jan 22 23:38:01 example CROND[17926]: (ifekaj) CMD (php -c /etc /var/www/html/bin/magento setup:cron:run)
Jan 22 23:38:01 example CROND[17928]: (ifekaj) CMD (php -c /etc /var/www/html/update/cron.php)
Jan 22 23:38:01 example CROND[17927]: (ifekaj) CMD (php -c /etc /var/www/html/bin/magento cron:run)
Jan 22 23:39:01 example CROND[18087]: (ifekaj) CMD (php -c /etc /var/www/html/bin/magento setup:cron:run)
Jan 22 23:39:01 example CROND[18088]: (ifekaj) CMD (php -c /etc /var/www/html/bin/magento cron:run)
Jan 22 23:39:01 example CROND[18089]: (ifekaj) CMD (php -c /etc /var/www/html/update/cron.php)
...

ifekaj avatar Jan 22 '16 15:01 ifekaj

Hi @ifekaj, there is an issue with PHP 7 and the Updater application. Please try this quick patch: In your Magento root path/update/app/code/Magento/Update/Queue/Writer.php

Replace the content with:

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Update\Queue;

class Writer extends Reader
{
    /**
     * Write JSON string to job queue
     *
     * @param string $data
     * @return bool|int
     * @throw \RuntimeException
     */
    public function write($data)
    {
        if (file_exists($this->queueFilePath)) {
            if ($data != '') {
                json_decode($data);
                if (json_last_error() !== JSON_ERROR_NONE) {
                    throw new \RuntimeException(sprintf('Content to write must be a valid JSON.'));
                }
            }
            return file_put_contents($this->queueFilePath, $data);
        }
        return false;
    }
}

eddielau avatar Jan 23 '16 00:01 eddielau

Thank you for your reply. This solved my original problem, but now I have a new issue. Here is the information from var/update_status.log file:

[2016-01-23 05:38:04 UTC] Job "maintenance_mode {"enable":true}" has been started
[2016-01-23 05:38:04 UTC] Magento maintenance mode is enabled.
[2016-01-23 05:38:04 UTC] Job "maintenance_mode {"enable":true}" has successfully completed
[2016-01-23 05:38:04 UTC] Job "update {"components":[{"name":"magento/product-community-edition","version":"2.0.1"}]}" has been started
[2016-01-23 05:38:04 UTC] Starting composer update...
[2016-01-23 05:38:04 UTC] ./composer.json has been updated

[2016-01-23 05:46:25 UTC] An error occurred while executing job "update {"components":[{"name":"magento/product-community-edition","version":"2.0.1"}]}": Could not complete update {"components":[{"name":"magento/product-community-edition","version":"2.0.1"}]} successfully: Command "update" failed: Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing magento/framework (100.0.2)
  - Installing magento/framework (100.0.3)
    Downloading: Connecting...

[...]

  [ErrorException]                                                                                   
  Source /var/www/html/vendor/magento/magento2-base/dev/tests/integration/.gitignore does not exist  


update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [packages1] ... [packagesN]

ifekaj avatar Jan 23 '16 05:01 ifekaj

Hi @ifekaj we are working on this issue in scope of https://github.com/magento/magento2/issues/3056 solution will be provided very soon. Thank you.

vancoz avatar Jan 23 '16 21:01 vancoz

@ifekaj this issue has been resolved. Please refer to this comment: https://github.com/magento/magento2/issues/3056#issuecomment-176426683

Closing this issue.

mazhalai avatar May 09 '16 19:05 mazhalai