WSOD after upgrading from 8.5.7 to 8.6.0.
Here's php and nginx log:
php | [07-Sep-2018 12:08:59] WARNING: [pool www] child 68 said into stderr: "NOTICE: PHP message: Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'block_content_field_data.reusable' in 'where clause': SELECT base_table.revision_id AS revision_id, base_table.id AS id"
php | [07-Sep-2018 12:08:59] WARNING: [pool www] child 68 said into stderr: "FROM"
php | [07-Sep-2018 12:08:59] WARNING: [pool www] child 68 said into stderr: "{block_content} base_table"
nginx | 2018/09/07 12:08:59 [error] 24#24: *507 FastCGI sent in stderr: "PHP message: Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'block_content_field_data.reusable' in 'where clause': SELECT base_table.revision_id AS revision_id, base_table.id AS id
nginx | FROM
nginx | {block_content} base_table
nginx | INNER JOIN {block_content_field_data} block_content_field_data ON block_content_field_data.id = base_table.id
nginx | WHERE (block_content_field_data.reusable IN (:db_condition_placeholder_0)) AND (block_content_field_data.default_langcode IN (:db_condition_placeholder_1)); Array
nginx | (
nginx | [:db_condition_placeholder_0] => 1
nginx | [:db_condition_placeholder_1] => 1
nginx | )
nginx | " at /var/www/html/web/core/lib/Drupal/Core/Database/Connection.php line 686" while reading response header from upstream, client: 172.18.0.6, server: drupal, request: "GET / HTTP/1.1", upstream: "fastcgi://172.18.0.4:9000", host: "EXAMPLE.COM"
nginx | 172.18.0.6 - - [07/Sep/2018:12:08:59 +0000] "GET / HTTP/1.1" 500 79 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
php | [07-Sep-2018 12:08:59] WARNING: [pool www] child 68 said into stderr: "INNER JOIN {block_content_field_data} block_content_field_data ON block_content_field_data.id = base_table.id"
php | [07-Sep-2018 12:08:59] WARNING: [pool www] child 68 said into stderr: "WHERE (block_content_field_data.reusable IN (:db_condition_placeholder_0)) AND (block_content_field_data.default_langcode IN (:db_condition_placeholder_1)); Array"
php | [07-Sep-2018 12:08:59] WARNING: [pool www] child 68 said into stderr: "("
php | [07-Sep-2018 12:08:59] WARNING: [pool www] child 68 said into stderr: " [:db_condition_placeholder_0] => 1"
php | [07-Sep-2018 12:08:59] WARNING: [pool www] child 68 said into stderr: " [:db_condition_placeholder_1] => 1"
php | [07-Sep-2018 12:08:59] WARNING: [pool www] child 68 said into stderr: ")"
php | [07-Sep-2018 12:08:59] WARNING: [pool www] child 68 said into stderr: "" at /var/www/html/web/core/lib/Drupal/Core/Database/Connection.php line 686"
php | 172.18.0.7 - 07/Sep/2018:12:08:59 +0000 "GET /index.php" 500
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Screenshot from 2018-09-11 09-44-06.png | 77.65 KB | alesr |
Comments
Comment #2
twfahey commentedJust to confirm - Did you run database updates?
Comment #3
cilefen commentedComment #4
berdirAs pointed out in slack once, we should definitely catch that exception, might result in some "this block is missing" warnings but otherwise at least the front page should be working.
But yes, this should only happen if you either didn't run updates or if they failed and didn't complete.
Comment #5
kennybell commentedHi, reporting similar issue after drush cim:
Comment #6
berdirWhat are the exact commands you did run? Did you run drush updb first? What was the output?
You don't want to run a drush cim after doing a core/module upgrade as that might actually revert configuration back that was changed by the update.
Comment #7
alesr commentedI had to do it again today because I reverted to 8.5.7 on Friday.
I ran the same command "composer require drupal/core:8.6.0 webflo/drupal-core-require-dev --update-with-dependencies" and this time I got no errors when visiting the site!
And this is before UPDB.
You can see in status report that I got notified to run updates.
It's hard to tell why this time I got through without WSOD because no apparent changes were made.
Updb would probably solved it because I only ran clear caches a few times, but I still got through without when I tried it again.
Meanwhile I ran the updates and updated core to 8.6.1 without issues.
Comment #8
catchAgreed with catching the exception here, we should watchdog_exception() so that it's not completely eaten.
Comment #9
zepner commentedThank you for #2, almost never seem to do it in D8
Comment #10
dsp1 commentedgot caught by this issue too. I usually flush cache right after moving the new version in. then run update, but since WSOD, didn't run update thinking it wouldn't work. after reading this tried it and update to run and get past the bug. thanks to comment above!
Comment #11
allema_s commentedFor me, drush updb solved the issue.
update.php didn't worked, i had the same issue.
Comment #12
duaelfrI faced this issue while trying to upgrade Core from 8.5.x and Facets at the same time.
facets_update_8006just tries to load some Block entities to add them a simple setting. It triggers the error and make the upgrade fail.The main reason is that the "reusable" field is added in a post_update and that hook_update_N cannont depend on post_updates.
Surprisingly, running the updb twice bypass the issue but it's not really comforting me.
Comment #13
catch@DuaelFr the reusable field is added in block_content_update_8600() - so it should be OK for facets to add an update dependency on that.
Comment #14
duaelfr@catch Thanks for the pointer! I created the issue on the Facets queue.
Comment #15
gangwarsurya commentedComment #16
longwaveNo patch to review; seems like this might be an interaction with contrib for some users at least.
Comment #17
bburgI am also running into this. Upgrading from 8.5.3 to 8.6.2 (critical security update). It happens when I try to run database updates. These were run as a part of an Acquia cloud update hook script.
Sure enough, it seems that "reusable" column is missing.
Re-running the updates manually via drush seems to get past it. I suppose that works but not ideal.
(side note, edits to issue summary were an accident).
Comment #18
bburgWhat's more, it doesn't seem to happen locally. Only on the Acquia dev site.
Comment #19
bburgI'll try to get a more verbose build output, but it seems to be that some update hook is triggering a cache clear, and the contrib recreate_block_content module calls
in it's hook_rebuild, which eventually triggers a bad SQL query as block_content's 8600 update hasn't run by that point to add the "reusable" column.
Comment #20
benpc commentedHey everyone,
I had the same issue, I resolved this with the following commands:
You may have to run drush entity-update a couple of times as it failed to update correctly for me the first time.
Comment #21
robpowellThanks to #20, I was able to get unblocked. I thought for a while now that drush updb ran drush entup as well. ¯\_(ツ)_/¯
drush entup #1
drush entup #2
drush entup #3
drush entup #4
drush updb #1
Comment #22
balintbrewsWe stumbled into the same issue, but
drush updband/ordrush entupwere not helpful in our case, so we ended up re-runningblock_content_update_8600()manually:drush php-eval "require './core/modules/block_content/block_content.install'; block_content_update_8600()"Comment #23
collinhaines commentedHad the same issue as #22, executed the
drush php-evalcommand and WSOD disappeared.Comment #24
catchThis is a bug with that update function - caches are cleared at the end up of the update process, and modules shouldn't do it themselves - specifically to avoid issues like this one. So worth opening a bug report against the module doing it if you track it down.
Comment #25
catchSo far every issue that's been tracked down here has turned out to be a bug in a contrib or custom update, I don't think we have any issues with the core update itself.
However this issue has useful debugging/recovery information for people running into the missing column, so I'm going to change the category to 'support request'.
Comment #26
shobhit_juyal commented#22 also worked for me, thanks.
Regards
Shobhit Juyal
Comment #27
alisonHi! Any chance y'all with the issue are using the Domain module? I just wondered if maybe it could be related to "Some users of domain module reported being unable to place blocks. Updating to the latest domain module fixed it" (under "Known issues" in the 8.6.0 release notes).
Comment #28
alisonNnnnope never mind #27, it was something completely unrelated -- a "colon" in the human-readable name of our custom install profile became a point of contention when we upgraded from 8.5.x to 8.6.x (b/c yml).
Comment #29
shobhit_juyal commentedHi @alisonjo2786,
In my case the Domain module was not there. I think it should not have any impact on this post.
Thanks
Comment #30
shailu29 commented#20 worked for me
thank you @bencp
Comment #31
sasanikolic commentedConfirming that after
drush updbit worked for me too.Comment #32
amutylo commentedconfirm #20 helped me too
Comment #33
karimbou commentedHello for the same issue upgrading from 8.5.4 to 8.6.7
Thanks to #20 and #21 Re-launching many times drush updb twice and drush entup 3 times also helped me on our environments.
Comment #34
gurunathan commentedAny solution to solve it without using Drush?
Comment #35
alison@gurunathan I thiiiiink running /update.php should work...? You can check "Status report" after doing that -- if you have outstanding entity schema updates, it'll say so on "Status report." HTH!
Comment #36
penyaskitoI think this is a bug in core somehow for sure.
I stumbled here after some of my post-update tests failed with 8.7.x, with a dump I did with 8.5.x. Link: https://www.drupal.org/pift-ci-job/1313097
The stacktrace is:
My dump include only the standard profile + Lingotek module + some node entities + own Lingotek entities for testing, so nothing special. Lingotek itself has no dependencies aside of Drupal core modules.
I reviewed all my hook_update_N and there is no cache clears (and in any case, those won't be applied, only 2 post-update functions are not in the dump itself).
Comment #37
robert_t_taylor commentedThought I'd mention this for anyone having intractable issues with this.
I had issues with trying to run the query manually:
drush sqlq "update block_content_field_data set reusable = 1 WHERE reusable IS NULL;"and realized that this was failing because I forgot that I had used a database prefix!Anyway,
drush sqlq "update myprefix_block_content_field_data set reusable = 1 WHERE reusable IS NULL;"did finally work.Comment #42
vrancjeI don't think this issue is relevant anymore.
Perhaps this can be set to "Closed (outdated)".
Anyone care to chime in?
Comment #43
longwaveAgreed, closing as outdated; 8.5 and 8.6 have not been supported for a number of years.