When an item in an order is shippable, I'm getting an error when completing the checkout process. DatabaseTransactionNoActiveException: in DatabaseConnection->rollback() (line 1016 of /sitename/includes/database/database.inc).

To reproduce:

  1. Install Commerce Kickstart
  2. Install Commerce Delivery
  3. Add a boolean field to a product type, indication whether or not the product is shippable
  4. Configure Commerce Delivery to use that field
  5. Edit an existing product, and set shippable to Yes
  6. As a visitor, put that product in the basket, and start the checkout process
  7. The error message will appear right after the payment process has finished

Modules:

  • Address Field 7.x-1.0-beta1
  • Chaos tool suite 7.x-1.0-rc1
  • Commerce 7.x-1.0-rc3
  • Entity API 7.x-1.0-beta10
  • Rules 7.x-2.0-beta3
  • Views 7.x-3.0-rc1

The error doesn't occur if I disable the rule called "Add delivery", so the problem is most likely related to that rule.

Comments

olofbokedal’s picture

It doesn't happen if I create an order manually (through the administration pages). Only when I place an order as a customer, regardless of whether or not I'm logged in.

xlyz’s picture

I reproduced it (only with anonynous order through checkout), but I need to investigate further. Be patient as it's a busy period.

olofbokedal’s picture

Investigated a little further, and managed to get it working at some point, by altering the weight of the rule. However, I didn't manage to reproduce it on another installation.

Maybe this issue is related to Rules?

xlyz’s picture

it seems related to order / checkout changes that upstream did in the last month.
a conflict triggered by checking out an order from an anonymous user.

i tried to altering the rule weight but I still get the error. what value did you set?

reporting the backtrace for future reference:

DatabaseConnection->rollback('drupal_transaction') database.inc:1868
DatabaseTransaction->rollback() commerce_order.controller.inc:102
CommerceOrderEntityController->save(Object) entity.module:177
entity_save('commerce_order', Object) entity.wrapper.inc:808
EntityDrupalWrapper->save() rules.state.inc:229
RulesState->saveNow('commerce_order') rules.state.inc:74
RulesState->cleanUp(Object) rules.plugins.inc:681
RulesEventSet->executeByArgs(Array) rules.module:750
rules_invoke_event_by_args('commerce_checkout_complete', Array) rules.module:695
rules_invoke_all('commerce_checkout_complete', Object) commerce_checkout.module:729
commerce_checkout_complete(Object) commerce_payment.checkout_pane.inc:288
_commerce_payment_redirect_pane_next_page(Array, Array, Object) commerce_payment.checkout_pane.inc:179
commerce_payment_redirect_pane_checkout_form(Array, Array, Array, Object) commerce_checkout.pages.inc:88
commerce_checkout_form(Array, Array, Object, Array) 
call_user_func_array('commerce_checkout_form', Array) form.inc:773
drupal_retrieve_form('commerce_checkout_form_payment', Array) form.inc:317
drupal_build_form('commerce_checkout_form_payment', Array) form.inc:189
drupal_get_form('commerce_checkout_form_payment', Object, Array) commerce_checkout.pages.inc:43
commerce_checkout_router(Object, Array) 
call_user_func_array('commerce_checkout_router', Array) menu.inc:503
menu_execute_active_handler() index.php:21
olofbokedal’s picture

Think I put the weight to 10 or -10. But I can't get it to work again, so maybe it was just that one time I went lucky..

xlyz’s picture

Priority: Critical » Minor
Status: Active » Postponed

Fixed through a workaround. If user is anonymous, the delivery get created by a different rule fired by checkout completion.

Leaving open as reminder to check for a more solid solution.

jdjeet’s picture

This error may come while you are processing an array through Drupal API like insert/update of field collection element or something through API, but you have a wrong indexed array statement.

This results lack of Database Transaction Activity as the data can't be rendered perfectly from the array.