Conflict with Commerce module

Created on 13 June 2019, over 5 years ago
Updated 23 April 2024, 7 months ago

Hi,
I get an error on user login, because of removing or changing Commerce Cart by Commerce Combine Cart module:

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Entity\EntityStorageException</em>: SQLSTATE[HY000]: General error: 1449 The user specified as a definer (&#039;default_dbo&#039;@&#039;%&#039;) does not exist: INSERT INTO {entity_log} (uuid, langcode, user_id, entity_logged_id__target_id, entity_logged_id__target_type, label, old_value, new_value, name, log_type, hostname, status, created, changed) 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, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13); Array
(
    [:db_insert_placeholder_0] =&gt; 567f3bc5-145b-4261-b33b-f4d19fcfb76d
    [:db_insert_placeholder_1] =&gt; en
    [:db_insert_placeholder_2] =&gt; 1
    [:db_insert_placeholder_3] =&gt; 595
    [:db_insert_placeholder_4] =&gt; commerce_order
    [:db_insert_placeholder_5] =&gt; Order items
    [:db_insert_placeholder_6] =&gt; 584,696,574,568
    [:db_insert_placeholder_7] =&gt; 584,696,574,568,539
    [:db_insert_placeholder_8] =&gt; order_items
    [:db_insert_placeholder_9] =&gt; commerce_order
    [:db_insert_placeholder_10] =&gt; 127.0.0.1
    [:db_insert_placeholder_11] =&gt; 1
    [:db_insert_placeholder_12] =&gt; 1560402015
    [:db_insert_placeholder_13] =&gt; 1560402015
)
 in <em class="placeholder">Drupal\Core\Entity\Sql\SqlContentEntityStorage-&gt;save()</em> (line <em class="placeholder">783</em> of <em class="placeholder">core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php</em>). <pre class="backtrace">Drupal\Core\Database\Statement-&gt;execute(Array, Array) (Line: 625)
Drupal\Core\Database\Connection-&gt;query(&#039;INSERT INTO {entity_log} (uuid, langcode, user_id, entity_logged_id__target_id, entity_logged_id__target_type, label, old_value, new_value, name, log_type, hostname, status, created, changed) 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, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13)&#039;, Array, Array) (Line: 358)
Drupal\Core\Database\Driver\mysql\Connection-&gt;query(&#039;INSERT INTO {entity_log} (uuid, langcode, user_id, entity_logged_id__target_id, entity_logged_id__target_type, label, old_value, new_value, name, log_type, hostname, status, created, changed) 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, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13)&#039;, Array, Array) (Line: 32)
Drupal\Core\Database\Driver\mysql\Insert-&gt;execute() (Line: 864)
Drupal\Core\Entity\Sql\SqlContentEntityStorage-&gt;doSaveFieldItems(Object) (Line: 595)
Drupal\Core\Entity\ContentEntityStorageBase-&gt;doSave(NULL, Object) (Line: 429)
Drupal\Core\Entity\EntityStorageBase-&gt;save(Object) (Line: 774)
Drupal\Core\Entity\Sql\SqlContentEntityStorage-&gt;save(Object) (Line: 390)
Drupal\Core\Entity\Entity-&gt;save() (Line: 120)
Drupal\entity_log\EntityLogService-&gt;logFields(Object, Array) (Line: 44)
entity_log_entity_update(Object)
call_user_func_array(&#039;entity_log_entity_update&#039;, Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler-&gt;invokeAll(&#039;entity_update&#039;, Array) (Line: 206)
Drupal\Core\Entity\EntityStorageBase-&gt;invokeHook(&#039;update&#039;, Object) (Line: 773)
Drupal\Core\Entity\ContentEntityStorageBase-&gt;invokeHook(&#039;update&#039;, Object) (Line: 92)
Drupal\commerce\CommerceContentEntityStorage-&gt;invokeHook(&#039;update&#039;, Object) (Line: 103)
Drupal\commerce_order\OrderStorage-&gt;invokeHook(&#039;update&#039;, Object) (Line: 507)
Drupal\Core\Entity\EntityStorageBase-&gt;doPostSave(Object, 1) (Line: 658)
Drupal\Core\Entity\ContentEntityStorageBase-&gt;doPostSave(Object, 1) (Line: 432)
Drupal\Core\Entity\EntityStorageBase-&gt;save(Object) (Line: 774)
Drupal\Core\Entity\Sql\SqlContentEntityStorage-&gt;save(Object) (Line: 390)
Drupal\Core\Entity\Entity-&gt;save() (Line: 317)
Drupal\commerce_order\Entity\OrderItem-&gt;postSave(Object, 1) (Line: 506)
Drupal\Core\Entity\EntityStorageBase-&gt;doPostSave(Object, 1) (Line: 658)
Drupal\Core\Entity\ContentEntityStorageBase-&gt;doPostSave(Object, 1) (Line: 432)
Drupal\Core\Entity\EntityStorageBase-&gt;save(Object) (Line: 774)
Drupal\Core\Entity\Sql\SqlContentEntityStorage-&gt;save(Object) (Line: 390)
Drupal\Core\Entity\Entity-&gt;save() (Line: 117)
Drupal\commerce_cart\CartManager-&gt;addOrderItem(Object, Object, ) (Line: 125)
Drupal\commerce_combine_carts\CartUnifier-&gt;combineCarts(Object, Object, 1) (Line: 98)
Drupal\commerce_combine_carts\CartUnifier-&gt;combineUserCarts(Object) (Line: 25)
commerce_combine_carts_user_login(Object)
call_user_func_array(&#039;commerce_combine_carts_user_login&#039;, Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler-&gt;invokeAll(&#039;user_login&#039;, Array) (Line: 566)
user_login_finalize(Object) (Line: 230)
Drupal\user\Controller\UserController-&gt;resetPassLogin(&#039;1&#039;, &#039;1560402003&#039;, &#039;7DJgtpl4QaRreZQPb1CXr68Rs3x6Ek2WAEqgLFM07iY&#039;)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 67)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 184)
Drupal\page_cache\StackMiddleware\PageCache-&gt;fetch(Object, 1, 1) (Line: 121)
Drupal\page_cache\StackMiddleware\PageCache-&gt;lookup(Object, 1, 1) (Line: 75)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 84)
Drupal\shield\ShieldMiddleware-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

User 595 doesn't exist anymore, but Commerce Cart does still exist, so when I delete this Cart and try to save logs about it, it causes an error.

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇷🇸Serbia levmyshkin Novi Sad, Serbia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany Anybody Porta Westfalica

    I think in general, entity_log has to be able to also deal with deleted entities of any kind and may not be too strict about it. That would also be helpful for Allow logging Create & Delete events Active

  • Status changed to Closed: works as designed 7 months ago
  • 🇭🇷Croatia milosr Croatia, Montenegro

    Hi @levmyshkin

    The Entity log is used for tracking field changes on entities.

    It's not used for deleting, so it seems like your custom integration for logging entity deletions caused an issue.

    I tried the case you described, but I did not encounter any issues because the module does not log any deletions.

Production build 0.71.5 2024