Magento 2 Tutorials

How to Fix Upgrade Issues in Magento 2?

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 4.67 out of 5)
Loading...Loading...
Magento 2 Fix Upgrade Issue

Today, we’re going to teach you guys how to fix upgrade issues in Magento 2. Many times, you might encounter different issues while trying to upgrade your Magento 2 store. 

However, it is quite easy to troubleshoot the upgrade issues and fix them.

In this article, we will discuss the different problems that cause upgrade issues in Magento 2 and how to fix them.

“We Can’t Take That Action Right Now” Error Issue

Let’s say that you want to upgrade your Magento 2 store because outdated software is not safe and reliable. So, you decide to take action. 

But, when you open the System Upgrade page and try upgrading the Magento 2 installation, it fails and displays the “Sorry, we can’t take that action right now” error message as shown in screenshot below.

System Upgrade

If you’re facing this upgrade issue, there is no cause for concern. Though the error message doesn’t say what you need to do, you can still easily troubleshoot this issue. 

Usually, when this issue occurs, there are only three possible cases that cause this problem and all of them can be easily fixed.

Below, we will share all three possible cases and share their resolutions.

#1 – You’re Not Authenticated

Many times, you can not upgrade your Magento 2 installation simply because you’re not authenticated. 

In fact, it’s the most common reason why it shows the “Sorry, we can’t take that action right now” error message.

To solve this issue, all you need to do is enter your authentication keys in the backend of your Magento 2 store and retry upgrading the Magento 2 installation.

If that doesn’t work, you will have to generate new authentication keys by following the below step-by-step process.

  1. Open marketplace.magento.com and login to your account.
  2. After that, Open My Profile from the top-right corner of the page.
  3. Then, look for the Marketplace tab and click on Access Keys.
  4. Next, click on the “Create New Access Keys” button.
  5. Lastly, write a name for the new keys and confirm the action.

After the process is completed, you’ll have new public and private keys.  The public key is your username and the private key is your password. 

Now, open Magento admin and reenter the credentials using these newly generated keys and then try upgrading the Magento 2 installation. 

#2 – The Updater Application Isn’t Initialized

In some cases, the upgrade issue occurs in Magento 2 when the updater application isn’t initialized. 

And this problem happens when the Magento 2 software originates from packagist. Or, when the https://repo.magento.com repository is not specified correctly in the composer create-project command.

The updater application runs upon cron. So, if the cron is not initialized and you still run the upgrade process, it will also fail to complete the upgrade procedure. 

Now, to fix this issue, you will first have to modify Magento’s composer.json file and make sure that it is referenced to https://repo.magento.com repository.

In addition to this, you also need to remember to run composer install in the updater’s root folder. And you need to resolve dependencies and initialize it using the following steps.

  1. Login to your Magento server as the file system owner.
  2. Open Magento Installation folder.
  3. Back up existing composer.json file by executing the below command.

    cp composer.json composer.json.bak
  4. Next, once a safe copy of composer.json is created, open the original file using a text editor.
  5. After that, find the repositories section and add the reference to https://repo.magento.com repository as shown below

    {

    “type”: “composer”,

    “url”: “https://repo.magento.com/“,

}

  1. Now, save the composer.json file and exit the text editor. 
  2. Lastly, change the update subfolder that contains the updater using the below command.

    composer install

Once you finish all these steps, try to upgrade the Magento Installation again.

If the “Sorry, we can’t take that action right now” error message disappears, congratulations. You have finally fixed the issue.

If the error message still appears, it might be due to the below reason.

Cloned Magento GitHub repo

Another major reason why the upgrade issue happens in Magento 2 is when the Magento software was installed by cloning the repository.

Now, to fix this issue, you’ll have to use git pull origin and composer update to execute the upgrade process by following the below steps.

  1. First of all, login to your Magento server as the file system owner.
  2. Next, backup your composer.json file by executing the below command as this process will overwrite it.

    cd <magento_root>
    cp composer.json composer.json.old

  3. After that, update your local repository to the latest available version by executing the following command.

    git pull origin develop
  4. Now, it is compulsory to merge your composer.json.old with the composer.json installed with Magneto software as shown below.  Execute the following command:

    composer update

    Next, upgrade your Magento database:

    <magento_root>/bin/magento setup:upgrade

    Finally, clean the cache.

    bin/magento cache:clean

    Once you’ve completed all the above steps yet encounter the following error, then execute the below troubleshooting steps:

    error: Your local changes to the following files would be overwritten by merge:

<list of files>

To find which files are subject to being overwritten, either read the message or enter:

“`bash

git status

Now, if you have intentionally modified the files, you will have to resolve the conflict manually by asking for help from GitHub Help.

On the other hand, if you’re certain that you’ve not modified the files, then try executing the following command.

$ git reset --hard HEAD && git pull origin develop

In addition to this, it is also recommended to use the default GitHub configuration to prevent such errors from occuring in the future.

How to Roll Back If The Update Fails?

Now that you have finally learned all the possible problems that cause upgrade issues in Magneto 2, let’s also see how to roll back if Magento 2 upgrade fails.

When you the following error occurs in the Console Log, you should roll back the update.

Error Console Log

To roll back the update, just click on the Rollback button to restore the previous backup.

Now, if you don’t have any previous backups, Magento still recovers your data. 

However, if there is no component version to roll back, you’ll first have to ask your component vendor.

Final Thoughts…

That’s it!

This is how you can identify and resolve different types of problems that cause upgrade issues in Magento 2.

We hope that you found this article helpful. If you have any questions or doubts, please ask in the comments below.

And if you need our professional assistance, feel free to contact us anytime for help.

You may also like
Magento 2 Price Drop Alert
Encourage your Shoppers to Purchase Quickly with Magento 2 Price Drop Alert!
Magento eCommerce Platform
Magento – A Revolution in eCommerce Platform!

Leave Your Comment

Your Comment*

Your Name*