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

The shipping information was unable to be saved. verify the input data and try again. #23908

Closed
mehmetuygun opened this issue Jul 26, 2019 · 120 comments
Assignees
Labels
Area: Cart & Checkout Component: Customer Component: Persistent Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: needs update Additional information is require, waiting for response Severity: S1 Affects critical data or functionality and forces users to employ a workaround.

Comments

@mehmetuygun
Copy link

mehmetuygun commented Jul 26, 2019

Additional Details

Detailed explanation and result of the investigation #23908 (comment)

Preconditions (*)

  1. Magento 2.3.2, 2.3-develop

Steps to reproduce (*)

  1. Create a customer account
  2. Go to my account, and add a shipping address
    2.5. Enable Persistent Shopping Cart (updated Oct 10.2019)
  3. Add any product and go to the checkout !Impotent: wait until the customer session expires (one hour by default) but no longer than Persistence Lifetime is set to (updated Oct 10.2019)
    3.5 Reload the page so that somewhere in the upper-right corner You get "Not You?" link next to the welcome message (updated Oct 10.2019)
    3.6 Clik on "Not You?" enter the credentials of the customer and log in (updated Oct 10.2019)
    3.6 Go to Mini Cart end press Precede to Checkout (updated Oct 10.2019)
  4. Select the address you have just added
  5. Select a shipping method and click next button

Expected result (*)

  1. Payment page should show up

Actual result (*)

Screenshot_2

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

m2-assistant bot commented Jul 26, 2019

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

@mehmetuygun do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@engcom-Bravo engcom-Bravo self-assigned this Jul 26, 2019
@m2-assistant
Copy link

m2-assistant bot commented Jul 26, 2019

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

    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.

@mehmetuygun
Copy link
Author

@magento give me 2.3.2 instance

@magento-engcom-team
Copy link
Contributor

Hi @mehmetuygun. Thank you for your request. I'm working on Magento 2.3.2 instance for you

@magento-engcom-team
Copy link
Contributor

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

@engcom-Bravo
Copy link
Contributor

Hello @mehmetuygun. Thanks for applying. We've been not able to reproduce Your issue on a vanilla magento instance. Please confirm You are able to to so.

@mehmetuygun
Copy link
Author

mehmetuygun commented Jul 29, 2019

I couldn't reproduce issue on magento instance either.
After I adding $customerId = $this->customerSession->getId(); in to begging of the function private function doValidate(AddressInterface $address, ?int $customerId): void in the file magento/module-quote/Model/QuoteAddressValidator.php the error stop showing up. And I could pass to payment page. How is possible customerId passing as null? it happens when I logged in and trying place order with saved address.

@engcom-Bravo
Copy link
Contributor

@mehmetuygun, if an issue is not reproduced on a fresh magento instance, free from any custom code, third party extensions, etc., then it is not a core magento bug this repository is intended for reporting. Please refer to the Community Forums or the Magento Stack Exchange site for advice or general discussion about this issue. Thus we are supposed to close this issue but please feel free to reopen it if deem necessary. Thanks for applying.

@ron-jomashop
Copy link

This issue is related to this issue: #23618

@onepack
Copy link

onepack commented Aug 6, 2019

I created #23618 and there is a reference to this issue. So I check and the first I see is that this issue is closed here as well.
I understand that you are eager to close issues to keep numbers low but clearly this issue can have a huge impact: Customers can not checkout.
Is there anyone from the magento core team that is willing to take time to find out what is the root of this issue as it is not entirely clear why people are getting this message.

@sbrendtro
Copy link

We've been seeing this as well on a 2.3.2 install. Our data was imported from a Magento 1.9.x install using the Magento Data Migration Tool. We were originally suspecting something to do with the data migration, but it still happens when you create a new account. At the moment we're disabling our 3rd party modules one by one to see if we can narrow it down, but this behavior seems to have been around since before we added our 3rd party modules.

@onepack
Copy link

onepack commented Aug 6, 2019

I imported the customer data via CSV as I have bad experiences with the data migration tool.
The account that had problems was a testing account. So I deleted it and re-created it. But it happened again after that with the new testing account (with the same email).

@sbrendtro
Copy link

sbrendtro commented Aug 6, 2019

Disabled all third party modules and still seeing same behavior. Traced things back through the code and found some interesting things happening:

exception.log shows the error coming from
[2019-08-06 22:05:07] main.CRITICAL: Invalid customer address id 160022 {"exception":"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): Invalid customer address id 160022 at .... vendor/magento/module-quote/Model/QuoteAddressValidator.php:79)"}

That's QuoteAddressValidator::doValidate(AddressInterface $address, ?int $customerId), which is being called by line 130 in the same file. The second parameter for doValidate is set as: $cart->getCustomerIsGuest() ? null : $cart->getCustomer()->getId()

