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

No Such Entity With Cart ID #5847

Closed
saderra opened this issue Jul 28, 2016 · 61 comments
Closed

No Such Entity With Cart ID #5847

saderra opened this issue Jul 28, 2016 · 61 comments
Labels
bug report Component: Payment Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@saderra
Copy link

saderra commented Jul 28, 2016

Preconditions

  1. Magento 2.1, upgraded from 2.0.7 Droplet on Digital Ocean

Steps to reproduce

  1. Add products to cart
  2. Proceed to checkout, using Authorize.net DPM (Verified Settings)
  3. Click Checkout

Expected result

  1. Transaction processes, order is created

Actual result

  1. The card is charged, and the response comes back from authorize.net. The charge is verified. However, the error "no such entity with cartid = X" is displayed, and the checkout page remains dimmed with JS spinner.
@saderra
Copy link
Author

saderra commented Aug 4, 2016

Is there any status on this?

@gewaechshaus
Copy link

@saderra - are you working with a multisite setup?

@saderra
Copy link
Author

saderra commented Sep 7, 2016

No, a single store setup. The issue seemed to go away when we ran the Alter database function outlined in several other tickets about checkout not completing.

Jeremy

On Sep 7, 2016, at 4:23 AM, Jan Fervers notifications@github.com wrote:

@saderra https://github.com/saderra - are you working with a multisite setup?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #5847 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AMbuAT1PBGwjubmhaTEY97TpuC4qenDjks5qnp6VgaJpZM4JWw5q.

@gewaechshaus
Copy link

Hi Jeremy,

thx!

@NiteshKuyate
Copy link

NiteshKuyate commented Dec 5, 2016

When i am going to edit order then getting an error like below.
No such entity with cartId = 458.
I have 4 stores in my project.
Order edit works fine for 1 store but for another stores it give above error
and in db for 1 store it inserts 2 rows, for another 4 rows.
I am not getting anything.
Working on multi-site setup.
Plz help me as soon as possible.
Thanks.

@broscodo
Copy link

Any update on this?

@magemanish
Copy link

I'm facing problem in search by category on product listing page after migration from magento 1.6 to magento2.x. Please help me ASAP.

Getting below errors:-

1 exception(s):
Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with id = 3

Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with id = 3
#0 /home/magento2/public_html/vendor/magento/module-catalog/Model/CategoryRepository.php(141): Magento\Framework\Exception\NoSuchEntityException::singleField('id', '3')

Thanks

@vovayatsyuk
Copy link
Member

vovayatsyuk commented May 12, 2017

I have the same error.

Here is a list of requests and responses sent by the browser when I clicked "Place Order":

