-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Invalid address id at check out #23618
Comments
Hi @onepack. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @onepack do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @krishprakash. Thank you for working on this issue.
|
@magento give me 2.3-develop instance |
Hi @krishprakash. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @krishprakash, here is your Magento instance. |
Hi @onepack. |
Hi @krishprakash , I tried to reproduce the same but was not able to. But for now, is there anyone that can explain what is happening to that account and why I get this error on it? |
Please feel free to reopen the issue if you reproduce on venilla instance. |
I have this issue randomly on 2.3.1 Test customer account with several saved addresses from testing the checkout, try to use one to checkout today, "Invalid customer address ID ..." |
I can confirm that this is also happening at random in a commerce 2.3.2 version |
@magento give me 2.3-develop instance |
Hi @amanuni. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @amanuni, here is your Magento instance. |
It seems like this issue related to the customer id is missing. Here is how it can be fixed locally: #23908 (comment) |
The root cause is not yet clear but a solution for customers experiencing this issue is here: |
I also have this issue with my test account in M 2.3.2. I don't know the root cause for it, so i added a work around for it as: public function validateForCart(CartInterface $cart, AddressInterface $address): void
{
$this->doValidate($address, $cart->getCustomerIsGuest() ? null : $cart->getCustomer()->getId());
} to: public function validateForCart(CartInterface $cart, AddressInterface $address): void
{
$this->doValidate($address, $cart->getCustomerId() ? $cart->getCustomer()->getId() : null );
} Please let me know its fine this change or any other patch are available for this. |
I added it below mention code at beginning of doValidate function. if(!$customerId){
if($address->getCustomerId()){
$customerId = $address->getCustomerId();
}
} And its seems working fine. |
Steps to reproduce:
When we check the quote table.
|
The cause is that the shopping cart has customer_is_guest = 1. I suspect logging in should set customer_is_guest to 0 but doesn't or not always at least. I don't know about you guys, but I guess I'm going to write another bugfix plugin. |
@arnoutvreugdenhil I have the same problem and setting customer_is_guest to 0 fixes it. It is sporadic and seems to be related to the persistent cart. |
Does anyone know how this is happening? I have some customers with that issue. No guest orders allowed - everyone need to register. So maybe theres an issue in the quote conversion after logging in? Occured in 2.3.2 - is it fixed in 2.3.3? |
In my case I'm facing the same issue but that is related to an address set on quote entry that belongs to another customer. That will show the last 2 columns where is the quote_customer_id and the "address_customer_id" where is the customer related to the address entry set on address_id field on quote table. Results in my case: 2 rows in set (0.72 sec) Both customer id 9002 and 9003, in that case, one is the Admin Company user and the second is the normal company user. I hope that helps anyone that is debugging it. I wasn't able to discover why or how that happened. |
I prepared a fix for this issue #38563 |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hi @ihor-sviziev, Thanks for reopening the issue. We have followed these steps from this #23618 (comment) and we are not able to reproduce the issue. Screen.Recording.2024-04-03.at.14.54.16.movCould you please let us know if we are missing anything. Thanks. |
Hi @onepack, We have noticed that this issue has not been updated since long time. Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this. Thanks. |
@engcom-Bravo, as stated in the pull request #38563, the issue is very random, and it's hard to identify how it's happening. It might be a combination of Magento Core with some custom extensions. And in this case, we're getting message like this:
on the Maybe it's happening after logging in to account and merging 2 quotes, I don't really know, but it's happening sometimes |
$connection->query("update customer_entity ce set default_billing = null where default_billing is not null and default_billing != 0 and default_billing not in (select entity_id from customer_address_entity where parent_id = ce.entity_id);"); $connection->query("update customer_entity ce set default_shipping = null where default_shipping is not null and default_shipping != 0 and default_shipping not in (select entity_id from customer_address_entity where parent_id = ce.entity_id);"); |
I see the issue was already fixed in 8c14c08#diff-eea88f8d9d09ee3e619a91aa55a1360085f16d41d98de640edf0371a1e24c43aR159 |
@ihor-sviziev You can make a patch for solve this problem? |
After upgrading the patch from 2.4.6-p2 to 2.4.6-p6, we encountered an issue at checkout indicating "Invalid address ID." Upon investigation, we found that in the core file vendor/magento/module-quote/Model/QuoteAddressValidator.php, the validateWithExistingAddress function calls $cart->getAddressById(), which returns empty because the getAddressById method does not exist in the CartInterface class. We resolved the issue by retrieving the address using the address repository instead. Has anyone else encountered this problem? Are there any alternative solutions or recommendations for addressing this issue? |
we have the same in 2.4.6-p6. |
2.4.7-p1 I got the same error after creating a Cart Price Rule; logged in as a user in checkout. BTW, why on earth would you print the Customer Address ID to the screen (in production) with the error message. |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
I get the error: Unable to save shipping information. Please check input data.
Error log: [2019-07-08 10:33:00] main.CRITICAL: Invalid customer-address id 6 {"exception":"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): Invalid customer-address id 6 at /home/server/domains/dev3.domain.com/public_html/vendor/magento/module-quote/Model/QuoteAddressValidator.php:79)"} []
I removed the address from this customer and re-entered it. Ran the index etc. Nothing.
Other accounts are still ok with the checkout.
The table quote_address stays empty for this quote.
The text was updated successfully, but these errors were encountered: