Skip to content
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

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

Closed
4 tasks
markshust opened this issue Nov 11, 2021 · 3 comments
Closed
4 tasks

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

markshust opened this issue Nov 11, 2021 · 3 comments

Comments

@markshust
Copy link
Contributor

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”.
@m2-assistant
Copy link

m2-assistant bot commented Nov 11, 2021

Hi @markshust. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@xmav
Copy link
Contributor

xmav commented Nov 11, 2021

Hi @markshust
Please be informed that platform-health holds "work-in-progress" type of code. We are actively working on fixing PHP8.1 compatibility issues and stabilize tests on that branch. We don't expect to deliver changes from that branch to 2.4-develop until that work finished.
That specific issue from your report already fixed(along with a set of other issues) and is waiting for extra code review before delivery
Feel free to contact me if you have questions or need more information

Thanks,
Maksym

@markshust
Copy link
Contributor Author

Thanks for the update @xmav. Is it safe to say that bugs should never get submitted to the platform-health branch then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants