magento2: Can't login to frontend after upgrading to 2.4.0
Preconditions (*)
- Shop in Developer mode
- PHP 7.4.9
- PHP Module “Sodium” is installed.
- libsodium is installed with version 1.0.18
Steps to reproduce (*)
- Upgrade shop from EE 2.3.5-p2 to EE 2.4.0
- Disable Module “Magento_TwoFactorAuth” (not sure if it makes a difference, but I mention all steps I made)
- Try to login to frontend as customer.
Expected result (*)
- Login should work
Actual result (*)
- Notice: Undefined offset: 2 in /home/x/y/vendor/magento/framework/Encryption/Encryptor.php on line 591
- An unspecified error occurred. Please contact us for assistance.

Appearing after modifying vendor\magento\module-customer\Controller\Account\LoginPost.php to make it show more details by adding this code:
$message = $e->getMessage();
$this->messageManager->addError($message);
before
$this->messageManager->addErrorMessage(
__('An unspecified error occurred. Please contact us for assistance.')
);
I tried clearing the browser cache and cookies, but it did not helped.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 29 (15 by maintainers)
@mrtuvn: no idea, we are holding off with upgrading to Magento 2.4.0 / PHP 7.4 until Magento becomes a bit more stable. We’ll probably start using it when 2.4.1 or 2.4.2 is out, it’s too unstable now to start using it in my opinion.
If I run into this within some months, I can take a look, but it sounds like Eddcapone is already debugging it a bit, so maybe he’ll find the root cause.
@hostep Oh, I see. Thx! 👍
Yes, but that’s using php-cli, not php invoked by the webserver, which can give you different results 🙂
Ok thanks for the info Ihor!
@Eddcapone: based on your previous comment, if i have to guess, the sysadmins installed the sodium php extension but probably forgot to restart php-fpm (or your webserver), hence why php-cli reported it was installed but when using php in the webserver context it still didn’t see it. A better way to verify if it was installed, is to create a dummy php file with
<?php phpinfo();as contents and requesting it via the webserver. Then see if sodium is being reported as installed (and make sure libsodium is at least version 1.0.13). Should show you something like this:@Eddcapone one more workaround - you could add following param to your env.php, and it will generate static files automatically, similar to developer mode 😃
More info here: https://devdocs.magento.com/cloud/env/variables-global.html#scd_on_demand
@ihor-sviziev Thats no option because it is a developer environment and I would need to deploy static files every time. But I stay at PHP 7.3 until it is fixed.
Are you using developer magento mode ?
On Mon, 14 Sep 2020 at 14:17 Eddcapone notifications@github.com wrote:
The admins just installed sodium, now I get:
But the login still fails with
So I switched back to PHP 7.3 again.
@Eddcapone could you provide output of the following command?
I have following output and seems like everything works fine: