Closed sma09sjb closed 7 years ago
@sma09sjb thank you for your report. Please, also identify which version of Magento you are running.
@veloraven apologies, the magento version is 2.1.2
@sma09sjb thank you for very clear bug report! Created internal issue MAGETWO-61551.
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 quote_address
table, I am able to add items to cart again.
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
This bug has already fixed in scope of MAGETWO-62044
for the latest version(develop branch)
MAGETWO-64068
MAGETWO-64069
is it really fixed already ? I still have this issue on magento 2.1.6
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. error : Invalid customer address id 7494 version : ce 2.1.4
Is it possible to delete the cart at database Level? Please reopen ticket!
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: https://magento.stackexchange.com/a/196149/52030
We have same issue on magento 2.3.1. Is this issue being investigated?
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. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If 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
branchDetails
- 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.
I can't reproduce this issue on fresh Magento 2.3-develop and 2.3.2 branches.
Manual testing scenario:
1.Login to admin
2.Create a simple product
Actual result: Product deleted from cart
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.
Admin access: https://i-7570-2-3-develop.instances.magento-community.engineering/admin
Login: admin
Password: 123123q
Instance will be terminated in up to 3 hours.
Okay @magento-engcom-team Give me one please thank you
@b2bdokter use it: Admin access: https://i-7570-2-3-develop.instances.magento-community.engineering/admin Login: admin Password: 123123q Instance will be terminated in up to 3 hours.
Tried to reproduce on that installation , cant reproduce.
But since it happens on our own installation. Whats more important to me and others still experiencing this... What can we do to solve this ?
customer invalid adress id 3832
I see no decent solution anywere...
@b2bdokter This is a data issue...
The table customer_address_entity
has a foreign key named customer_address_id
of 3832 which is the primary key entity_id
of customer_address_entity
... If you review these two tables, I suspect you will find the address identified byentity_id
3832 is no longer present, yet a reference in another table remains. The exact specifics of this will likely be unique to your instance.
This thread is closed as the original issue was resolved and update applied that changed the customer_entity
so it did not store an address foreign key of customer_address_entity
in default_shipping
.
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
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);");
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.