I am seeing this error.
Previous reports were closed as due to having custom codes and could not be resolved.
Current stack trace are not showing any custom code in the error.
I agree with the plausibility that when customer logs in during the check out process causing the error as I see a USER log entry for session opened just prior to this commerce_order error log
In checkout flow, there is an option to "Assign an anonymous order to a pre-existing user
If the email associated with the order matches an existing user account, the order will be assigned to that account."
Not sure if this has any relevance but it was something that was changed recently.
Drupal\commerce_order\Exception\OrderVersionMismatchException: Attempted to save order 4724 with version 6. Current version is 7. in /public_html/modules/contrib/commerce/modules/order/src/Entity/Order.php:703
Stack trace:
#0 /public_html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(528): Drupal\commerce_order\Entity\Order->preSave()
#1 /public_html/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(753): Drupal\Core\Entity\EntityStorageBase->doPreSave()
#2 /public_html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave()
#3 /public_html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(806): Drupal\Core\Entity\EntityStorageBase->save()
#4 /public_html/modules/contrib/commerce/modules/order/src/OrderStorage.php(169): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#5 /public_html/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\commerce_order\OrderStorage->save()
#6 /public_html/modules/contrib/commerce_shipping/src/Plugin/Commerce/CheckoutPane/ShippingInformation.php(349): Drupal\Core\Entity\EntityBase->save()
#7 /public_html/modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowWithPanesBase.php(546): Drupal\commerce_shipping\Plugin\Commerce\CheckoutPane\ShippingInformation->buildPaneForm()
#8 [internal function]: Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase->buildForm()
#9 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array()
#10 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(375): Drupal\Core\Form\FormBuilder->retrieveForm()
#11 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(633): Drupal\Core\Form\FormBuilder->rebuildForm()
#12 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm()
#13 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(224): Drupal\Core\Form\FormBuilder->buildForm()
#14 /public_html/modules/contrib/commerce/modules/checkout/src/Controller/CheckoutController.php(143): Drupal\Core\Form\FormBuilder->getForm()
#15 [internal function]: Drupal\commerce_checkout\Controller\CheckoutController->formPage()
#16 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#17 /public_html/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#18 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#19 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#20 /public_html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#21 /public_html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#22 /public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#23 /public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#24 /public_html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#25 /public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\ContentLength->handle()
#26 /public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#27 /public_html/modules/contrib/advban/src/AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle()
#28 /public_html/core/modules/ban/src/BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle()
#29 /public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#30 /public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#31 /public_html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#32 /public_html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#33 /public_html/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#34 /public_html/index.php(19): Drupal\Core\DrupalKernel->handle()
#35 {main}
I've been experiencing this issue as well.
https://www.drupal.org/node/3409693 →
I've also commented in #5 with my stack trace.
https://www.drupal.org/project/commerce_shipping/issues/3309439
🐛
Race condition: new profile gets saved twice in ShippingInformation::validatePaneForm(), resulting in duplicate UUID exception
Active
I am using custom code but I doubt it's a coincidence that others NOT running custom code is experiencing the same issue.
@jsacksick
Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '60428026-b355-433f-aa4a-0044787afcd9' for key 'profile_field__uuid__value': INSERT INTO "profile" ("revision_id", "type", "uuid", "uid", "status", "is_default", "created", "changed", "data") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => customer [:db_insert_placeholder_2] => 60428026-b355-433f-aa4a-0044787afcd9 [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 1723575050 [:db_insert_placeholder_7] => 1723575050 [:db_insert_placeholder_8] => a:0:{} ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of /public_html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
The issue was originally reported here. https://www.drupal.org/node/3409693 →
It's intermitten. Does not occur with every order.
Attached stack trace for reference.
#0 /public_html/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#1 /public_html/modules/contrib/commerce_shipping/src/LateOrderProcessor.php(55): Drupal\Core\Entity\EntityBase->save()
#2 /public_html/modules/contrib/commerce/modules/order/src/OrderRefresh.php(198): Drupal\commerce_shipping\LateOrderProcessor->process()
#3 /public_html/modules/contrib/commerce/modules/order/src/OrderStorage.php(123): Drupal\commerce_order\OrderRefresh->refresh()
#4 /public_html/modules/contrib/commerce/modules/order/src/OrderStorage.php(86): Drupal\commerce_order\OrderStorage->doOrderPreSave()
#5 /public_html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(529): Drupal\commerce_order\OrderStorage->invokeHook()
#6 /public_html/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(753): Drupal\Core\Entity\EntityStorageBase->doPreSave()
#7 /public_html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave()
#8 /public_html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(806): Drupal\Core\Entity\EntityStorageBase->save()
#9 /public_html/modules/contrib/commerce/modules/order/src/OrderStorage.php(169): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#10 /public_html/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\commerce_order\OrderStorage->save()
#11 /public_html/modules/contrib/commerce_shipping/src/Plugin/Commerce/CheckoutPane/ShippingInformation.php(349): Drupal\Core\Entity\EntityBase->save()
#12 /public_html/modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowWithPanesBase.php(546): Drupal\commerce_shipping\Plugin\Commerce\CheckoutPane\ShippingInformation->buildPaneForm()
#13 [internal function]: Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase->buildForm()
#14 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array()
#15 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(375): Drupal\Core\Form\FormBuilder->retrieveForm()
#16 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(633): Drupal\Core\Form\FormBuilder->rebuildForm()
#17 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm()
#18 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(224): Drupal\Core\Form\FormBuilder->buildForm()
#19 /public_html/modules/contrib/commerce/modules/checkout/src/Controller/CheckoutController.php(143): Drupal\Core\Form\FormBuilder->getForm()
#20 [internal function]: Drupal\commerce_checkout\Controller\CheckoutController->formPage()
#21 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#22 /public_html/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#23 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#24 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#25 /public_html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#26 /public_html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#27 /public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#28 /public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#29 /public_html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#30 /public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\ContentLength->handle()
#31 /public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#32 /public_html/modules/contrib/advban/src/AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle()
#33 /public_html/core/modules/ban/src/BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle()
#34 /public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#35 /public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#36 /public_html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#37 /public_html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#38 /public_html/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#39 /public_html/index.php(19): Drupal\Core\DrupalKernel->handle()
#40 {main}
This issue has been occuring more often on my site.
Is there any way to help diagnose in order to find a solution?
patch from #8 does not apply to commerce_shipping:8.x-2.9
Had to downgrade /src/Plugin/Commerce/Condition/ShipmentWeight.php to the version in commerce_shipping:8.x-2.8
Then apply patch #8.
Any chance to have the "duplicate" feature added to shipping methods?
Thanks
Issue resolved with Commerce core 8.x-2.37 update.
Still not sure of the cause.
Second this request.
MailChannels entered an incorrect field into a DNSSEC DS record for mailchannels.net, causing name resolution errors.
Our orders were completing and payment received but emails were not being sent out.
Although we can request to resend receipt but this will only send a copy to the customer and not a copy to us for our own record.
This issue may be a duplicate of
https://www.drupal.org/project/commerce_shipping/issues/3309439
🐛
Race condition: new profile gets saved twice in ShippingInformation::validatePaneForm(), resulting in duplicate UUID exception
Active
I am currently experiencing this issue as well.
I have no way to reproduce this issue but is seeing the same errors in the log.
Any suggestions on how to resolve this?
Thanks
I am currently using commerce_shipping 8.x-2.6 with this patch for the Shipmentweight to support ranges.
https://www.drupal.org/project/commerce_shipping/issues/2919113
✨
Expand the ShipmentWeight condition to support ranges
RTBC
Not sure if this would contribute to the issue.
Should I try the dev version instead as it is the newest?
99gs3 → created an issue.
@jsacksick
Was able to get stack trace with this patch.
Issue reported with trace at
https://www.drupal.org/project/commerce/issues/3404553
🐛
Exception\OrderVersionMismatchException
Active
Thanks
99gs3 → created an issue.
After correcting the SqlContentEntityStorage.php and having the setting from admin/commerce/config/orders/settings to "Prevent the save and throw an exception that may cause a fatal error.." The following error is still occuring.
The difference now is that only 1 order will show these codes instead of all orders in the cart.
Type commerce_order
Message Drupal\commerce_order\Exception\OrderVersionMismatchException: Attempted to save order 4016 with version 43. Current version is 44. in Drupal\commerce_order\Entity\Order->preSave() (line 681 of public_html/modules/contrib/commerce/modules/order/src/Entity/Order.php).
Severity Error
And
Type php
Message Drupal\Core\Entity\EntityStorageException: Attempted to save order 4016 with version 43. Current version is 44. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of public_html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Severity Error
Code on line 681 of Order.php
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
if (isset($this->original) && !$this->isNew() && $this->original->getVersion() > $this->getVersion()) {
$mismatch_exception = new OrderVersionMismatchException(sprintf('Attempted to save order %s with version %s. Current version is %s.', $this->id(), $this->getVersion(), $this->original->getVersion()));
$log_only = $this->getEntityType()->get('log_version_mismatch');
if ($log_only) {
watchdog_exception('commerce_order', $mismatch_exception);
}
else {
throw $mismatch_exception;
}
}
$this->setVersion($this->getVersion() + 1);
Code on line 817 of SqlContentEntityStorage.php
public function save(EntityInterface $entity) {
try {
$transaction = $this->database->startTransaction();
$return = parent::save($entity);
// Ignore replica server temporarily.
\Drupal::service('database.replica_kill_switch')->trigger();
return $return;
}
catch (\Exception $e) {
if (isset($transaction)) {
$transaction->rollBack();
}
Error::logException(\Drupal::logger($this->entityTypeId), $e);
throw new EntityStorageException($e->getMessage(), $e->getCode(), $e);
}
}
No errors appearing on dblog for this issue.
But I did notice a behavior. The Cart "updated" time does not reset for logged in users.
Only resest for "Guest" / anonymous users that has added to cart.
@jsacksick
This new error is now triggering in addition to the previous error.
Drupal\Core\Entity\EntityStorageException: Attempted to save order 3932 with version 787. Current version is 788. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of /home/mysite/public_html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
@jsacksick
Thanks I've changed the setting as suggested.
I've also tried to access various page, forms, add and remove items from cart.
But I am not able to cause this error to trigger on it's own.
Will need to observe the log and wait for the next time something to cause this error to trigger.
Thanks and happy Thanksgiving!
@jsacksick yes it is set as shown in your screenshot.
Upon further testing, the "Updated" time resets for all existing orders pending in the shopping cart when a new order is added to cart.
But this "reset" only appeared 1 time.
No errors or warning appears in the dblog.
Maybe some kind of cache issue?
@jsacksick the exact same error is appearing for me as well.
Drupal\commerce_order\Exception\OrderVersionMismatchException: Attempted to save order 3973 with version 7. Current version is 8. in Drupal\commerce_order\Entity\Order->preSave() (line 681 of /home/mysite/public_html/modules/contrib/commerce/modules/order/src/Entity/Order.php).
There are no other backtraces in the dblog for this error and the error will appear for every order saved in the shoppping cart.
I'm not sure how to reproduce it on my own. It just appears randomly.
If there's any instructions on how to cause a backtrace to appear for the next time this is triggered I would be glad to provide it for further diagnostic.
@nicxvan I am having the same issue. Please let me know if you have figured out the cause.
After further testing it would appear the issue caused by the order of Field in Order Types settings.
Coupons Field must be before Cart for the discount to apply.
99gs3 → created an issue.
99gs3 → created an issue.
99gs3 → created an issue.
Domestic shipments are generally flat rate shipping or calculated by physical weight.
For international packages and couriers such as Fedex/UPS/DHL , there is also calculation by dimensional weight.
I.e. USPS calculates by L"xW"xH"/166=dimensional weight
An example of how dimensional weight may be useful.
A product that is large in overall dimension and require a box that is 13"x10"x4"=3.13lb
But the product's actual physical weight is only 1lb and there are additional spaces in the box to fill and maximize the capacity.
If any additional small size item product is added it will add to the 3.13lb in shipping calculation.
Perhaps it would be helpful to have a check box option on whether a product can be combined shipped and what items could be combined?
And/Or some kind of rule to distinguish physical weight vs dimensional weight of a order prior to calulating shipping costs.