When a site runs in maintenance mode, authcash can not find the memcache backend.
This can be tricky when a site is deployed an a live server and it is first tested.

Is this a bug or is there mandatory part of drupal disabled in maintenance mode and do we need to add this to the readme file?

Comments

znerol’s picture

Thanks for the report. I tried to reproduce the issue on a fresh install using the memcache setup documented in the Authcache 2 tuning guide - avoid the database. That seems to work without any issues in maintenance mode though.

Could you please provide more information on your setup? What is in your settings.php? Which memcache module and which PECL extension are you using?

In addition please provide the exact error message with filename and line-number, that would help narrowing down the set of possible causes.

mvdve’s picture

First: amazing module! really well designed.

I tested this issue on two systems:
- Ubuntu 14.04 with a lamp stack with php 5.5 and the memcache 3.0.8 extension from the ubuntu pecl repository.
- CentOS 6.6 with lamp stack with php 5.5 within a directadmin install. Here is also the memcache 3.0.8 extension installed.

The site also uses domain access. So the settings.php file config lookes like:

/**
 * Memcache settings.
 */
$conf['memcache_key_prefix'] = 'shop';
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_bootstrap'] = 'MemCacheDrupal';
$conf['cache_class_cache_authcache_key'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';

/**
 * AUTHcache settings.
 */
$conf['page_compression'] = 1;
$conf['page_cache_maximum_age'] = 600;
$conf['authcache_builtin_cache_without_database'] = TRUE;
$conf['cache_backends'][] = 'sites/all/modules/contrib/authcache/authcache.cache.inc';
$conf['cache_backends'][] = 'sites/all/modules/contrib/authcache/modules/authcache_builtin/authcache_builtin.cache.inc';

/**
 * Add the domain module setup routine.
 */
include DRUPAL_ROOT . '/sites/all/modules/domain_access/domain/settings.inc';

There is no error message withing Drupal or PHP. The authcache debug module gives the following information:

Cache Status: "Page EXCLUDED"
Message 1: "Excluded: No active cache backend."
Message 2: "Precluded: Pending messages"
Page Render Time: "853.52 ms"
Page Age: "3 seconds"
SettingsCache Class: "MemCacheDrupal"
Cache CID: "5c1b769/en/home"
Debug Users: [""]
Cache User: "1"
Cache Backends: "authcache_builtin"
Active Backend: null
znerol’s picture

Oh, so the debug module flags the a page request as not being cachable when maintenance mode is enabled and an admin user is logged in? If that's the case, then the explanation is simple: Drupal shows a message on every page to admins when in maintenance mode (reads something like Operating in maintenance mode. Go online.). Because messages are user-specific (they are stored in the session), Authcache will refuse to store a page with a message on it. Also if there are messages pending in the session, it will not attempt to load a page from the cache.

Admittedly the messages reported by the debug widget are quite confusing and do not really pinpoint the real cause.

mvdve’s picture

Status: Active » Closed (works as designed)

That's a clear explanation. I did some further testing and as long as a user has maintenance mode access (independent of the role) the drupal message is set which results in the message Excluded: No active cache backend.

pribeh’s picture

Sorry, I don't understand how this issue is resolved. I get the "excluded" message whenever the site is in maintenance. Is there a way around this? Thanks!

znerol’s picture

@pribeh, do you get the excluded message for administrative users or for anonymous users?

pribeh’s picture

@znreol, user 1. Note, I do have caching for user 1 turned on.

znerol’s picture

If you are browsing your site as an administrator in maintenance mode, then Drupal displays a message on each page reading something like Operating in maintenance mode. Go online.

Authcache will never ever cache a page if a message is displayed or if one is pending, because messages are user specific.

pribeh’s picture

@znreol. Got it! Thanks.