Page 2 - Magento 2 Troubleshooting
Recently we got an "data-vocabulary.org schema deprecated and not supported by Google anymore. Please migrate to using schema.org types." error validating one of our website pages. The same error we got in Google Search Console.
This "data-vocabulary.org schema deprecated" error is related to the breadcrumbs structure data. We used "data-vocabulary.org/Breadcrumb" 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 data-vocabulary.org to schema.org.
Before we get to the point of how to fix the "data-vocabulary.org schema deprecated" error, let's make a few things clear.
What is Structured Data?
It is a specific HTML or JSON code on the web-page that helps search engine robots to analyze the page easier and structure the content for better understanding. When your page has a lot of elements it is hard for search
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 ven dor/google/recaptcha/src/ReCap tcha/RequestMethod/Post.php on line 72
Trace:
<pre>#1 file_get_contents() called at [vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.ph p:72]
#2 ReCaptcha\RequestMethod\Post->submit() called at [vendor/google/recaptcha/src/R eCaptcha/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/Observ er/ReCaptchaObserver.php:93]
#5 MSP\ReCaptcha\Observer\ReCaptchaObserver->execute() called at [vendor/magento/framework/Even t/Invoker/InvokerDefault.php: 72]
#6 Magento\Framework\Event\Invoker\InvokerDefault->_callObserve rMethod() called at [vendor/magento/framework/Even t/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:
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:
app/design/frontend/ThemeVendor/themename/Magefan_Blog/layout/blog_post_view.xml
2. Add this code into it:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="blog.post.relatedproducts" >
<arguments>
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 Heesbeen, Lewis Voncken from experius.nl there was found the security issue.
Note that, no confirmed attacks related to this issue have occurred to date, however, malicious actors potentially were able to login to a customer account in a tiny timeframe after the admin user pressed the "Login As a Customer" button in the admin panel and before admin user was redirected to the storefront and actually logged in.
Timing is really important to reproduce this issue. The security issue may occur on all Login as Customer versions until v2.2.3 during just a few seconds after the pressing of the "Login As a Customer" button.
We encourage everyone who uses Login As Customer extension v2.0.0 - v2.2.2 to update the extension at least to v2.2.3 or apply this quick
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.
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:
<script>
require(['jquery', 'domReady!'], function($) {
setInterval(function(){
$('#blog_search_mini_form .action.search').removeAttr('disabled');
}, 2000);
});
</script>
The "Product Key is empty or invalid. The extension has been automatically disabled." issue appears because of three common reasons. Usually, it's because you use the outdated version of the Magefan_Communty module, you downloaded a free version of the module for Magento Commerce or you use Translation extension v2.2.9.
Let's see what you can do to fix this issue in different cases.
Solution for Magento Open Source (CE)
If you get this error while saving the Magefan extension on the Magento Community edition and don't see any Product Key field, as on the screenshot:
make sure that you have the latest version of the Magefan Community extension.
Note: Magefan Community is not a Magefan Blog or Magefan Login as Customer. It is a separate module that is used together with all Magefan extensions.
To check the version of the Magefan Community extension have a look inside one of these files:
app/code/Magefan/Community/composer.json
app/code/Magefan/Community/etc/module.xml
vendor/magefan/module-community/composer.json
Sometimes instead of the real customer IP address, you can see 127.0.0.1 or some other wrong customer IP in your Magento 2 Admin panel. It can be due to proxies, like Varnish, Cloudflare, Sucuri.net, 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:
app/etc/XIP/di.xml
2. Paste the code:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress">
<arguments>
<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" xsi:type="string">HTTP_CF_CONNECTING_IP</item>
<!-- <item name="x-cf-mfcustom-ip" xsi:type="string">SOME_CUSTOM_SERVER_KEY</item> -->
</argument>
</arguments>
</type>
</config>
3. Save the file,
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 ....
If you have installed or updated Magento 2 extension and received the error message e.g.:
Module 'Company_Module' from 'app/code/Company/Module' has been already defined in 'vendor/company/module'.
this means that you have 2 versions of the extension:
1) in the folder app/code/Company/Module
2) in the folder vendor/company/module
In vendor folder Magento stores all components (extensions, themes, language packages) that have been installed using Composer.
As installing or updating extensions via Composer is preferred, you need to remove the extension folder app/code/Company/Module (please don't forget about a backup before removal) and run installation commands.
If you use Magento 2.2.x or greater and receive the error message:
1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value '\Magento\Framework\View\Element\Text\ListText' is not accepted by the pattern '[A-Z][_a-zA-Z\d]*(\\[A-Z][_a-zA-Z\d]*)*'. Line: 982 Element 'block', attribute 'class': '\Magento\Framework\View\Element\Text\ListText' is not a valid value of the atomic type 'blockClassType'. Line: 982 Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value '\Magento\Framework\View\Element\Text\ListText' is not accepted by the pattern '[A-Z][_a-zA-Z\d]*(\\[A-Z][_a-zA-Z\d]*)*'. Line: 982 Element 'block', attribute 'class': '\Magento\Framework\View\Element\Text\ListText' is not a valid value of the atomic type 'blockClassType'. Line: 982
You need to check all layout files in your theme and custom extensions, they may have a code e.g.:
If you receive the error message "No such entity.", "No such entity with" or "No such entity with customerId" in Magento 2, the issue usually occurred when you try to load not existing object via Magento 2 Repository Class.
To debug this common Magento 2 error, please open the following file:
vendor/magento/framework/Exception/NoSuchEntityException.php
When you update Magento 2, Magento extensions or switching git branches on your dev environment, sometimes you can get the error:
The following modules are outdated: Vendor_Module schema: current version - x.x.x, required version - z.z.z
To solve this issue, please do next:
1. Try to get the latest extension code. Run CLI command in the Magento root directory:
composer install
If you get troubles with running this command, then just skip it, and move to step 2.
2. Try to upgrade your database. Run CLI command:
php bin/magento setup:upgrade
Usually, you get the error bash permission denied when running some script/file that does not have execute permissions. It is one of the most common Magento errors. All you need to do to fix it is to change file permissions and add executive one.
To fix the bash permission denied error follow these steps:
1. Open terminal (shell)
2. Navigate to the folder with the script
3. Run the CLI command to change file permission settings:
chmod +x path_to_file/file_name
For example, if you run a Magento 2 CLI command:
bin/magento ...
and get the error:
bash: bin/magento: Permission denied
You need to add an execute (x) permission to the bin/magento file.