However, $cart->getCustomerIsGuest() is reporting me as a guest, when in fact I'm not. I logged in during checkout, and I'm continuing to refresh the checkout page, so it should be pretty apparent by now that I'm logged in. It is actually showing me all of my addresses, so it clearly thinks I'm logged in.

Ultimately, getCustomerIsGuest() pulls the information from the quote table, which I checked and found that for my customer_id, my active quote had customer_is_guest column set to 1. I'm not sure how the quote (merged from my guest cart) ended up with customer_is_guest still set to 1, but after clearing it, the problem vanished (at least for now).

The following query helped me find the other quotes in the same situation:

SELECT entity_id, customer_id FROM quote WHERE customer_id != 0 AND customer_is_guest = 1;

Then I reset them to the proper status:

UPDATE quote SET customer_is_guest = 0 WHERE customer_id != 0 AND customer_is_guest = 1;

The only quotes I could find in this state belonged to test accounts. I'll continue with testing with 3rd party modules enabled, and comment back if I find anything else improperly messing with the customer_is_guest field.

@engcom-Bravo engcom-Bravo removed their assignment Aug 7, 2019
@onepack
Copy link

onepack commented Aug 8, 2019

@sbrendtro, this is a good catch! I was not getting this critical message. But I was having the same in the quote table customer_is_guest was 1 with this testing customer. Setting it to 0 fixed things.
The root cause is yet unclear. I will keep an eye on this.

@ghost
Copy link

ghost commented Aug 8, 2019

@sbrendtro

Do you mean

UPDATE quote ...

rather than

UPDATE entity ...

?

@sbrendtro
Copy link

@sbrendtro

Do you mean

UPDATE quote ...

rather than

UPDATE entity ...

?

Yes, thanks for pointing that out. Just edited my comment.

@ghost
Copy link

ghost commented Aug 8, 2019

No, thank you for pointing out the fix for what was turning out to be a massive pain in the backside for a client!

@ron-jomashop
Copy link

@onepack I think you should put this solution in your issue too because I believe it will help many people including me.

@mertgokceimam
Copy link

This is an issue that effects both Magento 2.2.9 and 2.3.2

It is also pretty disturbing to see Magento team denies that such issue exist. I can also confirm that the issue occurs on a clean installation.

Thanks to @sbrendtro we corrected the issue on our shop but denying such important issues on an Enterprise solution is not acceptable on magento teams behalf.

@engcom-Bravo
Copy link
Contributor

