Problem/Motivation
I suddenly got this weird error after adding a new text field to a taxonomy. I thought it had something to do with cache, but clearing cache didn't help. I also deleted the field I had created, thinking that might be the cause, but the error is still there.
Something's getting mixed up with the Update module I guess. I have been working with this site for a while now and haven't seen this error before.
Tried Google but couldn't find anything helpful, so what might be the cause and the solution for this?
Here's what I got:
Notice: Undefined index: title in Drupal\update\ProjectSecurityRequirement::createFromProjectDataAndSecurityCoverageInfo() (line 103 of core/modules/update/src/ProjectSecurityRequirement.php).
Drupal\update\ProjectSecurityRequirement::createFromProjectDataAndSecurityCoverageInfo(Array, Array) (Line: 43)
update_requirements('runtime') (Line: 186)
update_page_top(Array) (Line: 336)
Drupal\Core\Render\MainContent\HtmlRenderer->buildPageTopAndBottom(Array) (Line: 135)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 694)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)Proposed resolution
When fetching update data always clear the update_project_data from state as it has another cache of the available updates that needs refreshing with the new data.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
N/a
| Comment | File | Size | Author |
|---|---|---|---|
| #65 | Bad file path.PNG | 9.85 KB | guypaddock |
| #52 | 3132426-52.patch | 4.02 KB | alexpott |
| #52 | 41-52-interdiff.txt | 1.92 KB | alexpott |
| #41 | 3132426-41.patch | 3.14 KB | dww |
| #35 | 3132426-35.patch | 3.1 KB | alexpott |
Comments
Comment #1
Anonymous (not verified) commentedTuuuukka created an issue. See original summary.
Comment #2
jorisInsign commentedSame her, and I was also playing with taxonomy on my side.
I'm on a drupal 8.8.5, on a recent project.
Comment #3
jorisInsign commentedUpdate : The problem disappeared after "manually checking for available updates." (link here : /admin/reports/updates )
Must have been a temporary data recovery issue.
Comment #4
cilefen commentedComment #5
ericdsd commentedHi
i had the the exact same issue, that just spawned,
it disappeared by itself after visiting admin/reports/updates
Comment #6
extect commentedSame here. Solution/workaround in #5 works.
Comment #7
cilefen commentedComment #8
anybodySame problem here with
I further debugged this and added the following debug output:
in line 106 of \web\core\modules\update\src\ProjectSecurityRequirement.php
$project_data is the following
So there is no "title" key for Drupal core which leads to the notice.
MIGHT be related to #3118087: If any extension has a missing or invalid version, Update manager throws errors and is confused about site update status
Comment #9
chegor commentedI did not see this error before, but now after new version 8.8.6 is available, I also see it.
#5 works.
Comment #10
the_glitch commentedI had the same error until I checked for updates manually as suggested by jorisInsign in comment #3
Comment #11
anybodyThanks @the_glitch, that might be a good hint to find the reasons for the issue in code. Anyway the user shouldn't be forced to to that to solve the issue. Code should prevent this from happening.
Comment #12
the_glitch commentedWell most users aren't really forced to do that because most users probably don't even know that doing that is a solution at all. And yes it's bad UX even if everybody does know what to do.
Comment #13
brooke_heaton commentedThis is now happening to me. Drupal core 8.8.6.
Comment #14
brulain commented+1 D8.8.5
Comment #15
lou_lv commentedPresent on 8.8.5 too
Comment #16
dww@Anybody Re: #8: Thanks for the debugging info, very helpful! However, this is extremely weird and concerning:
In the code, that corresponds to:
🤔That makes no sense. 😉 Even if you're on 8.8.5 and 8.8.6 is now available, 8.8.5 shouldn't be getting marked as "Revoked". That should only happen if either Drupal core itself is unpublished, or the 8.8.5 release is unpublished. https://updates.drupal.org/release-history/drupal/current shows that we have 0 core releases that have been unpublished. So I have no idea how your site got into that state. If you grep for 'REVOKED' you'll see it's only used to set the status in 2 places.
I've tried recreating this locally with my net connection off, clearing caches,
drush ev "\Drupal::keyValueExpirable('update_available_releases')->deleteAll();", etc. I only get the warnings that the site failed to fetch available update data, I never get this weird partial state where there's incomplete data, missing values, etc.I wish someone (anyone) could come up with reliable steps to trigger / reproduce this. Without that, I really have no idea how to safely solve this.
Meanwhile, we can obviously do something trivial to silence the warning, but that's almost certainly going to be masking a deeper bug that we should really understand before this issue is fixed. Or we fix the obvious thing now and open a follow-up to try to understand the deeper problem. Not up to me to decide.
Anyway, digging deeper:
protected $projectTitlemember. At all. :( So, we're generating these warnings and causing all the traffic in this issue to correctly set information we completely ignore.$data['title']is empty for core so we can set a variable we never use.- - -
So, here are 2 possible patches to "solve" this problem:
A) Stop pretending that the label 'Drupal core' will ever change and that we should be relying on the release history XML feed to get the right value. If we only instantiate this object for core, let's just hard-code the value we know we want.
or
B) Completely purge
self::projectTitlefrom this class, since it's all dead code, anyway. Thanks to #3116198: Make ProjectCoreCompatibility class final and internal the class is marked @internal, so I believe we can freely ignore any BC implications of changing the signature on the constructor, etc.No idea if either of these would fly with the core committers. ;) But at least we can get started on a solution to this bug that's clearly impacting live sites.
Comment #17
afagiolisame issus started on my D8.8.5 after editing a view.
#5 fixed
So weird, but so good so far
Comment #18
dww@all: If you hit this warning, before visiting admin/reports/updates can you try the patch in #16 to confirm it works for you and comment here with the results?
Thanks!
-Derek
Comment #19
harcher commented@dww
I applied this patch. I did not visit admin/reports/updates.
Patch applied:
3132426-16B-remove-dead-code.patch
... and the problem seems to have resolved. I have been working on and navigating through the site for a couple of hrs with no issues. Thanks
Note that I could not run both patches listed. Please remove one of them. I used the 16B patch.
This problem occurred while I was working with taxonomy terms and the group module.
Comment #20
dww@hga77 re: #19: Thanks for testing! Glad to know #16B solved your troubles.
Re:
Right. They are 2 separate approaches to solving this bug. They can't both be applied. But I'm not going to "remove" one until a core committer specifies their preference on which path to continue down.
Thanks again!
-Derek
Comment #21
jcmartinez#16B removed the notice for me.
Comment #22
the_glitch commentedPatches #16A and 16B applied and tested. Works well so far. Thanks @dww
Comment #23
chrisfromredfinPatch #16A also works for me. Both have been tested by a few people, so a core committer should decide on approach.
Comment #24
Van'Denis commentedDrupal 8.9.0
Screen: https://prnt.sc/suyyew
Not sure, but it seems to me that #5 helped me.
P.S. I not use any patch from this issue.
Comment #25
nikitas commentedI had the same issue after reading the comments and visiting admin/reports/updates it disappeared.
Comment #27
johanf commentedvisiting admin/reports/updates doesn't fix the problem, after some times the message is back
i did apply the patch 16A on drupal 8.9.0 and the message disappeared
Comment #28
jungleAbout this strange
REVOKEDstatus, I would suggest digging it in a separate issue. This is a real bug, so hoping that it gets committed ASAP personally.From the feedback in #17, #19, #21-#25, and #27, the two patches in #16 are both valid, so I do not have to do a manual test again.
I prefer the patch
3132426-16A-hardcode-core-title.patchwhich got no chance to have BC issues compared with3132426-16B-remove-dead-code.patcheven which is@internaland should not have any BC issues too.RTCT-ing to have opinions from committer(s). Tagging "Bug Smash Initiative", pend tagging "Needs followup".
Comment #29
alexpottI think given the class is both final and the constructor is private doing remove dead code patch is fine. But what still gives me pause is that we don't understand why this array key is not set. Given this is about the data we use to upgrade sites understanding that feels important and not something we should solve without taking stock.
Moving back to needs review to take and installing 8.8.5 myself to see what happens for me.
Comment #30
alexpottIt's a real shame that #8 doesn't contain the contents of
'reason' => Drupal\Core\StringTranslation\TranslatableMarkup(5)as that would have given us a bit more to go on.The status is -2 not 2 so the actual status is
const UPDATE_UNKNOWN = -2;.Okay I can reproduce the fail... it's kinda fun.
drush ev "\Drupal::keyValueExpirable('update_available_releases')->deleteAll();"- this ensures we'll get the available updates again.drush cronSo why does this happen - well the available updates state and the
\Drupal::service('update.manager')->projectStorage('update_project_data');get out of sync.So the fix is to do \Drupal::keyValueExpirable('update')->delete('update_project_data') - when we fetch fresh update data.
Comment #31
alexpottPatch attached fixes the issue. Maybe @dww knows the test coverage well enough to know if this is testable?
Note there is a workaround to clear the error - if you visit admin/reports/status it'll rebuild the cache and everything will work as expected. Or you can run
drush ev "\Drupal::keyValueExpirable('update')->delete('update_project_data');"from the command line.Comment #32
mohamed.osama commented#5
Fixed for me, just visited admin/reports/updates fixed the issue
Comment #33
alexpott@Mohamed.Osama yep this is expected - see #31 explains why.
Comment #34
steinmb commentedMigrated content type from D7 to D9.0.1 and ended up with the same notice.
drush ev "\Drupal::keyValueExpirable('update')->delete('update_project_data');"Made it go away.
New migration project in its early stages but I should be able to re-produce this.
Comment #35
alexpottHere's test coverage. The test coverage is the interdiff.
Comment #36
alexpottComment #39
alexpottrandom unrelated test fail.
Comment #40
dwwThanks for getting to the bottom of this, and providing test coverage! 🙏 Huzzah. 🎉
I agree with the analysis in #30 and the fix to clear the stored projects after any successful fetch task makes sense. If we had the info split up and cached per project, we should only need to clear the info for 1 project. But that's not how it works. 😉
Only a few tiny doc nits in the test:
a) s/xml/XML/
b) s/simulates/simulate/
needs 'is' btwn state and used.
s/will/should/ ? ;)
Comment #41
dwwSince it's only doc cleanups, I'll post them myself, and I think I'd still be okay to RTBC...
Comment #42
alexpottA couple of thoughts...
Is this really the correct place to do this? Because it's an UpdateProcessor - so it's theoretically changeable. No contrib does this mind you - http://grep.xnddx.ru/search?text=UpdateProcessorInterface&filename= - the whole architecture of the Update module seems a bit too flexible to me. It's all these layers that make it hard to reason about and maintain.
Anyhow there isn't really other place to do this because this needs to happen when the queue item is processed and other kind of global stuff that other implementations would have to do are done here - for example:
So I guess this is okay.
Comment #43
norman.lolGod bless #34. A simple Drush command.
Comment #44
dwwRe: #42 -- yeah, I agree it's too flexible.
<aside class="ranting history">It was originally written without OO. As the "Update Manager" aspects (not just "Update Status", but the whole installing / updating functionality) was moving into core, it was the earliest days of core's acceptance of OO, and @JacobSingh was really excited about OO-ifying things. We didn't know much then about how everything was really going to pan out, we were victims of non-YAGNI thinking, and we made some bad decisions. Then I peaced out for a few years (to get my first album out, among other things) and Update Manager floundered along with D8 porting and conversions without any clear maintainer or direction. Everyone just did whatever they thought was best at the time without a real big picture plan.
All sorts of other subsystems changed out from under it, things got more and more complex and flexible, and we never stopped to take a close look at the architecture and what we wanted.
Now that the auto updates initiative is a thing, plus the Composer-ification of the DrupalVerse, it seems like it'd be a waste of time to pour too much effort into refactoring and reorganizing all this. I argued many months ago that instead of investing huge effort into supporting contrib semver and compatibility with multiple branches of core that we should just kill it and cut our losses, but folks pushed back that we still need this module, even with composer and friends.
So, yes, it's too flexible, the architecture doesn't fully make sense, some things are pluggable that shouldn't be, some things that should be pluggable are not, etc.
</aside>Anyway, as you point out, there's no other real place to make this fix. I believe this is the best we can do given the circumstances.
I'm going to RTBC #41, even though I posted it, since 98% of the patch is @alexpott's work, and all I did was some trivial doc cleanups.
Thanks,
-Derek
Comment #45
dwwAlthough, giving this a final once-over:
Not totally sure we need this, since
UpdateCoreTest::setUp()does this:Seems bizarro that the main
$admin_userfor this whole class doesn't already have 'access administration pages' ;) Maybe we should just add that perm to thesetUp()user and then this particular test method doesn't have to worry about creating another user and re-logging-in? Or maybe we don't need it at all?Comment #46
norman.lolGiven that the workaround mentioned in #31 and #34 fixed it, shouldn't there be an hook_update_N that does that and we're out?
Comment #47
dww@leymannx: Sadly, no. That's a 1-time fix to temporarily fix the symptoms. Doing that in
hook_update_N()wouldn't help at all. The patch here actually fixes the underlying problem, so 1-time workarounds aren't needed. Instead of manually doing that clearing via drush, or only once when you run update.php, we need to do it each time we get new data. That's what the patch here is for.Cheers,
-Derek
Comment #48
norman.lolAh yeah, I see. Thanks for clarifying! 💙
Comment #49
catchDo we really need to do this for every project, or could we do this in the caller of this function so that it happens once?
Comment #50
alexpottThe caller is the queue system
Comment #51
catchIsn't it in UpdateProcess::fetchData() and UpdateManager::fetchDataBatch()?
Comment #52
alexpottOops sorry @catch I posted from my phone and used my fallible memory.
Looking at the two suggested places - \Drupal\update\UpdateManager::fetchDataBatch - before that is called in \Drupal\update\Controller\UpdateController::updateStatusManually() we call \Drupal\update\UpdateManager::refreshUpdateData() so that does not need this. But I've improved the docs to say that calling fewtchDataBatch without doing that is not recommended. There's more than just this reason for that - you need to call it to create the tasks.
So that leaves \Drupal\update\UpdateProcessor::fetchData() - add indeed we can optimise there and also the test passes so yay. Thanks @catch.
Comment #54
alexpottRandom JS fail.
Comment #55
vladimiraus* Message appear on
/admin/reports/dblog/confirmpage.* Applied patch (Drupal 9.0.2) and the message was still there after clearning the caches until I removed patch and then reapllied it.
Error
Comment #56
alexpott@VladimirAus - the patch does not fix the error if you currently are experiencing it on your site. It will stop it from happening. In order to fix the message you can visit admin/reports/status which will rebuild the erroneous state entry. For what it is worth - the longest you'll experience the error is 1 hour because after that the state will become invalid.
Comment #57
vladimirausThanks @alexpott
Comment #58
bobburns commentedSame issue on 8.9.2 after running /upgrade - for the fourth time after some patches to fix problems with Commerce Migrate. First three runs it did not appear. Added product on old site to test if it would import text and after ignoring the error and running the upgrade - the import of the new product worked because of the patch, and then I found this and applied patch 52.
Error did not go away until running /admin/reports/update page
Seems to be gone now after the patch
Comment #59
ccjjmartin commentedI ran into this error, I tested the patch and it did not make the error go away on it's own. I will leave the error around for 1 hour and see if it disappears on its own with no patches applied.
Comment #60
dww@ccjjmartin re: #59: See #56 from @alexpott:
The patch doesn't try to clean up the situation on live sites. It's about preventing it from happening in the first place.
Sorry, still haven't (don't) have time to carefully review #52,but hopefully I can RTBC this soon.
Cheers,
-Derek
Comment #61
jhnnsbstnbch commentedFYI, I got the same error message as the OP when I added a new image style:
../admin/config/media/image-styles
Once I deleted the newly added style, the message went away.
I am using Drupal 9.0.3
Comment #62
veder commentedSolution #5 works like a charm. Thanks. :-)
Comment #63
arturopanettaSolution #5 work fine for me.
Comment #64
joris_luciusSame here, #5 worked (Drupal 9.0.3)
Comment #65
guypaddock commentedStrangely, after applying #52, I now have this random file chilling out:

