cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.1 Magento\framework\Exception\NosuchEntityException: No such entity with customerId =

Magento 2.3.1 Magento\framework\Exception\NosuchEntityException: No such entity with customerId =

 

I have a problem with Magento 2.3, when I use X-debug on the checkout part, I have the following exception :

Exception has occured.
Magento\framework\Exception\NosuchEntityException: No such entity with customerId =

So far nothing that much surprising, basic so detail exception from Magento so looking for solution and hop a solution : https://magefan.com/blog/no-such-entity-fix-for-magento-2 (or more exactly as solution to see where is the problem)

So ok let add :

 foreach (debug_backtrace() as $_stack) {        echo ($_stack["file"] ? $_stack["file"] : '') . ':' .
            ($_stack["line"] ? $_stack["line"] : '') . ' - ' .
            ($_stack["function"] ? $_stack["function"] : '');
     }
    exit();

And TaDa :

Exception has occured. Exception: Notice: Undefined index: file in /var/www/mywebsite/magento/framework/Exception/NoSuchEntityException.php on line 37

So of course this come from the file modified according to https://magefan.com/blog/no-such-entity-fix-for-magento-2 and line 37 is

        echo ($_stack["file"] ? $_stack["file"] : '') . ':' .

Already done :

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

-sudo php bin/magento setup:upgrade

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

-sudo php php bin/magento setup:di:compile

Also in database:

UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';

and

SET FOREIGN_KEY_CHECKS=0;UPDATE `store` SET store_id = 0 WHERE code='admin';UPDATE `store_group` SET group_id = 0 WHERE name='Default';UPDATE `store_website` SET website_id = 0 WHERE code='admin';UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';SET FOREIGN_KEY_CHECKS=1;

Nothing change.
Someone has a solution to solve it ?

4 REPLIES 4

Re: Magento 2.3.1 Magento\framework\Exception\NosuchEntityException: No such entity with customerId

Hey @sylvain_michel 

 

You'll get more idea from the below link:

https://github.com/magento/magento2/issues/23411

 

Thanks.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

Re: Magento 2.3.1 Magento\framework\Exception\NosuchEntityException: No such entity with customerId

Hello @Meetanshi ,

 

Then no way to make it work ? because it lock  my place order function which is kind of critical

Re: Magento 2.3.1 Magento\framework\Exception\NosuchEntityException: No such entity with customerId

Hey, @sylvain_michel  again!

 

When we faced the same issue, we disabled the guest checkout.

It resolved the issue for us.

 

I hope it helps you too!

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

Re: Magento 2.3.1 Magento\framework\Exception\NosuchEntityException: No such entity with customerId

@Meetanshi,

 

Then you mean be able to checkout only when connected and user have an account ?