Noticed exception 'PDOException' with message 'There is already an active transaction' in /code/web/core/lib/Drupal/Core/Database/Connection.php:1605Noticed exception 'PDOException' with message 'There is already an active transaction' in /code/web/core/l

Created on 27 April 2022, over 2 years ago
Updated 23 August 2023, over 1 year ago

Problem/Motivation

Merging a separate German node into the German translation I ended up with a 500 error (I had the Remove node ticked and it's been deleted, the translation hasn't been merged)

Error message
PDOException: Noticed exception 'PDOException' with message 'There is already an active transaction' in /code/web/core/lib/Drupal/Core/Database/Connection.php:1605

Stack trace
…inTransaction called at /code/web/core/lib/Drupal/Core/Database/
Connection.php (1605)
…hTransaction called at /code/web/core/lib/Drupal/Core/Database/
Transaction.php (65)
…::__construct called at /code/web/core/lib/Drupal/Core/Database/
Connection.php (1519)
…alled at /code/web/core/lib/Drupal/Core/Entity/Sql/
SqlContentEntityStorage.php (800)
…tyStorage::save called at /code/web/core/lib/Drupal/Core/Entity/
EntityBase.php (339)
…code/web/modules/contrib/merge_translations/src/Form/
MergeTranslationsForm.php (267)
in Drupal\merge_translations\Form\MergeTranslationsForm::submitForm called at ? (?)
…ser_func_array called at /code/web/core/lib/Drupal/Core/Form/
FormSubmitter.php (114)
…SubmitHandlers called at /code/web/core/lib/Drupal/Core/Form/
FormSubmitter.php (52)
…er::doSubmitForm called at /code/web/core/lib/Drupal/Core/Form/
FormBuilder.php (592)
…der::processForm called at /code/web/core/lib/Drupal/Core/Form/
FormBuilder.php (320)
…ildForm called at /code/web/core/lib/Drupal/Core/Controller/
FormController.php (73)
in Drupal\Core\Controller\FormController::getContentResult called at ? (?)
…/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php (123)
…scriber\{closure} called at /code/web/core/lib/Drupal/Core/Render/
Renderer.php (564)
…/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php (124)
…/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php (97)
…Subscriber\{closure} called at /code/vendor/symfony/http-kernel/
HttpKernel.php (158)
…ttpKernel::handleRaw called at /code/vendor/symfony/http-kernel/
HttpKernel.php (80)
…l::handle called at /code/web/core/lib/Drupal/Core/StackMiddleware/
Session.php (58)
…e called at /code/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php (48)
…andle::handle called at /code/vendor/asm89/stack-cors/src/Asm89/Stack/
Cors.php (49)
…d at /code/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php (48)
…ed at /code/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php (51)
…e::handle called at /code/vendor/stack/builder/src/Stack/StackedHttpKernel.php (23)
…edHttpKernel::handle called at /code/web/core/lib/Drupal/Core/DrupalKernel.php (708)
in Drupal\Core\DrupalKernel::handle called at /code/web/index.php (19)

I had done the same merge locally before without problems

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

miiimooo Europe

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.

  • miiimooo Europe

    @lamp5 that's a misunderstanding. I meant to say I'm trying to merge a (separate) German node so it becomes the German translation.

    I think it's risky to delete the entities before the merged entity is successfully saved. If something happens before that the entity is irreversible lost.

    Also, if there is referencing counting in place somewhere, then saving before deleting is a a good idea. Imagine there is a clean-up happening if file reference count goes to 0 and the file is removed before the entity is saved.

  • Status changed to RTBC over 1 year ago
  • 🇫🇮Finland sokru

    I was not able to reproduce the issue with vanilla 10.1.x, but I assume this could be an issue on production. So after reading the reasoning and the code I think this should be committed.

Production build 0.71.5 2024