-
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" when adding product to basket Magento2 #7570
Comments
@sma09sjb thank you for your report. |
@veloraven apologies, the magento version is 2.1.2 |
@sma09sjb thank you for very clear bug report! |
Can i have an update on this please? |
The ticket is in queue for fixing. It's marked as high priority. |
Does there exist a patch for that issue as it blocks going live, It happens with me after failed payment operation. causes add to cart to fail and reload the page. and when doing reorder. |
We are also experiencing this bug in 2.1.3. I will say that when I replicate this issue, it doesn't matter if I try to add the same product to cart or a different one. If I've created a quote from an address in the account, and that address get's deleted after quote creation, it produces the error when trying to add products. So once I remove the items from cart, then delete the address used from the account, I can't add any products to cart. If I manually delete the records from the |
I believe this issue is created as the address id stored in customer_entity for default_shipping has been removed from customer_address_entity. |
@Flipmediaco I totally agree with you as that error disappear when the customer set default shipping and billing address |
We are experiencing the same issue when removing an item from the basket. (We are running 2.1.2) Is there any update on this? |
This Gist fixes this issue by setting the billing and shipping addresses to the customers defaults: https://gist.github.com/cherreman/e35590981bf8a53a086a66c8a4f86fad |
@sma09sjb, @davidstillson, @cherreman
|
is it really fixed already ? |
I am also (still) experiencing this on 2.1.7 CE |
I am also still experiencing this on 2.1.7 CE |
Also can confirm that this issue still exists in 2.1.7 CE |
Hi, i'm still having this problem. I can not clear customers shopping cart. Is it possible to delete the cart at database Level? |
I am also (still) experiencing this on 2.1.8 EE |
I'm getting this issue on 2.1.7 CE, any solution? |
@magento-engcom-team what is G1 Failed label means? |
Hi @conflicker G1 Failed (Gate 1 Failed) means the issue description did not pass automatic verification of the issue description. We will publish more details soon about Gates system. |
A quick and dirty solution could be to create a Plugin and clear the customer_address_id from the quote_address table everytime an address is deleted. di.xml <type name="\Magento\Customer\Model\ResourceModel\Address">
<plugin name="mycompany_quote_address_fix_plugin"
type="MyCompany\QuoteAddressFix\Plugin\AddressPlugin"
sortOrder="1"
disabled="false"/>
</type> app/code/MyCompany/QuoteAddressFix/Plugin/AddressPlugin.php <?php
namespace MyCompany\QuoteAddressFix\Plugin;
use Magento\Framework\App\ResourceConnection;
use Psr\Log\LoggerInterface;
use Magento\Customer\Model\ResourceModel\Address;
/**
* Class AddressPlugin
* @package MyCompany\QuoteAddressFix\Plugin
*/
class AddressPlugin
{
/**
* @var \Magento\Framework\App\ResourceConnection
*/
protected $resourceConnection;
/**
* @var \Psr\Log\LoggerInterface
*/
protected $logger;
/**
* @param ResourceConnection $resourceConnection
* @param LoggerInterface $logger
*/
public function __construct(
ResourceConnection $resourceConnection,
LoggerInterface $logger
) {
$this->resourceConnection = $resourceConnection;
$this->logger = $logger;
}
/**
* Clear customer addresses from the quote_address table
* M2 Bug: https://github.com/magento/magento2/issues/7570
*
* @param Address $subject
* @param \Closure $proceed
* @param object $address
* @return mixed
*/
public function aroundDelete(Address $subject, \Closure $proceed, $address)
{
try {
$this->resourceConnection->getConnection()->fetchRow("
UPDATE quote_address
SET customer_address_id = NULL
WHERE customer_address_id = '" . $address->getId() . "'
");
} catch (\Exception $e) {
$this->logger->critical($e->getMessage());
}
return $proceed($address);
}
} |
Any update on this, @magento? Still a breaking issue for us. |
Hey guys, do we have any updated on this? We still facing this issue |
Hi Willian, did you try the plugin three posts up? We installed it on our site, and we haven't seen it since. |
Hi @benyanke, no, is it working to EE as well? |
Yes, we're EE. |
For a quick solution, please go through this below link: |
We have same issue on magento 2.3.1. |
Still have it on 2.3.1 CE |
Still have it on 2.3.2 great this magento 2 platform, first the incredible 2.2 version and also the constant changes makes it real ease to work with... NOT ! |
Hi @engcom-Bravo. Thank you for working on this issue.
|
I can't reproduce this issue on fresh Magento 2.3-develop and 2.3.2 branches. Manual testing scenario: Actual result: Hi, @b2bdokter ! Can you provide me your steps to reproduce this issue? |
Yesterday my customer reported after I told him to order a item: It says costumer invalid adress id 3832, when i try At the moment , I am not be able to login to the magento backend ( out of the blue) so my first 2 hours I need to solve that again... But it is such a buggy platform I can't believe it seriously considering to start using another CMS system in the future, Tons of bugs, a lot of them are not even solved ... Only one benefiting from M2 are the developers with their expensive extensions you need to renew... Just insert a new password, try to login and it wont let me , its such a good platform for E-Concerns So I am sorry it seems like I wont be able to help to reproduce because loggin into magento 2.3.2 seems difficult enough |
@b2bdokter , you can try to reproduce it on fresh 2.3-develop instance. I will request instance for you. |
@magento give me 2.3-develop instance |
Hi @engcom-Charlie. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @engcom-Charlie, here is your Magento instance. |
Okay @magento-engcom-team Give me one please thank you |
@b2bdokter use it: |
Tried to reproduce on that installation , cant reproduce. But since it happens on our own installation. customer invalid adress id 3832 I see no decent solution anywere... |
@b2bdokter This is a data issue... The table This thread is closed as the original issue was resolved and update applied that changed the If you can recreate the steps that has caused the data inconsistency, then open a new ticket detailing this 👍 Good luck and I guess you will find the solution in the data and once the reference to 3832 is removed, the issue will go away. Hope this helps, have a great day |
Thank you @Flipmediaco for your time ,have a great day too |
…heck-dependencies SEARCH-1968: Static tests to check for dependency of Elasticsearch
im having this issue on magento 2.4.2p2, only with certain customers |
$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);"); |
Solved in #23618 |
Steps to reproduce
The database now has a quote_address entity which has a customer_address_id
Expected result
Actual result
When you add the same product to your basket the code looks for an existing quote for that user, and it finds one in the above scenario but because the address associated to is now no longer in existence it throws this error.
What needs to happen is when an address is deleted the quotes should be checked for any quote_addresses with that customer_address_id referenced, and then it should be deleted.
The text was updated successfully, but these errors were encountered: