I can get to the login page, but as I am trying to login, I am getting this error:

Fatal error: Uncaught Error: Call to a member function getNext() on null in /home/geekcoreco/public_html/generated/code/Magento/User/Model/User/Interceptor.php:529 Stack trace:

#0 /home/geekcoreco/public_html/vendor/magento/module-backend/Model/Locale/Manager.php(96): Magento\User\Model\User\Interceptor->getInterfaceLocale() 
#1 /home/geekcoreco/public_html/vendor/magento/module-backend/Model/Locale/Resolver.php(77): Magento\Backend\Model\Locale\Manager->getUserInterfaceLocale() 
#2 /home/geekcoreco/public_html/vendor/magento/framework/Locale/Resolver.php(65): Magento\Backend\Model\Locale\Resolver->setLocale(NULL) 
#3 /home/geekcoreco/public_html/vendor/magento/module-backend/Model/Locale/Resolver.php(60): Magento\Framework\Locale\Resolver->__construct(Object(Magento\Framework\App\Config), 'general/locale/...', 'store', NULL) 
#4 /home/geekcoreco/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Backend\Model\Locale\Resolver->__construct(Object(Magento\Framework\App\Config), 'general in /home/geekcoreco/public_html/generated/code/Magento/User/Model/User/Interceptor.php on line 529

I've tried everything, I'm a bit lost now. Any help would be very much appreciated. FYI the module I recently installed is Magstore Google Shopping module.

Running Magento v2.2.5

  • Disable the module doesn't help? – PY Yick Oct 11 '18 at 2:49
  • Just run php bin/magento setup:di:compile command then error still showing then search for getNext() funtion its getting null data so just add condition before that function for if(!empty(data)) then call that function – Mukesh Prajapati Oct 11 '18 at 5:19

Please run all the below commands:

rm -rf generated/* var/cache/* var/page_cache/*

php bin/magento s:up

php bin/magento s:s:d -f

php bin/magento c:c

php bin/magento c:f

and check

| improve this answer | |

It is because your last deployment is having different (old) code there into your generated & cache folders it happens sometime that the generated code & the code into view_processed folder doesn't get overwritten. It is because of the old dependency injection so, whenever you are installing the modules with new dependency injection i.e. some changes with the di.xml files then must remove the old dependency files & let the Magento rebuild/regenerate the new files with the latest dependency injection.

To achieve this please run the below commands from the directory of your magento_root from the terminal.

   rm -rf generated/ var/view_preprocessed/ var/composer_home/cache/
var/cache/ var/page_cache/

php bin/magento maintenance:enable

php bin/magento setup:upgrade

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy -f

php bin/magento maintenance:disable

php bin/magento cache:flush

Or you can run the above commands with their abbreviated versions as follows.

php bin/magento ma:e  

php bin/magento s:up

php bin/magento s:d:c

php bin/magento s:s:d -f

php bin/magento ma:d

php bin/magento c:f
| improve this answer | |
  • Hi There, I tried the above, but I get the following error: rm: cannot remove `generated/code/Magento/Framework': Directory not empty Any more ideas? – Tedthe0ne Oct 18 '18 at 11:59
  • Your generated folder is not get deleted please delete it completely or comment it by simply adding extra character at the suffix or prefix like -> generated__ or __generated & retry with the above 4 deployment commands! – Abhishek Tripathi Oct 18 '18 at 12:12
  • Hi, I deleted Generated using FTP, then ran the commands. However I get the following error when running the Compile command. The directory "/home/geekcoreco/public_html/generated/code/Magento/Framework" cannot be deleted Warning!rmdir(/home/geekcoreco/public_html/generated/code/Magento/Framework): Directory not empty – Tedthe0ne Oct 18 '18 at 12:27
  • Okay so delete the folder & run the compile command first then the upgrade command – Abhishek Tripathi Oct 18 '18 at 12:35
  • 1
    Aha! It worked! I needed to enter Maintenance mode. That was all. Thank you so much! – Tedthe0ne Oct 18 '18 at 13:07

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.