Not supported cipher version
-
13-02-2021 - |
Question
I'm running into an issue on Magento 2.2.7 after a failed rollback from 2.3
Exception: Not supported cipher version in /vendor/magento/framework/Encryption/Encryptor.php:135
Current PHP version is 7.1. I've tried 7 and 7.2
I've cleared var/cache
and var/page_cache
How can I clear this error please?
La solution
In my case this came from an inconsistency between magento version of DB and Source.
I had a 2.3.0 database with a 2.2.6 code.
Autres conseils
If you run code for Magento 2.2.x on a Magentyo 2.3.x database then some of the encrypted strings in table core_config_data might use a cipher that is not available in Magento 2.2.x
In Magento 2.2.x you have three cipher methods numbered from 0 to 2. Magento 2.3 support more chipher methods.
If you run:
select * from core_config_data where value like '%0:3:%'
then you can see if the database contain any config settings that Magento 2.2.x can not decrypt.
In my case I had a Magento 2.2.6 database except for the core_config_data that came from a Magento 2.3.1 database. I could just delete those strings and lose those settings.
update core_config_data set value = '' where value like '%0:3:%'
Similar to others, I experienced this problem while upgrading from 2.2.8 to 2.3.1 and in my case, I needed to restart php-fpm and nginx to fix it. I use an automated build tool that creates versioned directories to deploy Magento to. So while the database base was upgraded to 2.3.1, due to caching within php-fpm/nginx, the web server still pointed to the older 2.2.8 (i.e. previous version) release folder.
I've come across with this problem today when I imported a Magento 2.3.2 database in a Magento 2.2.9 code.
So, I updated the Magento from 2.2.9 to version 2.3.2 following Magento 2.3 docs: https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html
After that, you need to refresh the cache. In my case I use Redis, so I typed on the terminal the command redis-cli flushall
and Magento is working fine now.
You need to revert the changes in the etc/config.php
and etc/env.php
file. And clear all cache.
It will resolve the issue.