From #1872522-84: Compiled data in PHP storage is cleared too late in drupal_flush_all_caches():
I'm also not sure about core/rebuild.php and core/scripts/rebuild_token_calculator.sh. We've got existing issues to add something like that (although those were originally due to the D7 registry) and I'm sure there's discussion on those that isn't reflected here. For example why a cli token generator and not a flag in $settings similar to update_free_access? The latter would allow people with no cli access to rebuild for example, whereas this makes things command line only - but if it's command line only then why not directly rebuild in the shell script anyway?
I have separated out the rebuild files to here but I will not have the time to work on the feedback above.
Comment | File | Size | Author |
---|---|---|---|
#23 | 2097189-22.patch | 5.66 KB | sun |
#22 | interdiff-2097189-22.txt | 2.87 KB | damiankloip |
#22 | 2097189-22.patch | 6.29 KB | damiankloip |
#20 | interdiff.txt | 2.67 KB | sun |
#20 | drupal8.rebuild.20.patch | 5.96 KB | sun |
Comments
Comment #1
Albert Volkman CreditAttribution: Albert Volkman commentedHaven't addressed above issues, but updated the patch to replace drupal_hmac_base64() with Crypt::hmacBase64().
Comment #2
damiankloip CreditAttribution: damiankloip commentedHow about something like this?
Comment #3
damiankloip CreditAttribution: damiankloip commentedSorry, forgot to add the .htaccess change to the actual patch.
Comment #4
catchI think we should add this but we needed the same thing for Drupal 7 and survived OK with drush rr in the end, so don't think it counts as critical.
Comment #6
damiankloip CreditAttribution: damiankloip commented3: 2097189-3.patch queued for re-testing.
Comment #8
damiankloip CreditAttribution: damiankloip commentedJust settings as needs review, for...reviews. The bot is being funny atm, and we have no tests for this anyway.
Comment #9
jibranPatch seems fine to me but I think we should add a rebuild link here
Comment #10
olli CreditAttribution: olli commentedIs it possible to write a test for this script?
Should we add a few lines to settings.php about this new setting and maybe a warning on status page if it is enabled?
Is the purpose of this line to disable page cache? If so, should we use drupal_page_is_cacheable(FALSE)?
Why not drupal_is_cli()?
Comment #11
damiankloip CreditAttribution: damiankloip commentedThanks both for the reviews.
#9, I am not against adding text to the exception message, I would personally prefer to just update the content on http://drupal.org/documentation/rebuild with these instructions, as having these on this page, or even a link to rebuild.php here would be strange IMO.
#10, good point, The last patch was a bit rough :) (I just fixed up the initial patch). Added the setting to default.settings.php with some docs, added a check to system_requirements, and others.
Comment #12
chx CreditAttribution: chx commentedWhy don't we check the setting? If access is allowed, present the link to rebuild.php (but don't skip the docs) otherwise only link the docs. We can check the setting even if Drupal is in a really sorry state, it's really really standalone.
Comment #13
jibranI think #12 makes sense form DX pov.
Comment #14
damiankloip CreditAttribution: damiankloip commentedYes, that seems like a good compromise. Doing that...
Comment #15
damiankloip CreditAttribution: damiankloip commentedSorry about the delay, this one went off the radar. How about something like this?
Comment #16
damiankloip CreditAttribution: damiankloip commentedok, let's try that again (Thanks chx!). chx also suggested just making them links, makes sense to me. Interdiff showing new changes.
Comment #17
chx CreditAttribution: chx commentedI like the token script because you might have a dev version of the site and so you are able to generate the token locally -- shell access on production is never guaranteed.
Comment #18
webchickHow can I trigger this condition in order to test that the script works?
Comment #19
sunCould we move the main functionality of the rebuild.php script into a drupal_rebuild() function in bootstrap.inc, so that e.g. Drush can re-use the facility without having to duplicate it?
Comment #20
sunHere's what I mean -- no functional changes.
Comment #21
damiankloip CreditAttribution: damiankloip commentedI'm not sure why a function like that should live in bootstrap.inc?
Comment #22
damiankloip CreditAttribution: damiankloip commentedOk, as there has been radio silence, how about we compromise here and add this to utility.inc instead? It is a utility function, and it's not in bootstrap then.
Comment #23
sunWorks for me. As long as there is a helper function that can be invoked through other mechanisms, I'm happy.
Same patch as the previous, but sans the extraneous use statements in bootstrap.inc that are obsolete now.
Comment #25
damiankloip CreditAttribution: damiankloip commented23: 2097189-22.patch queued for re-testing.
Comment #26
jibranBack to RTBC then.
Comment #27
damiankloip CreditAttribution: damiankloip commentedYep, +1 on #23 removing the use statements I forgot to remove. An interdiff would have been nice though... :)
Comment #28
catchCommitted/pushed to 8.x, thanks! Could use a change notice for the new feature.
Comment #29
damiankloip CreditAttribution: damiankloip commentedAdded https://drupal.org/node/2153725
Comment #30
damiankloip CreditAttribution: damiankloip commentedOh, and realised we need #2153741: Add executable permission to rebuild_token_calculator.sh script
Comment #31
star-szrThanks! I revised the change notice a bit to clarify there are two methods of running the rebuild script.
We can remove the
php
from the instructions for running the script once #2153741: Add executable permission to rebuild_token_calculator.sh script is taken care of.Comment #32
jibranGreat work. Thanks everyone.
Comment #33
jhodgdonThis needs a follow-up so that when Drupal doesn't bootstrap, it points you to this rebuild script instead of that stupid link in index.php to drupal.org (which will really not help if you're for instance on an airplain).
This doesn't help if you didn't already have the rebuild access set to TRUE. It should tell you to set it to TRUE, like it does if you try to run update.php.
And I also noticed if I tried to run the rebuild script without it being set to TRUE it failed with no explanation, if the site was hosed in the first place -- I just got back to the unhelpful index.php message.
So I don't think this is really finished. I'd like to reopen but a follow-up would be OK too.
Comment #34
jhodgdonThe change notice is also not showing up on
https://drupal.org/list-changes/drupal/
Why is that????? Oh, the Project wasn't set. I think it needs to be a required field. I'll file a separate issue.
Comment #35
damiankloip CreditAttribution: damiankloip commented#34, The purpose of this issue is finished: "Add a rebuild script" - added.
Feel free to open a followup and propose whatever changes there. I've said before, we seriously need to stop repurposing issues.
What else do you propose happens here? If your site is not functional, there is not much we can do here. That exception message is IT. We intentionally just redirect this script back to the site. Adding to the exception message is certainly an option.
Also, update.php has a full page with markup (basically). So might not be quite the same, as update is using drupal to render that. Some of which may not be possible if the dumped container is borked.
Comment #36
jhodgdonYes, I know I know but the patch that was committed had bugs in it... Anyway, I opened a separate issue:
#2156287: Followup to new rebuild script - index.php messaging is incorrect/incomplete
as requested.
Comment #37
damiankloip CreditAttribution: damiankloip commentedNot sure how that's a bug, but ok. most of what you're talking about I'd based on opinion.
Also, we just added to the message. We didn't add the d.o link.
Comment #38
moshe weitzman CreditAttribution: moshe weitzman commentedFollow-up - Might be worth adding a settings.php array of PHPStorage bins that should be cleared. That way a site could clear more than twig and service_container. The script currently privileges those systems.
Comment #39
damiankloip CreditAttribution: damiankloip commentedPossibly, Not sure most implementations using any php storage will be able to cripple a site like an out of date service container though?
Comment #40
sunThe rebuild script failed to rebuild for me today and ended in a fatal error instead; follow-up issue:
#2159459: Rebuild script triggers errors in error handler, fails to rebuild container
Comment #42
YesCT CreditAttribution: YesCT commentedhttps://drupal.org/documentation/rebuild needs to be updated
Comment #43
catchI think we could backport this to Drupal 7.
drush rr is fine, but not everyone has that.
Comment #44
DamienMcKennaRelated, the Drush maintainers have said "no" to adding the Registry Rebuild functionality into the main Drush system: https://github.com/drush-ops/drush/issues/1744