Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Drupal trigger this error when run drush updb :
Drupal\Core\Entity\EntityStorageException: 'action' [error]
entity with ID 'comment_delete_action' already exists. in
Drupal\Core\Entity\EntityStorageBase->doPreSave() (line 425 of
/var/www/hmail/src/htdocs/core/lib/Drupal/Core/Entity/EntityStorageBase.php).
I think it happens if you synchronise before you update then you are block.
Steps to reproduce
From #8
- Using Composer I successfully updated Drupal Core (from 8.37) and Drush (from 8.x) first.
- drush updb
- Status page has error "DATABASE UPDATES Out of date'
- Execute update script. /update.php/results show the error in the IS.
Proposed resolution
Workaround from #10 and #25
-
DELETE FROM `config` WHERE name = "system.action.comment_delete_action;" DELETE FROM `config` WHERE name = "views.view.comment"; TRUNCATE TABLE `cache_config`;
or via drush
drush sql-query "DELETE FROM config WHERE name ='system.action.comment_delete_action';" drush sql-query "DELETE FROM config WHERE name ='views.view.comment';" drush sql-query "TRUNCATE TABLE cache_config;"
- clear cache
- run update.php
Reported to work for #19, #24, #26, #27, #28, #31
Remaining tasks
Determine if this is blocking any site from upgrading.
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#13 | comment-action_exist-2915728-13.patch | 1.97 KB | xSDx |
#3 | comment-action_exist-2915728-1.patch | 1.14 KB | Musa.thomas |
Comments
Comment #2
cilefen CreditAttribution: cilefen commented@Musa.thomas Would you please add more of the steps to reproduce this?
Comment #3
Musa.thomasComment #4
Musa.thomasI just start update Database
Comment #5
Musa.thomasComment #6
cilefen CreditAttribution: cilefen commentedComment #7
xjmComment #8
zenlan CreditAttribution: zenlan as a volunteer commentedI too am experiencing this issue.
This site is a dev sandbox, the only installed contrib module is "examples", no contrib theme is installed. PHP Version 7.0.22-0ubuntu0.16.04.1 and MySQL Server version: 5.7.19-0ubuntu0.16.04.1
Using Composer I successfully updated Drupal Core (from 8.37) and Drush (from 8.x) first.
I then executed the database updates, no errors surfaced but it didn't look complete:
My /admin/reports/status page reports an error:
When I execute the update script via the browser I can see the exception on the /update.php/results page
Comment #9
zenlan CreditAttribution: zenlan as a volunteer commentedOK so I see that this is likely due to an 8.4 dependency issue that is being discussed in various places.
https://www.drupal.org/node/2898119
https://www.drupal.org/node/2914356
Some have recommended adding platform min version to the composer.json file like this...
... so I did and tried another composer update...
... but can't uninstall the comment module to get past the exception during db update.
From what I'm reading the recommendation is to upgrade to PHP 7.1.
Comment #10
zenlan CreditAttribution: zenlan as a volunteer commentedSo I got around the db update error with some manual SQL.
Cleared cache and ran update.php again, this time without any problems and the status report shows no errors.
Comment #11
dravenkI ran into the problem same with #8
Comment #12
xSDx CreditAttribution: xSDx at Websolutions Agency commentedPushing new patch that includes fix for comment
Comment #13
xSDx CreditAttribution: xSDx at Websolutions Agency commentedFixing typo
Comment #15
xSDx CreditAttribution: xSDx at Websolutions Agency commentedComment #16
dravenkThe test results failed
Comment #17
dravenk.
Comment #18
heddnDo we need to add a test here? It seems obvious to me that we should check if the config already exists before creating it again. I've re-queued tests in hopes the earlier failures were just intermittent testbot issues.
Comment #19
petednz CreditAttribution: petednz commentedThank you zenlan - i don't know how 'correct' your approach is but it worked for me and got me past repeated problems running drush updb and enabled it to complete. The one tweak was a mis-ordered semi-colon
Comment #20
heddnGoing to go out on a limb here and say an test isn't needed. And the patch obviously fixes the update path.
Comment #21
larowlan8.4.x is into 'criticals only' mode, so this needs to go into 8.5.x
Comment #22
larowlanWe have an existing upgrade path test for this, lets expand on it for this scenario.
Comment #24
nikunj.patel CreditAttribution: nikunj.patel as a volunteer commentedDear zenlan,
Your approached work after running the SQL query.
But the question is why this error occurring ?
Regards,
Nikunj Patel
Comment #25
ressa CreditAttribution: ressa at Ardea commentedThis is how to run the commands via drush:
Comment #26
zterry95 CreditAttribution: zterry95 commented#25 works for me.
Comment #27
bendev CreditAttribution: bendev at WebstanZ commented#25 is also working for me Thanks
Comment #28
cdmo CreditAttribution: cdmo commented#25 worked for me
Comment #29
myDrupal2014_846824658246 CreditAttribution: myDrupal2014_846824658246 commentedRunning the drush commands #25 and then run the update again worked for me too.
Comment #31
mlg4035 CreditAttribution: mlg4035 commentedGot this same error (PHP 7.2, Drupal 8.6.2) and #10 did the trick for me. Thanks!
Comment #32
AswathyAjish CreditAttribution: AswathyAjish commentedPatch in #3 worked for me. Thanks.
Comment #39
quietone CreditAttribution: quietone at PreviousNext commentedIs anyone experiencing this problem? If so, add a comment.
Comment #41
quietone CreditAttribution: quietone at PreviousNext commentedThere have been no reports of this problem for 4 years or that it is blocking an upgrade. For anyone encounetring this the workarounds are listed in the Issue Summary.
Therefore, closing as outdated. If you are encountering this problem open a new issue and refer to this one.
Thanks!