-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.3.2 installed and bin/magento setup:upgrade not working #23405
Comments
Hi @pmsteil. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @pmsteil do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
@pmsteil: you'll probably need to install the sodium php extension It's a bit annoying they haven't added it to the dependencies in the This is also mentioned in the release notes:
But apparently it is possible to install Magento 2.3.2 without libsodium? 😛 |
@hostep thanks! Any clues as to how to install these two from the command line on macos/linux? Thanks! |
I'm afraid you'll have to figure this out yourself as it depends on which package manager you are using. I personally am using Macports on macOS as package manager, and over there that extension is available with the name |
Ok. I am actually using docker if anyone can provide some help, it would be appreciated, thanks. |
Probably something like: FROM debian:stretch-slim
RUN apt-get update && \
apt-get install --yes \
apt-transport-https \
lsb-release \
ca-certificates \
wget && \
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list && \
apt-get update && \
apt-get dist-upgrade --yes && \
apt-get install --yes \
php7.1-fpm \
php-sodium Demo:
Takeaways:
(Worked out in conjunction with MageMojo Fam ♥ your mileage may vary) |
Hi @engcom-Charlie. Thank you for working on this issue.
|
Apparently if you disable the libsodium php extension, it will fallback on SHA-256 and won't break Magento. |
Hi guys same issue but sodium is installed. Any ideas? root@95c980598c59:/var/www/live# php -i | grep sodium php > echo SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13; Warning: Use of undefined constant SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13 - assumed 'SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13' (this will throw an Error in a future version of PHP) in php shell code on line 1 |
@cows-magento: according to the release notes I quoted above, you need at least version 1.0.13 of libsodium. So that might be the problem here. |
@matei: indeed, good point, didn't notice that before! But the check they implemented in https://github.com/magento/magento2/blob/2.3.2/lib/internal/Magento/Framework/Encryption/Encryptor.php#L165-L167 should probably be changed so it also checks the libsodium version, or check if that constant |
@hostep I am running docker on latest php7.2.19 and it installs version 1.0.11 by default do you have any idea how to force an update by default? |
The following docker snippet has worked for me:
|
Hello @pmsteil ! Thank you for your report ! |
Re-opening because @engcom-Charlie doesn't seem to be reading all the comments :) @engcom-Charlie: try to run Magento 2.3.2 where php-sodium extension is installed but libsodium's version is < 1.0.13 |
Manual testing scenarios
Expected result: Magento DB should upgrade correctly
|
I've prepared a PR, once 2.3-develop is updated with 2.3.2 I will submit it |
✅ Confirmed by @engcom-Charlie Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Note that there is a more "official" way to get the updated Docker steps:
UPDATE: I noticed there is an issue with the PHP 7.1 docker image not working with the above. In this case, you can also use PECL to install the PHP extension and enable it manually with:
|
Hello. I just extract Magento 2.3.2 to my web, expected could upgrade to 2.3.2 from 2.3.1 Thanks |
For CentOS 7 and PHP 7.1, make sure to also install distribution packages 'libsodium' and 'libsodium-devel' before running the PECL command. |
hi @evs-xsarus thanks for help. Hi there, php scriptname type: /home/xxxxxxx/public_html/php scriptname Please let us know if there is anything further we can do for you. Best Regards Note: xxxxxx is username your hosting. Example: It work for me. If still confuse, ask your hosting. |
I had the following problem in a gitlab ci runner during deployment:
These 3 lines solved my problem (thank you @markshust):
see also https://github.com/markshust/docker-magento/blob/master/images/php/7.2/Dockerfile#L33-L38 |
Cloud Users - You can use this patch on 2.3.2 to fix this issue without waiting on a support ticket. diff --git a/vendor/magento/framework/Encryption/Encryptor.php b/vendor/magento/framework/Encryption/Encryptor.php
index 4bc1b2589362..4bb4bba9d11f 100644
--- a/vendor/magento/framework/Encryption/Encryptor.php
+++ b/vendor/magento/framework/Encryption/Encryptor.php
@@ -162,7 +162,7 @@ public function __construct(
*/
public function getLatestHashVersion(): int
{
- if (extension_loaded('sodium')) {
+ if (extension_loaded('sodium') && defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13')) {
return self::HASH_VERSION_ARGON2ID13;
}
|
For those interested: none of the above solutions worked for me in my Docker setup. What eventually did work, was compiling libsodium manually:
|
Based on this article: https://community.magento.com/t5/Magento-DevBlog/Required-libsodium-upgrade-for-latest-Magento-release/ba-p/134808 and this issue: magento/magento2#23405. We should add the library.
Based on: this article: https://community.magento.com/t5/Magento-DevBlog/Required-libsodium-upgrade-for-latest-Magento-release/ba-p/134808 this issue: magento/magento2#23405. We should add the `sodium` library.
Didn't try kanduvisla solution but this works for me with php 7.2
|
The multiple "already defined constant" warnings are related to paragonie/sodium_compat lib. It was reported and fixed as described there on #107. It was fixed on paragonie's project on Nov 8, and published on the release 1.12.1. Basically if you installed Magento 2 recently you may not have this problem regardless your libsodium version. Going deeperThe paragonie includes those constants based on the existence of Quick fixUpdate your paragonie/sodium_compat with |
Preconditions (*)
Steps to reproduce (*)
composer require magento/product-community-edition:~2.3.2 --no-update
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento indexer:reindex
bin/magento cache:flush
Expected result (*)
Actual result (*)
The text was updated successfully, but these errors were encountered: