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.

CommentFileSizeAuthor
#4 handle-request-error-2056915-4.patch740 bytesjlindsey15
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Here's what's /actually/ happening:

Oops, sh*t is f*cked. Your site is now totally unresponsive.
To have any prayer of un-f*cking your sh*t, see if
http://drupal.org/documentation/rebuild does anything for you.

...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.

alexpott’s picture

This 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.

jhodgdon’s picture

I 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?

jlindsey15’s picture

Assigned: Unassigned » jlindsey15
Status: Active » Needs review
FileSize
740 bytes

It 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...

jhodgdon’s picture

Status: Needs review » Needs work

"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.

jhodgdon’s picture

Issue summary: View changes

drupal_http_request ressurected :p

ifrik’s picture

Issue summary: View changes

Should this be taken up before we are at RC1?

If so, then it should be tagged with Barcelona2015.

mgifford’s picture

Assigned: jlindsey15 » Unassigned

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.