URL Response
1.guest-carts/..../set-payment-information true
2.authorizenet/directpost_payment/place {"success":true,"authorizenet_directpost":{"fields"...
3.https://test.authorize.net/gateway/transact.dll html with the following script window.location="...authorizenet/directpost_payment/redirect/x_invoice_num/../success/0/controller_action_name/directpost_payment/is_secure/1/
4.authorizenet/directpost_payment/redirect html with following script ... $.when(placeOrderAction({'method': quote.paymentMethod().method}) Template: /app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml
5.guest-carts/.../payment-information {"message":"No such entity with %fieldName = %fieldValue","parameters":{"fieldName":"cartId","fieldValue":"88103"}}

Maybe I'm wrong, but It seems that the order was created and the cart was cleared in step 2
and we can't make any additional requests to this cart (step 5).

@aliuosio
Copy link

Maybe I'm wrong, but It seems that the order was created and the cart was cleared in step 2
and we can't make any additional requests to this cart (step 5).

It seems to me too.
Facing the same problem at the moment.
Did you find a solution for the problem?

@magento-engcom-team magento-engcom-team added bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Sep 11, 2017
@aeu
Copy link

aeu commented Oct 12, 2017

I am seeing the same error on a Magento 2.1.9 install.

@magento-engcom-team magento-engcom-team self-assigned this Nov 27, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Nov 27, 2017
@magento-engcom-team
Copy link
Contributor

Hi @saderra and @aeu
Thanks for reporting this issue.
Unfortunately, I could not reproduce the issue as you described it on 2.1.10 version.
Could you please try to reproduce the issue on 2.1.10 version. May be it was fixed in this version.
Thanks

@magento-engcom-team
Copy link
Contributor

@saderra, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

@kingavi26
Copy link

hi Everyone,

I am having the same issue (magento version 2.2.3)

I get ""no such entity with cartid ="

there is nothing after the = sign.

Was anyone able to track down the cause/cure of this? please help

@aliuosio
Copy link

aliuosio commented May 5, 2018

@kingavi26
Please describe your enviroment and when the error occurs.
Do have and Exception thrown or is it logged in the magento error log?
If you have a full exception please copy & paste it here

have you tried updating to version 2.2.4 to see if this a bug maybe closed in the new magento 2 version?

@kingavi26
Copy link

kingavi26 commented May 6, 2018

The error occurs when trying to checkout via Autho.net direct post, usingc sandbox or live credentials (doesn't matter). I have not tried updating to 2.2.4 as i am afraid that could bring other issues with it like updates often do, specially since we have many customizations.
I am running on PHP 7,

Here is exceptions log related to this error:

[2018-05-05 11:15:06] main.CRITICAL: No such entity with cartId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId =  at /home/emptyvas/2018.emptyvase2/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"} []
[2018-05-05 11:15:52] main.CRITICAL: No such entity with cartId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId =  at /home/emptyvas/2018.emptyvase2/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"} []
[2018-05-05 11:16:54] main.CRITICAL: No such entity with cartId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId =  at /home/emptyvas/2018.emptyvase2/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"} []
[2018-05-05 11:18:43] main.CRITICAL: No such entity with cartId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId =  at /home/emptyvas/2018.emptyvase2/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"} []
[2018-05-05 11:21:15] main.CRITICAL: No such entity with cartId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId =  at /home/emptyvas/2018.emptyvase2/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"} []
[2018-05-05 12:24:11] main.CRITICAL: No such entity with cartId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId =  at /home/emptyvas/2018.emptyvase2/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"} []
[2018-05-05 12:25:29] main.CRITICAL: No such entity with cartId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId =  at /home/emptyvas/2018.emptyvase2/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"} []
[2018-05-05 12:26:31] main.CRITICAL: Please specify a shipping method. {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Please specify a shipping method. at /home/emptyvas/2018.emptyvase2/vendor/magento/module-quote/Model/QuoteValidator.php:100)"} []
[2018-05-05 12:33:13] main.CRITICAL: No such entity with cartId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId =  at /home/emptyvas/2018.emptyvase2/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"} []
[2018-05-05 12:36:55] main.CRITICAL: No such entity with cartId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId =  at /home/emptyvas/2018.emptyvase2/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"} []
[2018-05-06 01:59:53] main.CRITICAL: No such entity with cartId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId =  at /home/emptyvas/2018.emptyvase2/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"} []

@aliuosio
Copy link

aliuosio commented May 6, 2018

check if a cartId is sent back from the Payment Provider.
i think the API called is not sending the CartId back to the shop.
Use your network tools of the browser to see what data comes back to the shop.

@kingavi26
Copy link

capture

This is what i see... also is it normal for session id to keep incrementing by 1 over and over?

@aliuosio
Copy link

aliuosio commented May 6, 2018

this is not a bug. i think its a configuration or a wrong Implementaion of the module provided by the payment provider.
In Screenshot i can not see ann external call.
if is uses the POST method you should only see the parameters sent by click on the call on the overview you posted.
We should move the discussion to anotther forum like stackoverflow

@kingavi26
Copy link

kingavi26 commented May 7, 2018

Ok sure, lets get on stackoverflow

@aeu
Copy link

aeu commented May 7, 2018

Just a suggestion - can you confirm that PHP SOAP is installed?

@kingavi26
Copy link

FIXED

Im my situation, I ended up installing a 3rd party Auth.net payment module, and that worked. I gave up after 2 weeks of trying to find the cause. This works. Im happy.

@OvalMedia
Copy link

OvalMedia commented May 27, 2019

I had the same issue using paypal.
Magento 2.2.8
iways paypal plus module
multisite setup

It was driving me nuts, every time I confirmed the checkout on the paypal site I ended up in the cart with the message "no such entity with cart id =".

Then I tried different browsers (chrome, internet explorer) and there was no issue. This led me to investigate my firefox addons. It turned out that uMatrix is the trouble maker in my case. Even when disabling it for my particular site it caused the error. Only after completely disabling it in the addons the error went away.

@ocadmin81
Copy link

kingavi26, What is the 3rd party Authorize.net payment module you used?
Thanks

@mertgokceimam
Copy link

This issue still existing on Magento 2 Enterprise after 3 years of original report date is unacceptable

@pmsteil
Copy link

pmsteil commented Dec 14, 2019

Here is a suggestion for Magento developers to get to the bottom of this. Make the error message better!

No such entity is not a good error message. It provides no context or detail or suggestion on what could be wrong. Please make this error message better to help all of us!

thanks

@chunsli
Copy link

chunsli commented Feb 28, 2020

I am having the same issue with a Magento 2.3.2 EE, I raised a ticket to Magento support, and here is the reply:

There is a patch currently in Development for this issue. It's currently in the "code review" phase. If that passes, then it will need to pass the "quality assurance" phase before it can be released to the public. 

Unfortunately, I cannot share an ETA for when the patch will be ready. It is important that we test these hotfixes thoroughly to ensure there is no damaging consequences to the rest of the application. 

I will keep you updated as soon as more information becomes available. 

quite ridiculous given that this issue was raised in 2016

@aboutzahurul
Copy link

Getting the same error on checkout page while using latest amasty one step checkout module on Magento 2.3.1 CE, it creates the order successfully but can't create the user account:

Error on frontend checkout success page:
Something went wrong while creating an account. Please contact us so we can assist you.

Error on var/log/exception.log
[2020-02-29 22:23:22] main.CRITICAL: No such entity with cartId = 12850 {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId = 12850 at /home/user/public_html/vendor/magento/framework/Exception/NoSuchEntityException.php:50)"} []

Already tried a few ideas without any luck:

  1. disabling the Dotdigitalgroup_Email module
  2. Checking customer_group table for "NOT LOGGED IN" group.
  3. Checking customer_entity table for columns failures_num, first_failure, lock_expires structures

(amasty don't help unless you renew their module license)
Still struggling to fix the issue...

@saderra chunsli Thanks for sharing, please update us as if there any hope or suggestion...

@aboutzahurul
Copy link

Getting the same error on checkout page while using latest amasty one step checkout module on Magento 2.3.1 CE, it creates the order successfully but can't create the user account:

Error on frontend checkout success page:
Something went wrong while creating an account. Please contact us so we can assist you.

Error on var/log/exception.log
[2020-02-29 22:23:22] main.CRITICAL: No such entity with cartId = 12850 {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId = 12850 at /home/user/public_html/vendor/magento/framework/Exception/NoSuchEntityException.php:50)"} []

Already tried a few ideas without any luck:

  1. disabling the Dotdigitalgroup_Email module
  2. Checking customer_group table for "NOT LOGGED IN" group.
  3. Checking customer_entity table for columns failures_num, first_failure, lock_expires structures

(amasty don't help unless you renew their module license)
Still struggling to fix the issue...

@saderra chunsli Thanks for sharing, please update us as if there any hope or suggestion...

Upgraded Magento 2.3.1 CE to Magento 2.3.4 CE, still the same issue...

@jordanvector
Copy link

jordanvector commented Mar 19, 2020

Still an issue on Magento 2.3.4 EE multi store setup. Exact same issues reported here:

[2020-03-19 18:35:44] report.ERROR: No such entity with cartId = 2433484 {"exception":"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): No such entity with cartId = 2433484 at /app/7alebf6ygqtlm/vendor/magento/framework/Exception/NoSuchEntityException.php:50)"} []

Edit: Heard back from support and they gave me this version for Magento 2.3.4 EE, looks like it should work for previous versions as well. In staging this appears to have resolved the issue for me at least.

https://gist.githubusercontent.com/jordanvector/6594836df8db3ce7c97b7d5f9a54fb9d/raw/c64c3b839118477717657f88b302d0ae81e3a13f/MDVA-6348_EE_2.1.7_COMPOSER_v1.patch

@wbyrnetx
Copy link
Contributor

wbyrnetx commented Mar 20, 2020

This is also happening for us on Magento 2.2.3 many times per day. I was able to log a full stack trace of one of the occurrences.

#0 /srv/weldioc/releases/1583434178/vendor/magento/module-quote/Model/QuoteRepository.php(217): Magento\Framework\Exception\NoSuchEntityException::singleField('cartId', NULL)
#1 /srv/weldioc/releases/1583434178/vendor/magento/module-quote/Model/QuoteRepository.php(121): Magento\Quote\Model\QuoteRepository->loadQuote('loadByIdWithout...', 'cartId', NULL, Array)
#2 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Quote\Model\QuoteRepository->get(NULL)
#3 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Quote\Model\QuoteRepository\Interceptor->___callParent('get', Array)
#4 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Quote\Model\QuoteRepository\Interceptor->Magento\Framework\Interception\{closure}(NULL)
#5 /srv/weldioc/releases/1583434178/generated/code/Magento/Quote/Model/QuoteRepository/Interceptor.php(26): Magento\Quote\Model\QuoteRepository\Interceptor->___callPlugins('get', Array, Array)
#6 /srv/weldioc/releases/1583434178/vendor/magento/module-paypal/Model/Payflow/Service/Response/Transaction.php(107): Magento\Quote\Model\QuoteRepository\Interceptor->get(NULL)
#7 /srv/weldioc/releases/1583434178/vendor/magento/module-paypal/Controller/Transparent/Response.php(85): Magento\Paypal\Model\Payflow\Service\Response\Transaction->savePaymentInQuote(Object(Magento\Framework\DataObject))
#8 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Paypal\Controller\Transparent\Response->execute()
#9 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Paypal\Controller\Transparent\Response\Interceptor->___callParent('execute', Array)
#10 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Paypal\Controller\Transparent\Response\Interceptor->Magento\Framework\Interception\{closure}()
#11 /srv/weldioc/releases/1583434178/generated/code/Magento/Paypal/Controller/Transparent/Response/Interceptor.php(26): Magento\Paypal\Controller\Transparent\Response\Interceptor->___callPlugins('execute', Array, Array)
#12 /srv/weldioc/releases/1583434178/vendor/magento/framework/App/Action/Action.php(107): Magento\Paypal\Controller\Transparent\Response\Interceptor->execute()
#13 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#14 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Paypal\Controller\Transparent\Response\Interceptor->___callParent('dispatch', Array)
#15 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Paypal\Controller\Transparent\Response\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#16 /srv/weldioc/releases/1583434178/generated/code/Magento/Paypal/Controller/Transparent/Response/Interceptor.php(39): Magento\Paypal\Controller\Transparent\Response\Interceptor->___callPlugins('dispatch', Array, Array)
#17 /srv/weldioc/releases/1583434178/vendor/magento/framework/App/FrontController.php(55): Magento\Paypal\Controller\Transparent\Response\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#18 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#19 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#20 /srv/weldioc/releases/1583434178/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#21 /srv/weldioc/releases/1583434178/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))
#22 /srv/weldioc/releases/1583434178/app/code/Amasty/InvisibleCaptcha/Plugin/Predispatch.php(93): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#23 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(135): Amasty\InvisibleCaptcha\Plugin\Predispatch->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#24 /srv/weldioc/releases/1583434178/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#25 /srv/weldioc/releases/1583434178/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))
#26 /srv/weldioc/releases/1583434178/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#27 /srv/weldioc/releases/1583434178/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#28 /srv/weldioc/releases/1583434178/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#29 /srv/weldioc/releases/1583434178/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
#30 /srv/weldioc/releases/1583434178/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#31 {main}

The issue is coming from
vendor/magento/module-paypal/Model/Payflow/Service/Response/Transaction.php

It appears that this is the problematic line of code

$this->sessionTransparent->getQuoteId()

getQuoteId is returning NULL
Screen Shot 2020-03-20 at 2 25 20 PM

@sangthieu
Copy link

@wbyrnetx I have same problem with payflowpro. I found 2 cookies "PHPSESSION" for www and non www domain. It could be make prblem with session. I was make force redirect in nginx to make sure magento create 1 "PHPSESSION" cookies. But that issue comecome few time for me.

@nagarajuk12
Copy link

Hi
I have been facing same issue in the magento2.3.5-P2 please advise

@nagarajuk12
Copy link

nagarajuk12 commented Dec 24, 2020

Hi @jordanvector

Still an issue on Magento 2.3.4 EE multi store setup. Exact same issues reported here:

[2020-03-19 18:35:44] report.ERROR: No such entity with cartId = 2433484 {"exception":"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): No such entity with cartId = 2433484 at /app/7alebf6ygqtlm/vendor/magento/framework/Exception/NoSuchEntityException.php:50)"} []

Edit: Heard back from support and they gave me this version for Magento 2.3.4 EE, looks like it should work for previous versions as well. In staging this appears to have resolved the issue for me at least.

https://gist.githubusercontent.com/jordanvector/6594836df8db3ce7c97b7d5f9a54fb9d/raw/c64c3b839118477717657f88b302d0ae81e3a13f/MDVA-6348_EE_2.1.7_COMPOSER_v1.patch

I have applied the same patch in one my project currently working. But still having the issue can u advise? My M2 version is Magento/2.3 (B2B)

Thanks

@epeets
Copy link

epeets commented Jan 20, 2021

I had this issue today in M2.3.2 and it was stopping me from adding anything to the cart. It was due to bad code in an observer that was observing the checkout_cart_product_add_after event in my custom module. Once I cleaned up the code the error went away. Hopefully, that helps someone dealing with this.

@Aquive
Copy link

Aquive commented Jun 23, 2021

Still present in M2.3.7

@hareshpatel
Copy link

Hello Team,

I am try tu stripe payment used. admin side order place is not working.
Error is : No such entity with cartId

But fronted side work is find can you please help me how to resolve this issue.

@shuffless
Copy link

Having the same issue in 2.4.3.

I have created a multistore setup on a website (2.3.5-p1 with php 7.3) and I get errors in checkout.

The order is placed but the customer still receives the error and then they place it 2-3 times
the checkout requests look like this https://domain.com/en/rest/en/V1/guest-carts/hHibRsXvKrTKfUkRMsLKfhVH0XegQmWk/payment-information but the status returns 404

If you go on the url though there is an exception XML
the error would go like this No such entity with %fieldName = %fieldValue cartId 206168

I created a dev instance for this and upgraded to 2.4.3 (with php 7.4) but the issue persists.

@pppwu
Copy link

pppwu commented Sep 15, 2021

Hi @shuffless
I found that if the SMTP setting is not completed, it will cause the same error as above mentioned, please check the POST request (rest/it/V1/guest-carts/(cartid)/payment-information) instead of GET, you will found that there is still an error in the response even if it returns HTTP200, in my case:

Magento ver. 2.4.2
Request URL: {mydomain}/V1/guest-carts/K7bDWOgP5B7bRMyM2dcBmcxTPiyGIyts/payment-information
Request Method: POST
Status Code: 200
Response Preview

"32"<br />
<b>Fatal error</b>:  Uncaught Laminas\Mail\Protocol\Exception\RuntimeException: Could not read from smtp.sendgrid.net in /home/peter_wu/src/p13m2/vendor/laminas/laminas-mail/src/Protocol/AbstractProtocol.php:309
Stack trace:
#0 /home/peter_wu/src/p13m2/vendor/laminas/laminas-mail/src/Protocol/AbstractProtocol.php(338): Laminas\Mail\Protocol\AbstractProtocol-&gt;_receive()
#1 /home/peter_wu/src/p13m2/vendor/laminas/laminas-mail/src/Protocol/Smtp.php(461): Laminas\Mail\Protocol\AbstractProtocol-&gt;_expect()
#2 /home/peter_wu/src/p13m2/vendor/laminas/laminas-mail/src/Protocol/Smtp.php(500): Laminas\Mail\Protocol\Smtp-&gt;quit()
#3 /home/peter_wu/src/p13m2/vendor/laminas/laminas-mail/src/Protocol/AbstractProtocol.php(105): Laminas\Mail\Protocol\Smtp-&gt;_disconnect()
#4 [internal function]: Laminas\Mail\Protocol\AbstractProtocol-&gt;__destruct()
#5 {main}
  thrown in <b>/home/peter_wu/src/p13m2/vendor/laminas/laminas-mail/src/Protocol/AbstractProtocol.php</b> on line <b>309</b><br />

Hope this will help.

@shuffless
Copy link

shuffless commented Sep 15, 2021

Hope this will help.

Indeed this was the case on my end as well. Thank you for the hint. I believe the debugging on this is really problematic since I lost so many hours trying to figure out what was the issue.

So, the troubleshooting for anyone getting this would be to disable all non-standard modules and try to reactivate and test one by one.

The logs do not provide any hint about the SMTP ... completely unintuitive.

@pppwu thank you for the suggestion.

@JelleGe
Copy link

JelleGe commented Oct 8, 2021

Hope this will help.

Thanks, but how did you solve this issue?

@shuffless
Copy link

Thanks, but how did you solve this issue?

I disabled the plugin that was setting a SMTP gateway (I used something for Amazon SES), then ran update, cleared cache and recompiled.

Once that was ready I did set the native Magento email sending option (https://docs.magento.com/user-guide/system/email-communications.html).

@cjohansson
Copy link

Same issue here with a Magento ver. 2.4.4, I don't understand why this issue is closed

@stratus21-liam
Copy link

@cjohansson me too, did you fix it? I have a live site and staging site. Live was on 2.3.6 having this issue so I upgraded staging to 2.4.4-p2 and still having the same issue. My problem is that it happens with OneStepcheckout and if I disable that module and use the core checkout it works fine.. yet this checkout is used on all my sites with no issues

@cjohansson
Copy link

@wkdcode-liam I have not found a fix for it, the error messages says a cart with a specific ID does not exist even though it exists in the database. In another 2.4.4 I don't encounter this error, I am not sure why. It is possible that the issue is not what it says it is, the error message might be missleading

@cjohansson
Copy link

For example, the error message says No such entity with cartId = 34080
but if I run SQL query

SELECT * FROM quote WHERE entity_id = 3408

I actually find a quote

@cjohansson
Copy link

Ok I solved the issue now, the issue is not what Magento 2 reports, check the XHR log in checkout for other potential issues, in my case a e-mail module failed to send e-mail and that showed the error

@rossparachute
Copy link

Still seeing this on v2.4.5-p1 using the official Stripe module (stripe/stripe-payments) v3.3 running on PHP 8.1.13.

"No such entity with cartId = "

It seems to happen intermittently. We've looked at this for a fair while and it isn't clear exactly why the session appears to be lost (working theory) but it's too often to chalk up to the cart just expiring.

This is in a multi-store setup (two stores).

Example stacktrace:

[2023-02-06T10:58:09.926011+00:00] main.CRITICAL: Magento\Framework\Exception\NoSuchEntityException: No such entity with cartId =  in /vendor/magento/framework/Exception/NoSuchEntityException.php:50
Stack trace:
#0 vendor/magento/module-quote/Model/QuoteRepository.php(238): Magento\Framework\Exception\NoSuchEntityException::singleField()
#1 vendor/magento/module-quote/Model/QuoteRepository.php(136): Magento\Quote\Model\QuoteRepository->loadQuote()
#2 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Quote\Model\QuoteRepository->get()
#3 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Quote\Model\QuoteRepository\Interceptor->___callParent()
#4 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Quote\Model\QuoteRepository\Interceptor->Magento\Framework\Interception\{closure}()
#5 generated/code/Magento/Quote/Model/QuoteRepository/Interceptor.php(23): Magento\Quote\Model\QuoteRepository\Interceptor->___callPlugins()
#6 vendor/magento/module-quote/Model/QuoteRepository.php(168): Magento\Quote\Model\QuoteRepository\Interceptor->get()
#7 generated/code/Magento/Quote/Model/QuoteRepository/Interceptor.php(32): Magento\Quote\Model\QuoteRepository->getActive()
#8 vendor/magento/module-gift-message/Model/CartRepository.php(81): Magento\Quote\Model\QuoteRepository\Interceptor->getActive()
#9 vendor/magento/module-gift-message/Model/GiftMessageConfigProvider.php(172): Magento\GiftMessage\Model\CartRepository->get()
#10/vendor/magento/module-gift-message/Model/GiftMessageConfigProvider.php(113): Magento\GiftMessage\Model\GiftMessageConfigProvider->getOrderLevelGiftMessages()
#11/vendor/magento/module-gift-message/Model/CompositeConfigProvider.php(36): Magento\GiftMessage\Model\GiftMessageConfigProvider->getConfig()
#12/vendor/magento/module-gift-message/Block/Cart/GiftOptions.php(88): Magento\GiftMessage\Model\CompositeConfigProvider->getConfig()
#13/vendor/magento/module-gift-message/view/frontend/templates/cart/gift_options.phtml(21): Magento\GiftMessage\Block\Cart\GiftOptions->getGiftOptionsConfigJson()
#14/vendor/magento/framework/View/TemplateEngine/Php.php(71): include()
#15/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()
#16/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()
#17/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}()
#18/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()
#19/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()
#20/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()
#21/vendor/magento/module-backend/Block/Template.php(141): Magento\Framework\View\Element\Template->_toHtml()
#22/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Backend\Block\Template->_toHtml()
#23/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#24/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#25/vendor/magento/framework/View/Layout.php(578): Magento\Framework\View\Element\AbstractBlock->toHtml()
#26/vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock()
#27/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#28/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#29/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#30/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#31/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#32/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#33/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#34/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#35/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#36/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#37/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#39/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#40/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#41/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#42/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#43/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#44/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#45/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#46/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#47/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#48/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#49/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#50/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#51/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#52/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#53/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#54/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#55/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#56/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#57/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#58/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#59/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#60/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#61/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#62/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#63/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#64/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#65/vendor/magento/framework/View/Layout.php(975): Magento\Framework\View\Layout\Interceptor->renderElement()
#66/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Layout->getOutput()
#67/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Layout\Interceptor->___callParent()
#68/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}()
#69/generated/code/Magento/Framework/View/Layout/Interceptor.php(347): Magento\Framework\View\Layout\Interceptor->___callPlugins()
#70/vendor/magento/framework/View/Result/Page.php(260): Magento\Framework\View\Layout\Interceptor->getOutput()
#71/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render()
#72/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult()
#73/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent()
#74/app/code/Magezon/Core/Plugin/View/Result/Layout.php(24): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}()
#75/vendor/magento/framework/Interception/Interceptor.php(135): Magezon\Core\Plugin\View\Result\Layout->aroundRenderResult()
#76/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}()
#77/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(32): Magento\Framework\View\Result\Page\Interceptor->___callPlugins()
#78/vendor/magento/framework/App/Http.php(120): Magento\Framework\View\Result\Page\Interceptor->renderResult()
#79/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#80/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#81/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#82 {main} [] []

@Raffail
Copy link

Raffail commented Feb 10, 2023

I encountered this issue today after copying a live site to dev environment. Just cleaned a browser cookies for dev site, and everything works fine.

@rossparachute
Copy link

rossparachute commented Feb 10, 2023

@Raffail

Think I might have found it, we wanted to slightly tweak the behaviour of shipping information and gift messaging. So we copied the original method and tweaked the small bit we needed to.

There isn't a null or empty check in the stuff we copied or a try/catch that handles a NoSuchEntityException.

The two lines that threw the error are straight from Magento but in fairness, I should have handled that condition even if the Magento stuff didn't. May well be good reason why they'd want it to fail if no cart id was passed. The logs not showing specifically which interceptor didn't help though.

There's probably a few places where the "No such entity with cart ID = ''" will get thrown.

Like you say, I've seen it happen as well in Magento_Customer etc. when the session id is out of date too.

$quote = $this->quoteRepository->getActive($cartId);

    public function saveAddressInformation(
        $cartId,
        ShippingInformationInterface $addressInformation
    ): PaymentDetailsInterface {
        /** @var Quote $quote */
        $quote = $this->quoteRepository->getActive($cartId); <!--- Might be empty
        ...
   }

$quote = $this->quoteRepository->getActive($cartId);

    public function save($cartId, \Magento\GiftMessage\Api\Data\MessageInterface $giftMessage)
    {
        /**
         * Quote.
         *
         * @var \Magento\Quote\Model\Quote $quote
         */
        $quote = $this->quoteRepository->getActive($cartId); <!-- Might be empty
        ...
    }

@stratus21-liam
Copy link

stratus21-liam commented Feb 21, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Payment Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests