Over at #1872522: Compiled data in PHP storage is cleared too late in drupal_flush_all_caches(), a try/catch was added around drupal_handle_request() in index.php, which broadly catches any exceptions that happen and spits out an error message.
Right now that message is:
If you have just changed code (for example deployed a new module or moved an existing one) read http://drupal.org/documentation/rebuild
However, this doesn't follow the standard guidelines for an error message, which should include:
- What happened and why?
- What is the end result for the user?
- What can the user do to prevent it from happening again?
It's a bit tricky, though, because there are any number of things that could've happened here. It could be because the service container didn't compile right. It could be that code has in fact changed on disk, as the error message says. Or, it could be that some other random exception way down the stack never got caught by anything and bubbles up because the catch is so promiscuous.
But in any event, we should improve the message a bit, because it's not actually telling people what's going on here, just sending them off to a page in the handbook.
Comment | File | Size | Author |
---|---|---|---|
#4 | handle-request-error-2056915-4.patch | 740 bytes | jlindsey15 |
Comments
Comment #1
webchickHere's what's /actually/ happening:
...now we just need to re-word that in a way that doesn't offend people. ;)
I also found http://msdn.microsoft.com/en-us/library/aa511267.aspx which is a really great guide on what to do / not to do as far as error message text is concerned.
Comment #2
alexpottThis also is a chance to move this try catch block since @effulgentsia mentioned that we were trying to keep index.php just to two lines to make it easy to upgrade core by just touching files in /core. The more lines there are in index.php the greater the temptation to change them :)
There is another problem with throwing an exception here. Which is that it will be caught be drupal's exception handler which cna further obscure wtf is going on. Especially if the error occurs after the page has been sent to the browser.
Comment #3
jhodgdonI am not sure about #2, but suggestion for #1:
Your site is not able to respond to any page requests, which is probably due to a change (such as installing updating a module) made recently on the site that was incorrect or not performed correctly. To debug, see http://drupal.org/documentation/rebuild
First pass... not even sure it is accurate?
Comment #4
jlindsey15 CreditAttribution: jlindsey15 commentedIt might be good just to give a little more info besides the link - something like:
Your site is not able to respond to any page requests. This could be due to a failure to rebuild the service container, a problem with installation, or a number of other possibilities. If you recently made an change in your site code (such as installing or updating a module), that is likely the reason you are seeing this message. To debug, see http://drupal.org/documentation/rebuild.
I included a patch, because, well, I felt like it...
Comment #5
jhodgdon"made an change" => made a change
Also, this has very technical language in it. I don't think we should be mentioning the "service container" without explaining what it is, and I don't think most people would know how to go about rebuilding it.
And really, the information about at least basic troubleshooting should be in a TROUBLESHOOTING.txt file in the Drupal installation in case someone does not have internet access when they get this message. That is our philosophy in other matters -- someone should be able to use Drupal on a local installation (or on an airplane) without having to refer to pages on drupal.org.
Comment #5.0
jhodgdondrupal_http_request ressurected :p
Comment #6
ifrikShould this be taken up before we are at RC1?
If so, then it should be tagged with Barcelona2015.
Comment #7
mgifford