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

Invalid address id at check out #23618

Closed
onepack opened this issue Jul 8, 2019 · 47 comments · May be fixed by #38563
Closed

Invalid address id at check out #23618

onepack opened this issue Jul 8, 2019 · 47 comments · May be fixed by #38563
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.3.2 Indicates original Magento version for the Issue report. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.

Comments

@onepack
Copy link

onepack commented Jul 8, 2019

Preconditions (*)

  1. Magento 2.3.2

Steps to reproduce (*)

  1. Delete a customer and then re-create it with the same email.
  2. Go to checkout with a product in the basket.
  3. At sending press "next".

Expected result (*)

  1. The next step is supposed to load

Actual result (*)

  1. I get the error: Unable to save shipping information. Please check input data.

  2. 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)"} []

  3. I removed the address from this customer and re-entered it. Ran the index etc. Nothing.

  4. Other accounts are still ok with the checkout.

  5. The table quote_address stays empty for this quote.

@m2-assistant
Copy link

m2-assistant bot commented Jul 8, 2019

Hi @onepack. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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:

@magento give me 2.3-develop instance - upcoming 2.3.x release

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?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jul 8, 2019
@krishprakash krishprakash self-assigned this Jul 8, 2019
@m2-assistant
Copy link

m2-assistant bot commented Jul 8, 2019

Hi @krishprakash. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@krishprakash
Copy link

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @krishprakash. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @krishprakash, here is your Magento instance.
Admin access: https://i-23618-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@krishprakash
Copy link

krishprakash commented Jul 8, 2019

Hi @onepack.
I'm not able to reproduce this issue as provided steps by you.
Please update the reproducible steps and kindly confirm that its reproducible on Vanilla Magento instance.
Thanks.

@krishprakash krishprakash added Progress: needs update Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch labels Jul 8, 2019
@onepack
Copy link
Author

onepack commented Jul 8, 2019

Hi @krishprakash ,

I tried to reproduce the same but was not able to.
The difference now is that as I remember there had been an update via an account import on this account in between.
I will need to check that.

But for now, is there anyone that can explain what is happening to that account and why I get this error on it?

@krishprakash
Copy link

Please feel free to reopen the issue if you reproduce on venilla instance.
Thanks

@ghost
Copy link

ghost commented Jul 17, 2019

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 ..."

@Sherbieny
Copy link

I can confirm that this is also happening at random in a commerce 2.3.2 version
error: Invalid customer address id 2 {"exception":"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): Invalid customer address id 2 at "path/to/server"/vendor/magento/module-quote/Model/QuoteAddressValidator.php:79)"} []

@amanuni
Copy link

amanuni commented Jul 26, 2019

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @amanuni. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @amanuni, here is your Magento instance.
Admin access: https://i-23618-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@ron-jomashop
Copy link

ron-jomashop commented Aug 1, 2019

It seems like this issue related to the customer id is missing.

Here is how it can be fixed locally: #23908 (comment)

@onepack
Copy link
Author

onepack commented Aug 8, 2019

The root cause is not yet clear but a solution for customers experiencing this issue is here:
#23908 (comment)

@tonycr7
Copy link

tonycr7 commented Aug 14, 2019

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:
in magento/vendor/magento/module-quote/Model/QuoteAddressValidator.php
change the function validateForCart as
from :

 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.
Thanks!

@amanuni
Copy link

amanuni commented Aug 14, 2019

I added it below mention code at beginning of doValidate function.

		if(!$customerId){
			if($address->getCustomerId()){
				$customerId = $address->getCustomerId();
			}
		}

And its seems working fine.

@santhoshnsscoe
Copy link

Steps to reproduce:

  1. Add products to cart
  2. Go to checkout
  3. Add email id and login from the checkout page
  4. After login, click the next to go to the payment page.
  5. Error will popup with "The shipping information was unable to be saved. Verify the input data and try again."

When we check the quote table.

SELECT entity_id, customer_id FROM quote WHERE customer_id != 0 AND customer_is_guest = 1;
+-----------+-------------+
| entity_id | customer_id |
+-----------+-------------+
|        28 |           4 |
+-----------+-------------+

@arnoutvreugdenhil
Copy link

The cause is that the shopping cart has customer_is_guest = 1.
That causes Magento\Quote\Model'QuotaAddressValidator line 130 tot pass null to doValidate.

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.

@webusat
Copy link

webusat commented Sep 23, 2019

@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.

@klein0r
Copy link
Contributor

klein0r commented Nov 3, 2019

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?

@andrewdaluz
Copy link

andrewdaluz commented Nov 5, 2019

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.
Here a query example:
select qa.quote_id, qa.address_id as quote_address_id, cae.entity_id as customer_address_id, qa.customer_id as quote_customer_id, cae.parent_id as address_customer_id from quote_address as qa JOIN customer_address_entity as cae on (cae.entity_id=qa.customer_address_id) WHERE cae.parent_id!=qa.customer_id LIMIT 1000;

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:
+----------+------------------+---------------------+-------------------+---------------------+
| quote_id | quote_address_id | customer_address_id | quote_customer_id | address_customer_id |
+----------+------------------+---------------------+-------------------+---------------------+
| 36508 | 78919 | 9789 | 9002 | 9003 |
| 36508 | 78920 | 9789 | 9002 | 9003 |
+----------+------------------+---------------------+-------------------+---------------------+

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.

@rav-redchamps rav-redchamps reopened this Feb 2, 2020
@ghost ghost unassigned krishprakash Feb 2, 2020
@m2-community-project m2-community-project bot removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: done Issue: needs update Additional information is require, waiting for response labels Apr 2, 2024
@m2-community-project m2-community-project bot moved this from Done to Dev In Progress in Low Priority Backlog Apr 2, 2024
@m2-community-project m2-community-project bot moved this from Dev In Progress to Ready for Development in Low Priority Backlog Apr 2, 2024
@m2-community-project m2-community-project bot moved this from Ready for Development to Pull Request In Progress in Low Priority Backlog Apr 2, 2024
@m2-community-project m2-community-project bot added Progress: PR in progress Priority: P2 A defect with this priority could have functionality issues which are not to expectations. and removed Progress: ready for dev labels Apr 2, 2024
@m2-community-project m2-community-project bot added this to Pull Request In Progress in High Priority Backlog Apr 2, 2024
@m2-community-project m2-community-project bot removed this from Pull Request In Progress in Low Priority Backlog Apr 2, 2024
@ihor-sviziev
Copy link
Contributor

I prepared a fix for this issue #38563

@engcom-Hotel engcom-Hotel removed the Priority: P3 May be fixed according to the position in the backlog. label Apr 2, 2024
@engcom-Bravo engcom-Bravo self-assigned this Apr 2, 2024
Copy link

m2-assistant bot commented Apr 2, 2024

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.3.2 Indicates original Magento version for the Issue report. label Apr 2, 2024
@engcom-Bravo
Copy link
Contributor

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.mov

Could you please let us know if we are missing anything.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Apr 3, 2024
@engcom-Bravo
Copy link
Contributor

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.

@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Done in High Priority Backlog Apr 24, 2024
@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Apr 24, 2024

@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.
After code analysis, we found we have 2 different fields "customer id" and "is guest" flag. And sometimes it looks like they're not in sync.

And in this case, we're getting message like this:

The shipping information was unable to be saved. Error: "Invalid customer address id 12345"

on the POST /rest/default/V1/carts/mine/shipping-information request

Maybe it's happening after logging in to account and merging 2 quotes, I don't really know, but it's happening sometimes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.3.2 Indicates original Magento version for the Issue report. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects