Hi
When tried to Run database update after updating core 8.6.16 to 8.7.2 got
Do you wish to run all pending updates? (y/n): y
Efter opdatering af menu_link_content [ok]
Efter opdatering af menu_link_content [ok]
Efter opdatering af menu_link_content [ok]
Failed: Drupal\Core\Entity\EntityStorageException: Exception thrown while [error]
performing a schema update. Cannot rename table to table_new: The table table already exists. i
Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (linje
1611 af
/var/www/site/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php)
Comments
Comment #2
mudassar774 commentedComment #3
cilefen commentedI think this could be a duplicate of this existing issue.
Comment #4
cilefen commentedComment #5
mudassar774 commentedHi @cilefen thanks for quick prompt
when i ran the UPDB first time end up with issue
If i clear the cache and run UPDB again this type error go away but failed with Cannot rename table to table_new: The table table already exists.
As per suggestion in related issue i drop the tables
menu_link_content_field_revisionandmenu_link_content_revisionmanually and run UPDB it brings above type error again. Look like a chicken and egg problemComment #6
cilefen commentedComment #7
cilefen commentedDid you restore the entire database before executing update.php or only removed two tables?
Comment #8
mmjvb commentedNo, not really like a chicken and egg problem. What this tells you is that clearing cache is not solving the update issue. The related issue tells you that the update is not reentrant. That is what makes the removal of those tables necessary. When something goes wrong it doesn't go back to a situation that you can update. You need to do that yourself manually. The best way is to properly restore your database, making sure it is in a consistent state. With intimate knowledge of the update process and what went wrong the removal of the tables might be enough. Advice a proper restore, because the cause of what went wrong is stil to be determined.
That leaves the original error to be analyzed, the data corruption fixed and run into the next issue with the update. When lucky, the update succeeds without issues. Then the search for the cause of the data corruption starts. That cause needs to be resolved as well.
Comment #9
mudassar774 commented@cilefen I just remove those 2 tables after first updb fails. What does you mean restore database. Does it SQL-DROP and than dump in again??
seems there is no way to get rid of this TYPED ERROR except cache clear as per discussion here.
https://www.drupal.org/project/drupal/issues/3031128#comment-12959541
Comment #10
mudassar774 commentedComment #11
plachShould mark this as a duplicate of #3006815: ViewsEntitySchemaSubscriber may fail when a view has a broken handler, now that a patch is available over there?
Comment #12
plach#3006815: ViewsEntitySchemaSubscriber may fail when a view has a broken handler was committed, tentatively closing this as a duplicate of that and #3039586: Cannot rename tmp_2362aemenu_link_content_revision to menu_link_content_revision.