Magento 2 Troubleshooting

  1. Solved: Package exists in composer repo 1 and composer repo 2 which has a higher repository priority

    When you install some new extension package in Magento 2 via the composer you can get an error:

    Package vendor/module-name exists in composer repo ( and composer repo ( which has a higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See for details and assistance.

    This error message is self-explaining and contains a link to the composer documentation.

    The problem is that a module you try to install has an old version in the Magento composer repository and a new version in the free public repository. However, the Magento repository has a higher priority and that is why composer cannot install the latest version and throws this error.

    What you need to do to solve the issue is to:

    Read more »
  2. Solved: Magento 2 Customer Addresses with Invalid Region Data

    Sometimes when you update Magento, it could change the required state parameters and set some obligatory states for several countries in Stores > Configuration > General. Moreover, this option can be updated by your colleagues or you.

    Magento State Options

    Read more »
  3. Magento 2 An element with a "root" ID already exists - Fix

    If you get an error "An element with a “root” ID already exists" in your Magento 2, it is, most likely, related to a third-party extension that calls methods to re-render a page.

    To fix the "An element with a “root” ID already exists" error:

    1. Find a PHP file and a line that throws an exception.

    2. Open CLI (terminal), navigate to the Magento root directory, and run the following commands to find the proper file:

    grep vendor/ -re ' ID already exists'
    grep app/ -re ' ID already exists'

    As a result, you will get an output similar to this:

    vendor/magento/framework/Data/Form.php: 'An element with a "' . $elementId . '" ID already exists.'
    vendor/magento/framework/Data/Test/Unit/FormTest.php: $this->expectExceptionMessage('An element with a "1" ID already exists.');
    vendor/magento/framework/Data/Structure.php: new \Magento\Framework\Phrase('An element with a "%1" ID already exists.', [$elementId])

    3. Then open each fi

    Read more »
  4. Amasty Shopby breaks the Magefan Blog Featured Images Uploading

    In case you use one of the Amasty extensions, e.g. Amasty Layered navigation, you may face the issue of the broken blog featured images after the upload.

    We have found the issue in Amasty_Shopby extensions, that breaks some other extensions using image upload functionality, including our Magento 2 Blog Extension.

    Amasty_Shopby in this file:


    adds the plugin to Magento\Catalog\Model\ImageUploader model.

    Judging from the code in the following file:


    it looks like some fix Amasty added for Magento 2.3.4. and the issue lies in the plugin beforeMoveFileFromTmp.

    The original Magento MoveFileFromTmp declaration looks like this:

    public function moveFileFromTmp($imageName,
    Read more »
  5. Debugging PHP Infinite loop in Magento 2

    There are situations in Magento 2 when page keeps loading and then you get 500 fatal error, memory limit, or timeout error. This is an infinite loop in the PHP code, when the same code is executed over and over again. It is related to some core Magento issues or, most likely, third party extension.

    To debug an infinite loop and find the loop entrance, please follow the steps below:

    1. Open the app/bootstrap.php file and add this code right after PHP open tag <?php in the next line

    $_SERVER['MAGE_PROFILER'] = 'html';

    2. Open the vendor/magento/framework/Profiler.php file and add this code to the beginning of "public static function start($timerName, array $tags = null)" function, e.g.

    Read more »
  6. Serve Images In Next-Gen Formats on Magento Website

    Page Speed is taken very seriously by a lot of Magento stores since it directly influences your general website performance. That's why everyone constantly tries to improve it and looks for the best ways to do so. 

    In case you're checking your website speed in Google PageSpeed you can face the Serve images in next-gen formats issue. According to it, Google recommends you to save images in JPEG 2000, JREG XR and WEBP formats instead of old PNG and JPG. Best of all - WebP.

    Never heard of it?

    Find out more about what is WebP, why should you use it in your Magento 2 store and how is it different from PNG and JPG in this article about WebP images in Magento 2.

    Serve Images in Next Gen Formats in Magento

    Read more »
  7. Featured Images Are Not Displayed In Magento 2 Blog

    If you use Magento 2 Blog extension with attached featured images to a blog post but these images are not displayed on the storefront, then most likely the issue is in your theme. A lot of themes provide custom blog layouts and template files that override the original view and can miss some blog functionality like featured images. To check and fix this, please follow steps below:

    1. Open this file if exists (if does not exists skip steps 2-3):


    2. Check if the file has the code like "getFeaturedImage". You can find the original code here

    3. If this code is missing, add it to

    Read more »
  8. Double Canonical Tags in Magento 2 Blog

    In case you use Magento Blog extension and face the issues of double canonical tags on blog pages know that it most commonly happens because you use some third-party SEO extension. And that SEO extension adds the additional canonical URL for your blog pages.

    If the SEO module you use is Mageworx SEO extension you need to go to Stores > Configuration > Mageworx > SEO Base > Canonical URL Settings and set the following items in the Canonical URL won't be added for those pages:


    Magento 2 Double Blog Canonical Issue

    Once you add them, the second canonical URLs won't

    Read more »
  9. Fix "There has been an error processing your request" issue in Magento 2

    "There has been an error processing your request" is the message you can receive when working with Magento 2.  Here is the example of this message:

    There has been an error processing your request

    Read more »
  10. schema deprecated - Error Fix Solution

    Recently we got an " schema deprecated and not supported by Google anymore. Please migrate to using types." error validating one of our website pages. The same error we got in Google Search Console. schema is deprecated and not supported by Google anymore. Please migrate to using types

    This " schema deprecated" error is related to the breadcrumbs structure data. We used "" schema for the structured data, but Google supports it no longer. 

    You may also receive this error starting from April 6, 2020, in case you haven't converted your structured data scheme from to

    Before we get to the point of how to

    Read more »
  11. Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages - Magento 2 Fixes

    If you use Magento 2 and get an error like this:

    Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
    error:14095126:SSL routines:ssl3_read_n:unexpected eof while reading in vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php on line 72

    <pre>#1 file_get_contents() called at [vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php:72]
    #2 ReCaptcha\RequestMethod\Post->submit() called at [vendor/google/recaptcha/src/ReCaptcha/ReCaptcha.php:156]
    #3 ReCaptcha\ReCaptcha->verify() called at [app/code/MSP/ReCaptcha/Model/Validate.php:79]
    #4 MSP\ReCaptcha\Model\Validate->validate() called at [app/code/MSP/ReCaptcha/Observer/ReCaptchaObserver.php:93]
    #5 MSP\ReCaptcha\Observer\ReCaptchaObserver->execute() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:72]
    #6 Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:60]

    when trying to login to the admin panel, reset customer password, create a new customer account, etc., you can make a quick fix. To do this please follow the steps below:

    Read more »
  12. Fixed: Related Products Template Does Not Looks Good

    In Magento 2 Blog v2.9.3 we added the feature that many customers requested about, it is "use the default catalog related products template" instead of custom blog related product template. This helps to display related products on the blog post page in the theme design automatically. The commit related to this change can be found at GitHub.

    Unfortunately, there are thousands of themes for Magento 2, and some of them have specific JS and CSS (e.g. Porto Theme). That is why if you use Blog extension v2.9.3 or greater and the related products block does not look good, please try to do next:

    1. Create a new file in your theme directory:


    Read more »
  13. Login As Customer extension v2.0.0 - v2.2.2 Important Security Issue Fix

    Today (Feb 12, 2020) we have been notified about a potential security issue in our Magento 2 Login as Customer Extension thanks to Daniel Sloof's tweet.

    Reviewing the code and communicating with Derrick HeesbeenLewis Voncken from there was found the security issue.

    Note that, no confirmed

    Read more »
  14. Magento sidebar is missing fix

    There are cases when the Magento sidebar is missing and not showing. Most likely this is because of the "sidebar" or "sidebar.additional" container has been removed from your theme layout.

    Magento sidebar is missing

    Read more »
  15. Magento 2.3 - TinyMCE 4 Toolbar / Text Color Tool Missing

    In Magento 2.3 and greater, Magento team has changed WYSIWYG editor, instead of TinyMCE 3 Magento started use TinyMCE 4.

    On the picture below, you can see Magento 2.0-2.2 TinyMCE 3  editor:

    TinyMCE 3 Magento 2 Editor

    Default Magento TinyMCE 4 editor does not include a lot of tools for example text color or text background and this can be inconvenient for the content manager.

    Magento 2 TinyMCE 4

    Read more »
  16. Fix: Blog Search Does Not Work

    If your Magento 2 Blog search does not work, most likely the issue is in your theme that overrides original blog templates and layout files.

    Try the next steps:

    1. Make sure that you have the latest Magento 2 Blog module version.

    2. Try temporary remove Blog layout XML files and template PHTML files from your theme one by one and run static content deploy. Once find the file that brings the issue, pay attention to it.

    3. Check if a blog search button in the sidebar has the attribute  "disabled", if yes then it is disabled (not active), and this may be a root of the issue. In this case, find a code which makes it disabled. The disabled attribute can be added directly via .phtml file in your theme or with some JavaScript. If you cannot find it, then you can insert this JS script to undisable the button:

    require(['jquery', 'domReady!'],
    Read more »
  17. Error: Product Key is empty or invalid. The extension has been automatically disabled.

    Note: if you have purchased the extension on Magento Marketplace (have a paid order) and can not find the product key, please contact us and provide your order number.

    Solution for Magento 2 Community Edition (CE / Open Source)

    If you get the error "Product Key is empty or invalid. The extension has been automatically disabled." while saving Magefan extension on Magento Community edition and  don't see any Product Key field, as on the screenshot:

    Product Key is empty or invalid. The extension has been automatically disabled.

    Read more »
  18. Magento 2 Showing Wrong Customer IP

    Sometimes instead of the real customer IP address, you can see or some other wrong customer IP in your Magento 2 Admin panel. It can be due to proxies, like Varnish, Cloudflare,, that may be enabled for your Magento 2 store.

    To solve the wrong IP address issue you need to:

    1. Create a new file in M2 directory:


    2. Paste the code:

    <?xml version="1.0"?>
    <config xmlns:xsi=""
    <type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress">
    <argument name="alternativeHeaders" xsi:type="array">
    <item name="x-client-ip" xsi:type="string">HTTP_X_REAL_IP</item>
                    <item name="x-cf-connecting-ip"
    Read more »
  19. Fix Blog Post Media Gallery In SmartWave Porto Theme

    If you have any issues with the media gallery in a blog post using SmartWave Porto Theme, please follow the steps below.

    First of all, if there are no blog post media gallery settings in the Magento 2 admin panel, please make sure that you use the latest version of blog extension.

    Then create a new file in your theme directory:


    and add this code into it.

    Read more »
  20. bin/magento Fatal error: Allowed memory size of xxxx bytes exhausted (tried to allocate xxx bytes)

    When you run Magento 2 CLI command "bin/magento ..." and get the error:

    Allowed memory size of xxxx bytes exhausted (tried to allocate xxx bytes)

    You can easily fix it using this command instead of bin/magento:

    php -dmemory_limit=-1 bin/magento ....
    Read more »
Posts loader