1

When I make the login at the admin page, it redirects me to a page with this written:

1 exception(s):
Exception #0 (Exception): Notice: Undefined offset: 2 in /opt/lampp/htdocs/magenteiro/vendor/magento/framework/Encryption/Encryptor.php on line 591

Exception #0 (Exception): Notice: Undefined offset: 2 in /opt/lampp/htdocs/magenteiro/vendor/magento/framework/Encryption/Encryptor.php on line 591
<pre>#1 Magento\Framework\Encryption\Encryptor->getArgonHash('root123', 'RpGe9HuhfMQxtBhP') called at [vendor/magento/framework/Encryption/Encryptor.php:279]
#2 Magento\Framework\Encryption\Encryptor->isValidHash('root123', '2995c3c04580a77e...') called at [vendor/magento/framework/Encryption/Encryptor.php:266]
#3 Magento\Framework\Encryption\Encryptor->validateHash('root123', '2995c3c04580a77e...') called at [vendor/magento/module-user/Model/User.php:626]
#4 Magento\User\Model\User->verifyIdentity('root123') called at [generated/code/Magento/User/Model/User/Interceptor.php:149]
#5 Magento\User\Model\User\Interceptor->verifyIdentity('root123') called at [vendor/magento/module-user/Model/User.php:598]
#6 Magento\User\Model\User->authenticate('root', 'root123') called at [generated/code/Magento/User/Model/User/Interceptor.php:140]
#7 Magento\User\Model\User\Interceptor->authenticate('root', 'root123') called at [vendor/magento/module-user/Model/User.php:653]
#8 Magento\User\Model\User->login('root', 'root123') called at [generated/code/Magento/User/Model/User/Interceptor.php:158]
#9 Magento\User\Model\User\Interceptor->login('root', 'root123') called at [vendor/magento/module-backend/Model/Auth.php:162]
#10 Magento\Backend\Model\Auth->login('root', 'root123') called at [vendor/magento/framework/Interception/Interceptor.php:58]
#11 Magento\Backend\Model\Auth\Interceptor->___callParent('login', array('root', 'root123')) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#12 Magento\Backend\Model\Auth\Interceptor->Magento\Framework\Interception\{closure}('root', 'root123') called at [vendor/magento/framework/Interception/Interceptor.php:153]
#13 Magento\Backend\Model\Auth\Interceptor->___callPlugins('login', array('root', 'root123'), array(array('security_admin_s...'))) called at [generated/code/Magento/Backend/Model/Auth/Interceptor.php:59]
#14 Magento\Backend\Model\Auth\Interceptor->login('root', 'root123') called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:205]
#15 Magento\Backend\App\Action\Plugin\Authentication->_performLogin(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#) called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:157]
#16 Magento\Backend\App\Action\Plugin\Authentication->_processNotLoggedInUser(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#) called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:125]
#17 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(&Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor#000000001a12184200000000360a945b#, &Closure#000000001a12184100000000360a945b#, &Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#18 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#19 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#), array(array('adminLoadDesign'))) called at [generated/code/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php:32]
#20 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->dispatch(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#) called at [vendor/magento/framework/App/FrontController.php:186]
#21 Magento\Framework\App\FrontController->processRequest(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#, &Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor#000000001a12184200000000360a945b#) called at [vendor/magento/framework/App/FrontController.php:118]
#22 Magento\Framework\App\FrontController->dispatch(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#23 Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', array(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#24 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#25 Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#), array(array('default_store_se...', 'storeCookieValid...', 'install', 'configHash'))) called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#26 Magento\Framework\App\FrontController\Interceptor->dispatch(&Magento\Framework\App\Request\Http#000000001a121a7c00000000360a945b#) called at [vendor/magento/framework/App/Http.php:116]
#27 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#28 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#29 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#000000001a121a4900000000360a945b#) called at [index.php:39]
</pre>

I already tried the pecl install libsodium command, removing the ";" from the sodium extension in php.ini, fresh install and creating another admin user. I'm using php 7.4, magento 2, xampp, apache2 and ubuntu. This is my first time trying to install the magento 2 because I'm still studying, so my project is a fresh install with the samples (did everything using composer).

2

1 Answer 1

1

Please make sure you have installed the sodium php extension

This is common error in Encryptor.php file when you don't enable/install sodium extension.

Installation manual
https://www.php.net/manual/en/sodium.installation.php

Refrence: https://github.com/magento/magento2/issues/23511
https://github.com/magento/magento2/issues/23405

9
  • Thank you, I'll try that, but, how do I install it? The instructions are kinda unclear, didn't understand well...
    – Jhonny
    Oct 28, 2020 at 16:36
  • Yes, you are right, that was unclear Oct 28, 2020 at 16:45
  • You can try this: lukasmestan.com/install-libsodium-extension-in-php7 Oct 28, 2020 at 16:45
  • when I try the "sudo echo "extension = sodium.so" > /etc/php/7.4/mods-available/sodium.ini" it says that I don't have permission. I checked inside the mods-available folder the sodium.ini doesn't exist
    – Jhonny
    Oct 28, 2020 at 16:55
  • 1
    The issue in this case was indeed with sodium so this answer should be accepted. The problem is that sodium was loaded properly in CLI context but not in apache context. Reinstalling via PECL and adding extension="<path_to_sodium>" on the correct php.ini was enough to fix the issue. If you could add it to your answer for other users it would help to clarify that they should be seeing the sodium section in their phpinfo on the webserver context.
    – gabtzi
    Oct 29, 2020 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.