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.
When attempting to update today to handle security updates, I am hitting fatal errors. I have tried updating both from 2.2.6 and 2.2.8 (different projects) to 3.1.0 and I am consistently getting this fatal error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'lightning_core.versions' for key 'PRIMARY': UPDATE {config} SET name=:db_update_placeholder_0 [error]
WHERE (name = :db_condition_placeholder_0) AND (collection = :db_condition_placeholder_1); Array
(
[:db_update_placeholder_0] => lightning_core.versions
[:db_condition_placeholder_0] => lightning.versions
[:db_condition_placeholder_1] =>
)
I see the same error two times in the output.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2955072-7.patch | 3.75 KB | phenaproxima |
Comments
Comment #2
balsamaRelated commits to Lightning Core:
Comment #3
balsamaComment #4
balsamaAs I understand this:
This is where things start to get fuzzy because there are at least three separate commits which actually change the contents of lightning_core_update_8006. One thing is certain, HEAD of lightning_core 1.x and 2.x and the most recent release on each (1.0.0-rc3 and 2.1.0 respectively) have identical code in 8006 and 8007. And the version of Lightning Core that shipped with the 2.2.8 profile DID NOT HAVE EITHER.
So, updating from 2.2.6 to 3.0.3 (for example) should be the same as updating from 2.2.8 to 3.1.0 as far as the lightning.versions config is concerned.
It seems to me that 8006 is still very much broken for anybody that has the lightning.versions config object.
Comment #5
balsamaAfter to talking to @phenaproxima, I think my assessment in #4 is wrong. The situation arises when the installer reaches the 8007 update and the
lightning_core.versions
already exists. This can happen iflightning_core_modules_installed
has reacted to a module being installed sometime before 8007 - which becomes more likely if your update is particularly complex (lots of things getting installed/updated/uninstalled).The fix should be to just have 8007 check for the presence of lightning_core.versions and merge the contents of it if it does exist.
++ to @phenaproxima and @mikemadison for tracing this.
Comment #6
phenaproximaOpened a PR which should correct the issue: https://github.com/acquia/lightning-core/pull/39
Comment #7
phenaproximaHere is a patch, for those who cannot access the pull request.
From the PR summary, for posterity:
Comment #10
phenaproximaCommitted to 8.x-2.x and cherry-picked to 8.x-1.x. Cheerio!