I am applying the patch via Composer Patches so it seems like the path in the patch is actually wrong.
Comment #66
alexpott@GuyPaddock that looks like a bug in composer-patches to be honest. If I apply the patch in #52 to core I see
This looks related to https://github.com/cweagans/composer-patches/issues/234
Comment #67
Robbozinoz commentedJust saw this bug in 8.9.6 manually updating removed as in #5
Comment #68
akshayadhavFaced same issue while adding menu link on Drupal 9.0.6
#3 solved the issue.
i.e. just visit /admin/reports/updates page
Comment #69
giorgoskTwo identical codebases local / stage
but a bit different infrastructure
local Drupal 8.9.7, 5.5.5-10.3.22-MariaDB, nginx/1.17.10, PHP 7.3.23
stage Drupal 8.9.7, 5.5.65-MariaDB, Apache, PHP 7.3.23
local was giving no problem
but stage had the warning appear on
node/add/link(custom content type)Applying the patch from #52 clears the warning
Comment #70
alexpottDiscussed this issue with @catch we agreed that my changes in #52 are sufficient to address #51 and #49. Given that this can be rtbc.
Comment #71
dwwFinally had a chance to carefully review #52. The comment makes sense and the patch looks great. Test coverage is solid, and it's working as expected. If I run it locally in test-only mode, I get:
Summary is accurate / current.
No API or UI changes.
No CR needed.
Nothing left to do but commit. $RTBC++; 😉
Thanks!
-Derek
Comment #75
catchCommitted/pushed to 9.2.x and cherry-picked back through to 8.9.x, thanks!
Comment #77
xjmComment #79
harcher commentedHi Guys, I just got this same error on Drupal core 9.1.3. The patch does not apply.
Went to /admin/reports/updates
And the notice is gone. But I know it will be back just like the Terminator "AiL Bee Baauck"
Comment #80
norman.lolHi Terminator, instead of using "Hi guys," consider one of these several alternatives:
* Hi everyone,
* Hi folks,
* Hi all,
* Hi friends,
* Hi team,
* Hi y'all,
* Hi people,
💙
Comment #81
harcher commented@leymannx, thanks for your input. Instead of a Fedora can I suggest one of these several alternatives:
* Ascot cap
* Akubra
* Balaclava
* Balmoral bonnet
* Baseball cap
* Bearskin
* Capotain
* Cappello romano
* Chengziguan
* Deerstalker
* Homburg
* Kolpik
* Montera
* Sun hat
* Turban
* Rasta cap
* Wizard hat
* Umbrella hat
You can try a "peach basket hat". That should work too. Thanks again for your valuable input.
Comment #82
norman.lolYou are funny. And clever. So I think you got the point. Sorry @all for the noise.
Comment #83
aburrows commentedThis discussion appears to include the use of gendered language in a comment. Gendered language can be harmful to our community because it can signal that we assume that people’s participation in the community is determined by gender.
The shift to gender-neutral language promotes gender equality. Please respect the pronouns that community members provide in their profiles.
For more information, please refer to Drupal’s Values and Principles about treating each other with dignity and respect.
This comment is provided as a service (currently being tested) of the Drupal Community Health Team as part of a project to encourage all participants to engage in positive discourse. For more information, please visit https://www.drupal.org/project/drupal_cwg/issues/3129687
Comment #84
urashima82 commentedSolution #5 worked for me too. Thanks ericdsd.
Comment #85
featuriz commentedSolution #5 worked for me too. Thanks ericdsd.
I'm using Drupal 9.4.8 and PHP 8.1.6
Comment #86
rishi.kulshreshthaUsing Drupal 9.4.8 on PHP 7.4.32, surprisingly #5 still helps!
Comment #87
matthieuscarset commentedIssue reproduced on
9.5.3.Comment #88
ressaJust got this in Drupal 10.0.8 ...
Comment #89
ma74 commented#5 still works. on a 9.5.9 , php 8.0.27
best solution for a long time ;)
Comment #90
niklp commentedHappened to me today with 9.4.15 but as the crowd suggests, #5 is still working.
Comment #91
rhip commentedWorkaround in #5 just worked for me on 9.5.5.
Comment #92
kris77 commentedWorkaround in #5 just worked for me too on 9.5.9.
Comment #93
aarantes commentedWorkaround in #5 just worked for me too on 9.5.9.
Comment #94
ressaStill happening in 10.1.2.
Comment #95
anybodyJust happened to me in Drupal 10.1.5 like @ressa described. Perhaps we should reopen this?
The strange thing is, that the installation was not changed, when it appeared! No projects were updated or something like that. Definitely didn't show up yesterday.
Comment #96
ressaAnd it happened to me yesterday again. So yes, it has resurfaced, and the issue should be re-opened. Or maybe it's best to create a new issue? Sometimes rebasing old issues can be a messy situation :-)
Comment #97
taraskorpachIt has happened to me as well in Drupal 10.1.5. The Drupal
$project_dataarray does not contain 'title' key. As far as I understand it should be 'Drupal core'.Should we ask maintainers to re-open the issue and change the priority too? I think that the problem is important when the error appears on the site randomly.
Btw, the updating to d10.1.6 has fixed the issue.
Comment #98
ressaJust got this in Drupal 10.2.0 as well.
Comment #99
tawellman commentedI just got this on 10.2 and everywhere I went the same WSOD Warning popped up.
Ran command: composer update -W
It went away. Everything back to normal.
Comment #100
outcast creatures commentedMine disappeared as soon as ! ran "check for updates"
Comment #101
lionsea commentedI got same error on Drupal10.3.5.
I got this error just after adding and removing title field to the replacement pattern on views. The error still remains after deleting title field. Clearing cache does not work. But after editing Admin pages, it dissapeared.
Comment #102
nazir.sharifi commented#5 also worked for me. Drupal 9.5.10
Comment #103
yousefanbar commented#5 also worked for me. Drupal 11.2
Comment #104
apparatchik commentedJust got this in Drupal 11.2.8, #5 solved it.
Comment #105
uzairpathan commented#5 also worked for me on Drupal Version 11.4.4