Skip to content

Type error when attempting to log in to admin with PHP 8.1 #34618

Closed
@markshust

Description

@markshust

Preconditions (*)

  1. Magento 2 on the platform-health branch (head at 6e8850b)
  2. docker-magento running markoshust/magento-php:8.1-fpm-develop PHP image (based on php:8.1.0RC5-fpm-buster)

Steps to reproduce (*)

  1. Attempt to login to admin at /admin or appropriate admin URI

Expected result (*)

  1. Login completes successfully.

Actual result (*)

  1. The following error is dumped to the screen:
TypeError: Magento\Security\Model\UserExpirationManager::isUserExpired(): Argument #1 ($userId) must be of type string, int given, called in /var/www/html/app/code/Magento/Security/Observer/AdminUserAuthenticateBefore.php on line 59 and defined in /var/www/html/app/code/Magento/Security/Model/UserExpirationManager.php:139
``` TypeError: Magento\Security\Model\UserExpirationManager::isUserExpired(): Argument #1 ($userId) must be of type string, int given, called in /var/www/html/app/code/Magento/Security/Observer/AdminUserAuthenticateBefore.php on line 59 and defined in /var/www/html/app/code/Magento/Security/Model/UserExpirationManager.php:139 Stack trace: #0 /var/www/html/app/code/Magento/Security/Observer/AdminUserAuthenticateBefore.php(59): Magento\Security\Model\UserExpirationManager->isUserExpired(1) #1 /var/www/html/lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php(88): Magento\Security\Observer\AdminUserAuthenticateBefore->execute(Object(Magento\Framework\Event\Observer)) #2 /var/www/html/lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php(74): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\Security\Observer\AdminUserAuthenticateBefore), Object(Magento\Framework\Event\Observer)) #3 /var/www/html/lib/internal/Magento/Framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer)) #4 /var/www/html/generated/code/Magento/Framework/Event/Manager/Proxy.php(95): Magento\Framework\Event\Manager->dispatch('admin_user_auth...', Array) #5 /var/www/html/app/code/Magento/User/Model/User.php(593): Magento\Framework\Event\Manager\Proxy->dispatch('admin_user_auth...', Array) #6 /var/www/html/generated/code/Magento/User/Model/User/Interceptor.php(140): Magento\User\Model\User->authenticate('john.smith', 'password123') #7 /var/www/html/app/code/Magento/User/Model/User.php(653): Magento\User\Model\User\Interceptor->authenticate('john.smith', 'password123') #8 /var/www/html/generated/code/Magento/User/Model/User/Interceptor.php(158): Magento\User\Model\User->login('john.smith', 'password123') #9 /var/www/html/app/code/Magento/Backend/Model/Auth.php(162): Magento\User\Model\User\Interceptor->login('john.smith', 'password123') #10 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Backend\Model\Auth->login('john.smith', 'password123') #11 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Backend\Model\Auth\Interceptor->___callParent('login', Array) #12 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Backend\Model\Auth\Interceptor->Magento\Framework\Interception\{closure}('john.smith', 'password123') #13 /var/www/html/generated/code/Magento/Backend/Model/Auth/Interceptor.php(59): Magento\Backend\Model\Auth\Interceptor->___callPlugins('login', Array, Array) #14 /var/www/html/app/code/Magento/Backend/App/Action/Plugin/Authentication.php(207): Magento\Backend\Model\Auth\Interceptor->login('john.smith', 'password123') #15 /var/www/html/app/code/Magento/Backend/App/Action/Plugin/Authentication.php(159): Magento\Backend\App\Action\Plugin\Authentication->_performLogin(Object(Magento\Framework\App\Request\Http)) #16 /var/www/html/app/code/Magento/Backend/App/Action/Plugin/Authentication.php(127): Magento\Backend\App\Action\Plugin\Authentication->_processNotLoggedInUser(Object(Magento\Framework\App\Request\Http)) #17 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #18 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #19 /var/www/html/generated/code/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php(32): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array) #20 /var/www/html/lib/internal/Magento/Framework/App/FrontController.php(245): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #21 /var/www/html/lib/internal/Magento/Framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse(Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Object(Magento\Framework\App\Request\Http)) #22 /var/www/html/lib/internal/Magento/Framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest(Object(Magento\Framework\App\Request\Http), Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor)) #23 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http)) #24 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array) #25 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #26 /var/www/html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array) #27 /var/www/html/lib/internal/Magento/Framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #28 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch() #29 /var/www/html/lib/internal/Magento/Framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch() #30 /var/www/html/pub/index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor)) #31 {main} ```

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • [ X ] 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”.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions