magento / magento/data-migration-tool

Customer Login get the Error: Call to a member function getId() on null in vendor\magento\data-migration-tool\src\Migration\Model\PasswordHashResolver.php:44

Open
#922 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
339
Forks
195
PR merge metrics
No merged PRs in 30d

Description

### Preconditions

1. Magento 2.4.6-p4
2. PHP 8.1.17

### Steps to reproduce

1.
2.
3.

### Expected result

1. no error

### Actual result

Customer login fail, but the errors as below
Error: Call to a member function getId() on null in E:\XAMPP\htdocs\blb246\vendor\magento\data-migration-tool\src\Migration\Model\PasswordHashResolver.php:44
Stack trace:
#0 E:\XAMPP\htdocs\blb246\vendor\magento\data-migration-tool\src\Migration\Plugin\Customer\Model\AuthenticationPlugin.php(79): Migration\Model\PasswordHashResolver->resolve(Object(Magento\Customer\Model\Customer\Interceptor))
#1 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(121): Migration\Plugin\Customer\Model\AuthenticationPlugin->beforeAuthenticate(Object(Magento\Customer\Model\Authentication\Interceptor), '8687', 'Cxf451787266')
#2 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Customer\Model\Authentication\Interceptor->Magento\Framework\Interception\{closure}('8687', 'Cxf451787266')
#3 E:\XAMPP\htdocs\blb246\generated\code\Magento\Customer\Model\Authentication\Interceptor.php(50): Magento\Customer\Model\Authentication\Interceptor->___callPlugins('authenticate', Array, Array)
#4 E:\XAMPP\htdocs\blb246\vendor\magento\module-customer\Model\AccountManagement.php(634): Magento\Customer\Model\Authentication\Interceptor->authenticate('8687', 'Cxf451787266')
#5 E:\XAMPP\htdocs\blb246\generated\code\Magento\Customer\Model\AccountManagement\Interceptor.php(50): Magento\Customer\Model\AccountManagement->authenticate('495320721@qq.co...', 'Cxf451787266')
#6 E:\XAMPP\htdocs\blb246\vendor\magento\module-customer\Controller\Account\LoginPost.php(191): Magento\Customer\Model\AccountManagement\Interceptor->authenticate('495320721@qq.co...', 'Cxf451787266')
#7 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Customer\Controller\Account\LoginPost->execute()
#8 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Customer\Controller\Account\LoginPost\Interceptor->___callParent('execute', Array)
#9 E:\XAMPP\htdocs\blb246\vendor\magento\module-customer\Controller\Plugin\Account.php(64): Magento\Customer\Controller\Account\LoginPost\Interceptor->Magento\Framework\Interception\{closure}()
#10 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(135): Magento\Customer\Controller\Plugin\Account->aroundExecute(Object(Magento\Customer\Controller\Account\LoginPost\Interceptor), Object(Closure))
#11 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Customer\Controller\Account\LoginPost\Interceptor->Magento\Framework\Interception\{closure}()
#12 E:\XAMPP\htdocs\blb246\generated\code\Magento\Customer\Controller\Account\LoginPost\Interceptor.php(41): Magento\Customer\Controller\Account\LoginPost\Interceptor->___callPlugins('execute', Array, Array)
#13 E:\XAMPP\htdocs\blb246\vendor\magento\framework\App\Action\Action.php(111): Magento\Customer\Controller\Account\LoginPost\Interceptor->execute()
#14 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#15 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Customer\Controller\Account\LoginPost\Interceptor->___callParent('dispatch', Array)
#16 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Customer\Controller\Account\LoginPost\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#17 E:\XAMPP\htdocs\blb246\generated\code\Magento\Customer\Controller\Account\LoginPost\Interceptor.php(50): Magento\Customer\Controller\Account\LoginPost\Interceptor->___callPlugins('dispatch', Array, Array)
#18 E:\XAMPP\htdocs\blb246\vendor\magento\framework\App\FrontController.php(245): Magento\Customer\Controller\Account\LoginPost\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#19 E:\XAMPP\htdocs\blb246\vendor\magento\framework\App\FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse(Object(Magento\Customer\Controller\Account\LoginPost\Interceptor), Object(Magento\Framework\App\Request\Http))
#20 E:\XAMPP\htdocs\blb246\vendor\magento\framework\App\FrontController.php(147): Magento\Framework\App\FrontController->processRequest(Object(Magento\Framework\App\Request\Http), Object(Magento\Customer\Controller\Account\LoginPost\Interceptor))
#21 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#22 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#23 E:\XAMPP\htdocs\blb246\vendor\magento\module-store\App\FrontController\Plugin\RequestPreprocessor.php(99): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#24 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#25 E:\XAMPP\htdocs\blb246\vendor\magento\module-page-cache\Model\App\FrontController\BuiltinPlugin.php(75): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#26 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#27 E:\XAMPP\htdocs\blb246\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#28 E:\XAMPP\htdocs\blb246\generated\code\Magento\Framework\App\FrontController\Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)
#29 E:\XAMPP\htdocs\blb246\vendor\magento\framework\App\Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#30 E:\XAMPP\htdocs\blb246\generated\code\Magento\Framework\App\Http\Interceptor.php(23): Magento\Framework\App\Http->launch()
#31 E:\XAMPP\htdocs\blb246\vendor\magento\framework\App\Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#32 E:\XAMPP\htdocs\blb246\pub\index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#33 {main}

### Additional notes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with vendor/magento/data-migration-tool/src/Migration/Model/PasswordHashResolver.php at line 44 and trace its call from src/Migration/Plugin/Customer/Model/AuthenticationPlugin.php line 79. Reproduce the customer login failure using Magento 2.4.6-p4 and PHP 8.1.17, then determine why the customer-related value is null. Done means customer login no longer throws the reported getId() error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.