cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 setup:upgrade error - Upgrade from 2.2.8 to 2.3.3

Magento 2 setup:upgrade error - Upgrade from 2.2.8 to 2.3.3

 

I got this error after run setup:upgrade

 

Unable to apply data patch Magento\EncryptionKey\Setup\Patch\Data\SodiumChachaPatch for module Magento_EncryptionKey. Original exception message: Init vector must be a string of 32 bytes.

 

Steps:

https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html

 

8 REPLIES 8

Re: Magento 2 setup:upgrade error - Upgrade from 2.2.8 to 2.3.3

Hi @alexis_turruell,

Make sure that you have installed install the sodium php extension.

For reference: 
https://github.com/magento/magento2/issues/23405

I hope it will help you!

Re: Magento 2 setup:upgrade error - Upgrade from 2.2.8 to 2.3.3

I installed

php-pecl-libsodium2 x86_64 2.0.22-1.el7.remi.7.1

 

the error persist:

Module 'Magento_EncryptionKey':
Unable to apply data patch Magento\EncryptionKey\Setup\Patch\Data\SodiumChachaPatch for module Magento_EncryptionKey. Original exception message: Init vector must be a string of 32 bytes.

 

Re: Magento 2 setup:upgrade error - Upgrade from 2.2.8 to 2.3.3

Have you restrarted the server after installing extension?

Re: Magento 2 setup:upgrade error - Upgrade from 2.2.8 to 2.3.3

Yes, I did. Nothing.

Re: Magento 2 setup:upgrade error - Upgrade from 2.2.8 to 2.3.3

@alexis_turruell  If not the libsodium then it could be redis. Try cleaning the redis cache.

 

composer require magento/product-community-edition 2.3.x --no-update (You already did this)
composer update
rm -rf var/di/* var/generation/* var/cache/* var/page_cache/*
redis-cli flushdb
php bin/magento setup:upgrade
- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: Magento 2 setup:upgrade error - Upgrade from 2.2.8 to 2.3.3

Yes I did before (composer, Clear the var/ and generated/ subdirectories:, redis-cli flush).

redis-cli flushdb => Ok

 

but the error persist.

Module 'Magento_EncryptionKey':
Unable to apply data patch Magento\EncryptionKey\Setup\Patch\Data\SodiumChachaPatch for module Magento_EncryptionKey. Original exception message: Init vector must be a string of 32 bytes.

 

Re: Magento 2 setup:upgrade error - Upgrade from 2.2.8 to 2.3.3

You should check in file: app/etc/env.php

Look at "Crypt" -> Key have to have 32 characters.

 

Re: Magento 2 setup:upgrade error - Upgrade from 2.2.8 to 2.3.3

yes, crypt => key has 32 characters, Whats wrong?