- 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.
As a bug this will need a test case to show the issue.
Could the issue summary be updated to the default template showing proposed solution and remaining tasks please.
Tagged for manual testing for someone who uses postgresql. - 🇮🇹Italy smarchese
Thanks @ankithashetty the patch #26 🐛 Postgres driver issue with nested savepoints mimic_implicit_commit duplicated Needs work it's work for me!
- 🇺🇸United States jakegibs617
adding a remake of 2920527-26.patch but fitting to druapl 10.2.2
- last update
12 months ago Custom Commands Failed - last update
12 months ago Custom Commands Failed - 🇺🇸United States jakegibs617
@abelass are you able to clear the cache with the patch?
when I run drush cr
I am getting:
A transaction named mimic_implicit_commit is already in use. Active stack: 65b129b004e365.44430355\drupal_transaction > 65b129b020e3c2.42669084\mimic_implicit_commitlooking into it more now
- last update
12 months ago 25,815 pass, 1,805 fail - last update
12 months ago 25,821 pass, 1,793 fail - last update
12 months ago Build Successful - 🇪🇸Spain abelass
@jakegibs617 sorry for my late answer, we only could test the patch yesterday. #37 worked fine in our tests, thanks.
- First commit to issue fork.
- 🇦🇺Australia elimw
I updated Group contrib to 2.3.1 and noticed this issue. I applied patch #37 and even updated Core to 10.4.1 but neither fixed the issue.
- First commit to issue fork.
- 🇩🇪Germany vistree
I see the same error after upgrading groups module and trying to migrate user realationship.
[error] Drupal\Core\Database\TransactionNameNonUniqueException: A transaction named mimic_implicit_commit is already in use. Active stack: 677fe54f644a06.04798895\drupal_transaction > 677fe54f67f767.51173260\mimic_implicit_commit in Drupal\Core\Database\Transaction\TransactionManagerBase->push() (line 254 of /var/www/docroot/core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php).
I tried patch from #37 - but this does not solve the error for me.
- Merge request !10859Fixed 'transaction named mimic_implicit_commit already in use' exception for... → (Open) created by dydave
- 🇫🇷France dydave
Thanks a lot Jake (@jakegibs617) for the contributed patch above at #37, the great documentation of the issue and getting the ball rolling with this patch.
I've tried to mention your work as much as possible in the MR to associate the credit.
Quick follow-up:
Created initial merge request above at #44:
1 - Rolled in patch from #372 - Added additional fix based on stack trace:
Drupal\Core\Entity\EntityStorageException: A transaction named mimic_implicit_commit is already in use. Active stack: 677ffe0d432d66.20858170\drupal_transaction > 677ffe0d4c76f6.93298422\mimic_implicit_commit in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php). Drupal\pgsql\Driver\Database\pgsql\Connection->startTransaction('mimic_implicit_commit') (Line: 429) Drupal\pgsql\Driver\Database\pgsql\Connection->addSavepoint() (Line: 149) Drupal\pgsql\Driver\Database\pgsql\Schema->queryTableInformation('cache_flexible_permissions') (Line: 35) Drupal\pgsql\Driver\Database\pgsql\Upsert->execute() (Line: 312) Drupal\Core\Cache\DatabaseBackend->doSetMultiple(Array) (Line: 227) Drupal\Core\Cache\DatabaseBackend->setMultiple(Array) (Line: 211) Drupal\Core\Cache\DatabaseBackend->set('flexible_permissions:outsider:[user.roles]=authenticated', Object, -1, Array) (Line: 136) Drupal\Core\Cache\VariationCache->set(Array, Object, Object, Object) (Line: 172) Drupal\flexible_permissions\ChainPermissionCalculator->calculatePermissions(Object, 'outsider') (Line: 39) Drupal\group\Access\GroupPermissionCalculator->calculateFullPermissions(Object) (Line: 40) Drupal\group\QueryAccess\GroupQueryAlter->doAlter('view') (Line: 143) Drupal\group\QueryAccess\QueryAlterBase->alter(Object, Object) (Line: 333) group_query_entity_query_alter(Object, NULL, NULL) (Line: 552) Drupal\Core\Extension\ModuleHandler->alter('query', Object) (Line: 494) Drupal\Core\Database\Query\Select->preExecute() (Line: 519) Drupal\Core\Database\Query\Select->execute() (Line: 157) Drupal\pgsql\Driver\Database\pgsql\Select->execute() (Line: 272) Drupal\Core\Entity\Query\Sql\Query->result() (Line: 85) Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 391) Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection->validateReferenceableEntities(Array) (Line: 133) Drupal\Core\Entity\Plugin\Validation\Constraint\ValidReferenceConstraintValidator->validate(Object, Object) (Line: 202) Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateConstraints(Object, '0000000000000e150000000000000000', Array) (Line: 154) Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object) (Line: 164) Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object, Array, 1) (Line: 106) Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validate(Object, NULL, NULL) (Line: 93) Drupal\Core\TypedData\Validation\RecursiveValidator->validate(Object) (Line: 132) Drupal\Core\TypedData\TypedData->validate() (Line: 518) Drupal\Core\Entity\ContentEntityBase->validate() (Line: 25) Drupal\group\Entity\GroupMembership->preSave(Object) (Line: 528) Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 753) Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object) (Line: 483) Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 806) Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 147) Drupal\group\Entity\Group->addRelationship(Object, 'group_membership', Array) (Line: 183) Drupal\group\Entity\Group->addMember(Object) (Line: 214) Drupal\CUSTOM->submitForm(Array, Object) call_user_func_array(Array, Array) (Line: 129) Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 67) Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597) Drupal\Core\Form\FormBuilder->processForm('free_trial_checkout_form', Array, Object) (Line: 326) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 53) Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Mostly :
Drupal\pgsql\Driver\Database\pgsql\Schema->queryTableInformation('cache_flexible_permissions') (Line: 35)
Tested and fixed issue in our project (similar versions mentioned above at #41) \o/
==> It probably still needs work, testing, but for now it fixes the issue in our project and allows us to move forward.Any reviews and feedback would be greatly appreciated.
Thanks in advance! - 🇩🇪Germany vistree
@dydave - is your MR expected to also solve the error on
Drupal\Core\Database\TransactionNameNonUniqueException
mentioned in #36 and #43? - 🇫🇷France dydave
Thanks for the prompt feedback @vistree:
is your MR expected to also solve the error on
Drupal\Core\Database\TransactionNameNonUniqueException
mentioned in #36 and #43?Really not sure about that, since we haven't come across this particular error.
Could you please try providing a backtrace, similar to the one above at #45.Otherwise, perhaps more straight forward: Give the patch at:
https://git.drupalcode.org/project/drupal/-/merge_requests/10859.diff
a quick test and see if it fixes the issue in you project?Thanks Matthew (@mradcliffe) for the help reviewing and cleaning up the MR.
Cheers! - 🇦🇺Australia elimw
I have pushed a change to fix the issue I was encountering.
Rather than having to explicitly check if we should wrap a query in a savepoint before calling "Connection::addSavepoint()", wouldn't it be better to do the check inside of "Connection::addSavepoint()" instead?
- 🇩🇪Germany vistree
@dydave - I found a backtrace in Watchdog. Is this helpfull? I am still on Drupal 10.4 by the way!! Error appears when trying to migrate Group User Relations with drush migrate:
Drupal\Core\Database\TransactionNameNonUniqueException: A transaction named mimic_implicit_commit is already in use. Active stack: 677fb68df0dbc1.32969210\drupal_transaction > 677fb68df23611.91989256\mimic_implicit_commit in Drupal\Core\Database\Transaction\TransactionManagerBase->push() (Zeile 254 in /data/html/docroot/core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php).
#0 /data/html/docroot/core/modules/pgsql/src/Driver/Database/pgsql/Connection.php(558): Drupal\Core\Database\Transaction\TransactionManagerBase->push() #1 /data/html/docroot/core/modules/pgsql/src/Driver/Database/pgsql/Connection.php(431): Drupal\pgsql\Driver\Database\pgsql\Connection->startTransaction() #2 /data/html/docroot/core/modules/pgsql/src/Driver/Database/pgsql/Schema.php(149): Drupal\pgsql\Driver\Database\pgsql\Connection->addSavepoint() #3 /data/html/docroot/core/modules/pgsql/src/Driver/Database/pgsql/Upsert.php(35): Drupal\pgsql\Driver\Database\pgsql\Schema->queryTableInformation() #4 /data/html/docroot/core/lib/Drupal/Core/Cache/DatabaseBackend.php(312): Drupal\pgsql\Driver\Database\pgsql\Upsert->execute() #5 /data/html/docroot/core/lib/Drupal/Core/Cache/DatabaseBackend.php(227): Drupal\Core\Cache\DatabaseBackend->doSetMultiple() #6 /data/html/docroot/core/lib/Drupal/Core/Cache/DatabaseBackend.php(215): Drupal\Core\Cache\DatabaseBackend->setMultiple() #7 /data/html/docroot/core/lib/Drupal/Core/Cache/VariationCache.php(176): Drupal\Core\Cache\DatabaseBackend->set() #8 /data/html/docroot/modules/contrib/flexible_permissions/src/ChainPermissionCalculator.php(172): Drupal\Core\Cache\VariationCache->set() #9 /data/html/docroot/modules/contrib/group/src/Access/GroupPermissionCalculator.php(39): Drupal\flexible_permissions\ChainPermissionCalculator->calculatePermissions() #10 /data/html/docroot/modules/contrib/group/src/QueryAccess/GroupQueryAlter.php(40): Drupal\group\Access\GroupPermissionCalculator->calculateFullPermissions() #11 /data/html/docroot/modules/contrib/group/src/QueryAccess/QueryAlterBase.php(143): Drupal\group\QueryAccess\GroupQueryAlter->doAlter() #12 /data/html/docroot/modules/contrib/group/group.module(333): Drupal\group\QueryAccess\QueryAlterBase->alter() #13 /data/html/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(552): group_query_entity_query_alter() #14 /data/html/docroot/core/lib/Drupal/Core/Database/Query/Select.php(494): Drupal\Core\Extension\ModuleHandler->alter() #15 /data/html/docroot/core/lib/Drupal/Core/Database/Query/Select.php(519): Drupal\Core\Database\Query\Select->preExecute() #16 /data/html/docroot/core/modules/pgsql/src/Driver/Database/pgsql/Select.php(157): Drupal\Core\Database\Query\Select->execute() #17 /data/html/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(272): Drupal\pgsql\Driver\Database\pgsql\Select->execute() #18 /data/html/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(85): Drupal\Core\Entity\Query\Sql\Query->result() #19 /data/html/docroot/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php(401): Drupal\Core\Entity\Query\Sql\Query->execute() #20 /data/html/docroot/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php(133): Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection->validateReferenceableEntities() #21 /data/html/docroot/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php(202): Drupal\Core\Entity\Plugin\Validation\Constraint\ValidReferenceConstraintValidator->validate() #22 /data/html/docroot/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php(154): Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateConstraints() #23 /data/html/docroot/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php(164): Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode() #24 /data/html/docroot/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php(106): Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode() #25 /data/html/docroot/core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php(93): Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validate() #26 /data/html/docroot/core/lib/Drupal/Core/TypedData/TypedData.php(132): Drupal\Core\TypedData\Validation\RecursiveValidator->validate() #27 /data/html/docroot/core/lib/Drupal/Core/Entity/ContentEntityBase.php(518): Drupal\Core\TypedData\TypedData->validate() #28 /data/html/docroot/modules/contrib/group/src/Entity/GroupMembershipTrait.php(25): Drupal\Core\Entity\ContentEntityBase->validate() #29 /data/html/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(528): Drupal\group\Entity\GroupMembership->preSave() #30 /data/html/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(753): Drupal\Core\Entity\EntityStorageBase->doPreSave() #31 /data/html/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave() #32 /data/html/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(806): Drupal\Core\Entity\EntityStorageBase->save() #33 /data/html/docroot/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() #34 /data/html/docroot/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php(237): Drupal\Core\Entity\EntityBase->save() #35 /data/html/docroot/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php(175): Drupal\migrate\Plugin\migrate\destination\EntityContentBase->save() #36 /data/html/docroot/core/modules/migrate/src/MigrateExecutable.php(248): Drupal\migrate\Plugin\migrate\destination\EntityContentBase->import() #37 /data/html/vendor/drush/drush/includes/drush.inc(62): Drupal\migrate\MigrateExecutable->import() #38 /data/html/vendor/drush/drush/includes/drush.inc(53): drush_call_user_func_array() #39 /data/html/docroot/modules/contrib/migrate_tools/src/Drush/Commands/MigrateToolsCommands.php(1074): drush_op() #40 /data/html/docroot/modules/contrib/migrate_tools/src/Drush/Commands/MigrateToolsCommands.php(483): Drupal\migrate_tools\Drush\Commands\MigrateToolsCommands->executeMigration() #41 [internal function]: Drupal\migrate_tools\Drush\Commands\MigrateToolsCommands->import() #42 /data/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array() #43 /data/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() #44 /data/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() #45 /data/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process() #46 /data/html/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute() #47 /data/html/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run() #48 /data/html/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand() #49 /data/html/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun() #50 /data/html/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run() #51 /data/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun() #52 /data/html/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run() #53 /data/html/vendor/drush/drush/drush(4): require('/data/html/docr...') #54 /data/html/vendor/bin/drush(119): include('/data/html/docr...') #55 {main}
- 🇫🇷France dydave
Nice one @vistree!
I am still on Drupal 10.4 by the way!! Therefor patch https://git.drupalcode.org/project/drupal/-/merge_requests/10859.diff will not apply.
Just did the test with D10.4.1 and the patch applies very well.
Additionally, looking at your stack trace, see:
#3 /data/html/docroot/core/modules/pgsql/src/Driver/Database/pgsql/Upsert.php(35): Drupal\pgsql\Driver\Database\pgsql\Schema->queryTableInformation()
Same as pointed above at #45.
Therefore: The patch should apply and fix the issue for your project! \o/
Could you please do a quick round of test and report back?
Thanks in advance!
- 🇫🇷France dydave
Thanks Elim (@elimw), re #48:
Rather than having to explicitly check if we should wrap a query in a savepoint before calling "Connection::addSavepoint()", wouldn't it be better to do the check inside of "Connection::addSavepoint()" instead?
Sounds good! I'm not super familiar with the overall code of the
pgsql
module, but if you do a quick search around and see where the functions are used and if there would be any unexpected impacts, it would be great!Could you perhaps create a new merge request with a different patch?
We would be able to give the patch a round of tests and see if it could be equivalent to the current MR!10859.Thanks in advance!
- 🇩🇪Germany vistree
@dydave -After upgrading to current Drupal core 10.4.1 patch from MR (https://git.drupalcode.org/project/drupal/-/merge_requests/10859.diff) applied and - what great news - solved the error on running my migration ;-)
So, I can confirm that the MR solves the error regarding "Drupal\Core\Database\TransactionNameNonUniqueException" on group relationship migrations.
- Merge request !10896Check if psql savepoint exists before adding it. → (Open) created by Unnamed author
- 🇦🇺Australia elimw
@dydave, @vistree, I've created separate MR which checks if a savepoint with the same name already exists before pushing a transaction.
- 🇩🇪Germany vistree
@elimw: is your MR a replacement or an addition for MR 10859 ?
- 🇫🇷France dydave
Thanks a lot Elim (@elimw)! Great job!
We've just given a round of tests with the merge request you created MR!10896 and it fixed the issue as well for us 🥳
We've updated the patch in our project to use the one from #54.@vistree:
Yes indeed, the patch created by Elim can be tested here:
https://git.drupalcode.org/project/drupal/-/merge_requests/10896.diffIt should fix the issue in your project as well.
It's a different (better) way of writing the same thing as the previous patch.
Thanks again for the work Elim and in advance for your feedback @vistree!
- 🇺🇸United States mradcliffe USA
The merge request 10896 (#45) seems to be 1770 commits behind the target branch and needs a rebase. It's currently failing tests.
The issue is a little hard to follow and I think next if someone could address the Needs issue summary update tag that would be helpful to clarify proposed resolutions and remaining tasks.
- 🇨🇦Canada andrew.wang
https://git.drupalcode.org/project/drupal/-/merge_requests/10859.diff solved this issue for me after installing entity_reference_integrity on Drupal 10.3.10.
https://git.drupalcode.org/project/drupal/-/merge_requests/10896.diff also worked!
- 🇫🇷France dydave
@mradcliffe: Both merge requests have been rebased.
Issue summary still needs to be updated.
Thanks!
- 🇩🇪Germany vistree
I can confirm that also the MR https://git.drupalcode.org/project/drupal/-/merge_requests/10896.diff solves the error regarding "Drupal\Core\Database\TransactionNameNonUniqueException" on group relationship migrations.