Magento 2 Troubleshooting
CAPTCHA is an effective tool that helps you prevent spam or any malicious actions in your store. Besides, having an additional security layer is always a smart idea.
However, when working with CAPTCHA, you may get the "Incorrect CAPTCHA" error. Although not critical, this error still interrupts the usual workflow, which influences customers' experience.
Thus, today you'll explore what the "Incorrect CAPTCHA" error message is about, and how to fix and avoid it in the future. Those of you using Magento will find the tips on how to avoid the "Incorrect CAPTCHA" error but still maintain high Magento security.
So, let's get to the point!
"Incorrect CAPTCHA" Error: Reasons and Solutions
The "Incorrect CAPTCHA" error is quite common. So there could be numerous causes. From IP restrictions to invasive extensions, there is a lot for you to untangle. It's easier to do so when you at least know what to look for.
Thus, let's check some of the most common causes of the "Incorrect CAPTCHA" error
As you know Magento 2 provides various default options for creating an eCommerce store and gives you enough flexibility to customize it. However, some errors may appear on the way. And as a developer should know how to fix them.
One of the most common errors you might face is "An error has happened during application run. See exception log for details". There are various reasons for it to appear. So the solutions may vary as well.
If you are wondering how to deal with this error, you've landed on the right page. Today you'll learn more about the error and find a solution you can refer to.
What Causes the Error?
As we've already mentioned, "An error has happened during application run. See exception log for details" is one of the most common Magento errors.
It usually happens after you install Magento 2. Yet, you can also encounter it after upgrading your Magento to a higher version.
The error in question can be caused by multiple reasons. For example, the database connection is not
The first thing you face once managing Magento 2 multi-language store, is translating all of your content and landing pages. It helps to make your website convenient for each of your targeted customers.
The content you create and publish on the frontend is not the only content you need to translate. That's why you have to generate a translation dictionary to form a list of texts to translate in email templates, third-party extensions, JS files, and so on.
Although our Magento 2 Translation Plus module helps you to manage and generate that translation dictionary, you may still face the Magento "Missed phrase" error.
It mainly appears when you try to generate a translation dictionary when running the following command:
bin/magento i18n:collect-phrases --magento
Most often, the "Missed phrase" error is caused by the third-party extensions when the system tries to translate an empty string like __('')
.
Correspondingly to learn what module is causing the issues you have to run the following
It's not a secret website speed is one of the most important SEO ranking factors not only because of the loading itself, but its influence on customer experience. That's why you have to constantly test website speed with different tools to determine the issues slowing down your Magento 2 store.
The most common tool everyone is familiar with is Google PageSpeed Insights or PSI. It runs your URL through Google's servers and provides a report on how your website is doing.
Today we want to turn your attention to the "Defer Offscreen Images" that often holds your website from getting into the PSI green zone. We'll discuss what it means and how you can fix it to speed up Magento.
What is "Defer Offscreen Images" Message?
"Defer Offscreen Images" is the message displayed in Google PageSpeed Insights that lists all images that should be lazy loaded on the requested URL. It also shows the potential size savings you'll get from lazy loading these images. The complete description from Google looks
Working on the Magento store is not that easy either for developers or admins whatever task they're engaged in. And though Magento 2 errors are something one never wants to meet, you may encounter them when installing Magento 2 extensions, updating Magento, creating multiple product-related requests, running some script or file with no execute permissions, etc.
These errors in Magento might range from harmless to quite complex influencing your website performance and customer experience. However, in most cases, they're relatively easy to handle if you detect why they appear timely.
So this article is a breakdown of the most common Magento errors you can run into. Knowing the causes, types of the errors and where to find error logs helps you avoid them in the future.
Magento error 1: Access Denied
Magento Access Denied HTTP error 403 most commonly appears in the Magento admin panel. It occurs when you try to access a page you don't have permission to enter because of the wrong credentials
The deadlock issue is one of the biggest and most difficult issues to fix on Magento 2, which every Magento developer comes across sooner or later. Once you start to search for how to fix deadlock issues in Magento, you will have a hard time finding an ultimate guide.
So, my guess is — it is probably not the first article you come across. But hopefully, you'll find the answer here.
In this article, you'll learn everything you need to know to understand and fix deadlock issues. Or at least significantly reduce them.
Why Do Magento Indexes Get Invalidated?
When you face the Magento deadlock issue, the first thing is to check Magento indexes and learn why they get invalidated. For that go to System > Tools > Index Management, make sure that you have set up index mode correctly and that your crons are running.
Magento index modes
Magento has two index modes:
- Update on Save — reindex is done during product save (it is not recommended to enable this mode on production since it can significantly
Magento stores a lot of data in the database to optimize the performance of your store. However, once you update any of that data, the system starts indexing it to restore the changes in the database tables. That's exactly when the "One or more indexers are invalid. Make sure your Magento cron job is running" error appears in the admin panel.
It is one of the most common Magento errors all Magento users come across when working with Magento.
It might seem just annoying admin notice, but there is more than that behind it. Today you'll learn why "One or more indexers are invalid" appears and how you can easily fix it from the admin panel or via CLI.
Why "One or more indexers are invalid" error appears?
Since Magento is a complex system it has a special feature to schedule and run store tasks automatically — Magento cron jobs. Except for sending newsletters and notifications, updating catalog price rules and currency rates, cron tasks also run reindex.
So, usually, Magento reindex is run
Working with Magento 2, you can come across multiple errors or notices that keep destructive or interrupting the management process. One of the most common Magento errors is Access Denied HTTP error 403 which appears when you work with Magento 2 admin.
While many of you face this issue, few really know what it is connected with or how to solve this. So, in this guide, we'll provide a really simple and quick fix for the "Access denied" error to enable anyone with or without technical skills to deal with it.
However, let's define what is Magento "Access denied" error is in the first place.
What is Magento "Access denied" error?
Magento Access denied error is the most common Magento error that appears when you try to access a webpage without having the right to enter it. It usually appears in the Magento admin when you use incorrect admin panel credentials, create a new user with the wrong user role, or install Magento 2 extensions.
How to Fix the "Access denied" error in Magento 2?
Now
Sometimes when you use Magento 2 you can get the Magento catalog_product_super_link table doesn`t exists error. It appears because some module tries to make an SQL request with SQL query that includes "catalog_product_super_link" table and the table does not exist. So actually, the error is self-explaining.
Why catalog_product_super_link table might not exist?
This table is defined in Magento 2 module Magento_ConfigurableProduct. So please make sure it is enabled in app/etc/config.php. If not, enable it by changing 0 to 1 in the right part, e.g:
'Magento_ConfigurableProduct' => 1,
As any error appearing on any website, Magento 2 internal server error 500 influences your customer experience, traffic, and conversions. Though sometimes it can disappear after you reload the page, you should take steps to eliminate it immediately, so it doesn't influence your store traffic for hours.
It is one of the most common Magento errors. So before we get to the solution to fix 500 internal server errors in Magento 2, you should know what it is.
What is Internal Server Error 500 in Magento 2?
Magento internal server error is a general HTTP status code that appears when you follow the correct URL or click on a website link and request a page from the server. Something goes wrong and the server can't return the requested page and doesn't know what the issue is.
Since the server doesn't know anything about the issues and displays only Internal Server Error 500, you should access the server error logs and check for more information about this issue.
And here are the most common
Magento is a vast platform with a lot of features and code correspondingly. So, the same as in any other eCommerce platform you will encounter errors.
Magento Invalid Form Key. Please refresh the page is one of the most common Magento errors you've probably come across. It can appear when you:
- install Magento 2 extension
- update Magento
- create an account on localhost
- create a configurable product with multiple child products
- add a lot of related, cross-sell and upsell products to any of the products
- save an attribute with multiple options
- assign a lot of related products and posts to a blog article
The reason why you've landed on this page is the Service Temporarily Unavailable Magento 2 error that appeared when you tried to access your admin or storefront.
Any errors that appear on your Magento 2 store can cost you not only time but money. So eliminating it as quickly as possible is a top priority.
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:
[InvalidArgumentException]
Package vendor/module-name exists in composer repo (https://repo.packagist.org) and composer repo (https://repo.magento.com) which has a higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio 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 packagist.org 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:
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.
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 file (except *Test.php) and put a backtrace and exit function before each
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:
app/code/Amasty/Shopby/etc/adminhtml/di.xml
adds the plugin to Magento\Catalog\Model\ImageUploader model.
Judging from the code in the following file:
app/code/Amasty/Shopby/Plugin/Catalog/Model/ImageUploaderPlugin.php
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, $returnRelativePath = false)
and Amasty's plugin missing the second parameter $returnRelativePath:
public function beforeMoveFileFromTmp(\Magento\Catalog\Model\ImageUploader $subject, $path)
So, basically, Amasty's
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.
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.
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):
/app/design/frontend/[ThemeVendor]/[themename]/Magefan_Blog/templates/post/list/item.phtml
2. Check if the file has the code like "getFeaturedImage". You can find the original code here
https://github.com/magefan/module-blog/blob/master/view/frontend/templates/post/list/item.phtml
https://prnt.sc/tcl3sj
3. If this code is missing, add it to your custom theme file.
4. Open this file if exists (if does not exists skip steps 5-6):
/app/design/frontend/[ThemeVendor]/[themename]/Magefan_Blog/templates/post/view.phtml
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:
blog_index_index
blog_post_view
blog_category_view
blog_archive_view
blog_author_view
blog_tag_view
Once you add them, the second canonical URLs won't be set for blog pages and the native blog canonical URLs will be used.
In case you use SEO extension provided by some other company we recommend you to contact them and ask to provide documentation or guidance on how to remove the canonical URLs set by their extension from Magento 2 blog pages.
We also recommend you to use only native Magento 2 blog canonical
"There has been an error processing your request" is one of the most common Magento 2 error messages you can receive when working with Magento 2. Here is an example of this message: