simplesamlphp-module-drupalauth icon indicating copy to clipboard operation
simplesamlphp-module-drupalauth copied to clipboard

Drupal's bootstrap overrides SimpleSamlPHP's exception handler

Open manarth opened this issue 8 years ago • 0 comments

When drupal_bootstrap() is invoked, Drupal's exception handler (_drupal_exception_handler()) replaces SimpleSamlPHP's exception handler (SimpleSAML_exception_handler()).

  • When an invalid SSO request is received, SimpleSamlPHP throws an Exception.
  • This is caught by Drupal's Exception handler, which attempts to generate a Drupal error page.
  • The error page invokes Drupal's theme layer.
  • If aggregate-css or aggregate-js is turned on, Drupal attempts to build the CSS/JS caches.
  • The cache-generation attempts to call file_get_contents() on the relevant CSS/JS files.
  • The file_get_contents() calls fail, because the current working directory is the SimpleSamlPHP service, not the Drupal docroot.
  • This triggers multiple watchdog() calls to record the error.

The effect is multiple watchdog entries with messages such as

Warning: file_get_contents(misc/jquery.once.js): failed to open stream: No such file or directory in drupal_build_js_cache() (line 5049 of /var/www/includes/common.inc).

manarth avatar Jul 26 '16 10:07 manarth