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.
After updating to Drupal 8.7.0 and updating the database using drush updb
system update 8702 fails. I'm not sure how to debug this, or where that error message is coming from exactly
> [notice] Update started: system_update_8702
> [error] Call to a member function getKey() on null
Any one experienced the same problem and have any idea how to fix this?
Thanks.
Stack trace from a duplicate issue:
php error report
[03-May-2019 11:34:15 America/Halifax] Error: Call to a member function getKey() on null in H:\new-drupal-project\web\core\modules\system\system.install on line 2278 #0 H:\new-drupal-project\web\core\includes\update.inc(184): system_update_8702(Array)
#1 H:\new-drupal-project\web\core\includes\batch.inc(295): update_do_one('system', 8702, Array, Array)
#2 H:\new-drupal-project\web\core\includes\batch.inc(137): _batch_process()
#3 H:\new-drupal-project\web\core\includes\batch.inc(93): _batch_do()
#4 H:\new-drupal-project\web\core\modules\system\src\Controller\DbUpdateController.php(186): _batch_page(Object(Symfony\Component\HttpFoundation\Request))
#5 [internal function]: Drupal\system\Controller\DbUpdateController->handle('start', Object(Symfony\Component\HttpFoundation\Request))
#6 H:\new-drupal-project\web\core\lib\Drupal\Core\Update\UpdateKernel.php(115): call_user_func_array(Array, Array)
#7 H:\new-drupal-project\web\core\lib\Drupal\Core\Update\UpdateKernel.php(76): Drupal\Core\Update\UpdateKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request))
#8 H:\new-drupal-project\web\update.php(28): Drupal\Core\Update\UpdateKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#9 {main}
Comment | File | Size | Author |
---|---|---|---|
#26 | 3052467-failing.patch | 1.01 KB | gease |
#12 | 3052467-12.patch | 4.51 KB | amateescu |
#12 | 3052467-12-test-only.patch | 3.36 KB | amateescu |
#6 | 3052467.patch | 1.14 KB | amateescu |
Comments
Comment #2
Rick Bergmann CreditAttribution: Rick Bergmann as a volunteer and commentedComment #3
cilefen CreditAttribution: cilefen as a volunteer commentedComment #4
xjmComment #5
Rick Bergmann CreditAttribution: Rick Bergmann as a volunteer and commentedComment #6
amateescu CreditAttribution: amateescu for Pfizer, Inc. commented@Rick Bergmann, can you try this patch?
Comment #7
Rick Bergmann CreditAttribution: Rick Bergmann as a volunteer and commentedYes, the patch works for me. Thank You @amateescu!
Comment #8
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedNo problem, it's nice to see that's the only problem you had with the 8.7.0 update :)
Comment #9
Ulminia CreditAttribution: Ulminia commentedpatch applied and working now i have another issue
ideas?
Comment #10
amateescu CreditAttribution: amateescu for Pfizer, Inc. commented@Ulminia, can you check the recent log messages and see if there's any error recorded there?
Comment #11
plach#9 seems a separate problem, the patch looks good to me and fixes the issue reported in the OP. Setting to NW for the missing test coverage.
Comment #12
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedHere's the test coverage. The test-only file is also the interdiff.
Comment #14
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedTests were added, I think this is ready for a committer review.
Comment #15
plachRTBC +1
Comment #16
alexpottCommitted and pushed e14126d6a8 to 8.8.x and 2962eb2495 to 8.7.x. Thanks!
Nice find @Rick Bergmann and nice fix @amateescu. Thanks!
Comment #19
gregrusson CreditAttribution: gregrusson commentedI am having this same issue. Can someone guide me as to how I apply this patch to Druap 8.7.x?
Comment #20
cilefen CreditAttribution: cilefen as a volunteer commentedhttps://www.drupal.org/patch/apply is the basic. If you manage the site with Composer, use https://github.com/cweagans/composer-patches.
Comment #21
gregrusson CreditAttribution: gregrusson commentedThanks, @cilefen, I was able to get it to work through composer.
Comment #22
MagdalenaA67 CreditAttribution: MagdalenaA67 commentedSame error solved without patch.
I ran the update from 8.6.15 to 8.7.1 and first had the same errors:
[error] Call to a member function getKey() on null
[error] Update failed: system_update_8702
I then started over because the patch didn't work for me. I checked out live and dropped current db and added backup of live database to get me back to before I ran the update. I then ran these commands and it worked.
With new branch created from live and live update now local...
composer update drupal/core webflo/drupal-core-require-dev --with-dependencies
drush cr
drush updb
drush cr
check UI /admin/config/development/configuration if config isn't clean, which it should not be run drush cex
Comment #23
pameeela CreditAttribution: pameeela as a volunteer commentedThanks everyone for taking part in this issue. If you'd like to help us make sure the 8.8.0 update is as smooth as possible, please consider signing up for the beta testing program at https://goo.gl/forms/bMBTMRSY3sKEscUJ3
Comment #25
geaseThe testDeletedEntityType test, introduced with this patch, breaks other post-update hook tests, #2960643-23: Cannot load entity by uuid after rename for example. What we do there is iterating through all config entities and loading them by UUID.
$loadable = (bool) $entity_repository->loadEntityByUuid($entity_type_id, $entity->uuid());
This should be perfectly valid operation in post-update hook, but field configuration loading throws PluginNotFoundException 'The entity_test_update entity type does not exist.'Created a separate issue #3092497: Deleted entity types now break update tests about that.
Comment #26
geaseJust a small patch illustrating the above problem.