Dear members of this conversation. Please provide the steps following which we can reproduce the issue on a vanilla Magento installation of 2.3-develop version - the issue will be immediately reopened and confirmed. Dear @onepack, we are not eager to close the issues. We just follow our workflow (please see details to step 4 of this comment above #23908 (comment)). Thank You all for understanding.

@mertgokceimam
Copy link

mertgokceimam commented Aug 14, 2019

It is really hard to reproduce as this is not an existing issue for everyone. For example when i checked our production instance , we had 85 total user quote that was effected by the issue. We of course corrected the quote issue but a step by step way to reproduce it is extremely hard.

One day after correcting the quote's we have this issue back in place.
mysql> SELECT entity_id, customer_id FROM quote WHERE customer_id != 0 AND customer_is_guest = 1; +-----------+-------------+ | entity_id | customer_id | +-----------+-------------+ | 57600 | 313840 | | 24340 | 397145 | | 106394 | 483487 | | 117654 | 483683 | +-----------+-------------+

Magento seriously urgently release a patch for this issue as this is effecting many customers incomes and most are not possibly aware of the issue.

Just because Magento team choose to close close issues for keeping clean board doesn't mean that us Enterprise customers are going to loose money.

In no condition Magento should allow a Logged in customer quote assigned as a Guest customer. But this can happen because of . a weird logic Magento team choose to implement. This shouldn't happen at all.

@tuyennn
Copy link
Contributor

tuyennn commented Aug 15, 2019

@engcom-Bravo We have same problem with magento since the 1st day of launching. The magento team should take a look on how you implement quote validation with customer_is_guest on quote and care how it's merging.

@sbrendtro
Copy link

sbrendtro commented Aug 16, 2019

Here's a temporary workaround at the database level (USE WITH CAUTION). Since no one seems to be able to figure out where this is coming from, I figured I would use a MySQL trigger to prevent customer_is_guest from being set anything but 0 when customer_id is set. You'll want to do your own testing before putting this in production. But I can't think of any real risk, as customer_is_guest should really never be set to true for a logged-in customer.... right?

DROP TRIGGER IF EXISTS quote_before_insert_fix_guest;
DROP TRIGGER IF EXISTS quote_before_update_fix_guest;

DELIMITER $$

    CREATE TRIGGER quote_before_insert_fix_guest BEFORE INSERT ON quote
    FOR EACH ROW BEGIN
      IF (NEW.customer_id != 0 AND NEW.customer_is_guest != 0 ) THEN
            SET NEW.customer_is_guest = 0;
      END IF;
    END$$

    CREATE TRIGGER quote_before_update_fix_guest BEFORE UPDATE ON quote
    FOR EACH ROW BEGIN
      IF (NEW.customer_id != 0 AND NEW.customer_is_guest != 0 ) THEN
            SET NEW.customer_is_guest = 0;
      END IF;
    END$$

DELIMITER ;

edited: Both triggers were on BEFORE UPDATE, changed the first one to BEFORE INSERT.

@sidolov sidolov reopened this Feb 7, 2022
@m2-community-project m2-community-project bot removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: done labels Feb 7, 2022
@m2-community-project m2-community-project bot moved this from Done to Ready for Development in High Priority Backlog Feb 7, 2022
@sidolov
Copy link
Contributor

sidolov commented Feb 7, 2022

@hostep no problem, let's re-open it and check once again. Thanks!

@bartoszkubicki
Copy link

Still an issue on newest magento version

@engcom-November
Copy link
Contributor

Verified the issue on Magento 2.4-develop branch but cannot able to reproduce the issue due to below issue:;
#35182 - "Not You?" link is not getting displayed after customer session is expired to verify this issue.

@redati
Copy link

redati commented Apr 13, 2022

Magento 2.4.4

[2022-04-13T12:52:34.090875+00:00] main.CRITICAL: Magento\Framework\Exception\NoSuchEntityException: Id do endereço inválido 10781 in /var/www/html/vendor/magento/module-quote/Model/QuoteAddressValidator.php:79

@sidolov sidolov removed the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Apr 21, 2022
@m2-community-project m2-community-project bot added this to Ready for Confirmation in Issue Confirmation and Triage Board Apr 21, 2022
@m2-community-project m2-community-project bot removed this from Ready for Development in High Priority Backlog Apr 21, 2022
@m2-assistant
Copy link

m2-assistant bot commented May 26, 2022

Hi @engcom-Delta. 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.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-Delta
Copy link
Contributor

Hi @mehmetuygun ,
We tried to reproduce the issue on Magento 2.4 develop instance , issue is not reproducible.

Followed steps:

  1. Create a customer account
  2. Go to my account, and add a shipping address

Screenshot 2022-05-31 at 8 11 16 PM

  1. Enable Persistent Shopping Cart

Screenshot 2022-05-31 at 8 08 56 PM

  1. Add any product and go to the checkout !Impotent: wait until the customer session expires (one hour by default) but no longer than Persistence Lifetime is set

Screenshot 2022-05-31 at 6 31 17 PM

  1. Reload the page so that somewhere in the upper-right corner You get "Not You?" link next to the welcome message

Screenshot 2022-05-31 at 6 31 17 PM

  1. Click on "Not You?" enter the credentials of the customer and log in

Screenshot 2022-05-31 at 6 45 07 PM

  1. Go to Mini Cart end press Proceed to Checkout

  2. Select the address you have just added

  3. Select a shipping method and click next button

Screenshot 2022-05-31 at 7 00 08 PM

Actual Results:
Able to place an order successfully.

@engcom-Delta engcom-Delta added Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: needs update Additional information is require, waiting for response and removed Issue: ready for confirmation labels May 31, 2022
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board May 31, 2022
@m2-community-project m2-community-project bot removed the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label May 31, 2022
@engcom-Delta
Copy link
Contributor

We have noticed that this issue has not been updated for a period of more than 14 Days.
Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this.

@oviliz
Copy link

oviliz commented Jun 14, 2022

Incredible...

@niners52
Copy link

Still happens on 2.4.5

@HansMerz
Copy link

HansMerz commented Nov 8, 2023

Still happens on 2.4.6-p2

@oviliz
Copy link

oviliz commented Dec 5, 2023

@engcom-Delta @magento-engcom-team this is obviously unresolved... could you please reopen?

@onimitch
Copy link

Hello maybe this will help.

I just got this error while shopping on www.lindt.co.uk. I obviously can't tell you what version they are using but following the error lead me here.

This is what I did:

  1. Shopping for a product and added to my cart. I had no account yet, so just anon.
  2. Went to cart and checkout.
  3. Created a new account using login/register with Google.
  4. I think had an issue where I couldn't checkout because it said there were no products even though they were listed (the no products error occured when I tried to enter a promotional code).
  5. I cleared the cart and re-added my product.
  6. Went to cart, added my promotional code and did checkout.
  7. Any address I select in shipping information gives the error "The shipping information was unable to be saved. Error: Invalid customer address id XXXX" where XXXX is an ID.

In the end I had to give up with lindt and order as a guest, but maybe the above steps will help to reproduce the issue.
As a developer (who doesn't use magento I should add though), my suspicion is the problem might have occured when registering using google.

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Cart & Checkout Component: Customer Component: Persistent Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: needs update Additional information is require, waiting for response Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
None yet
Development

Successfully merging a pull request may close this issue.