If I enable this module, web services stop working and all operations return anonymous user error (put, post, delete), altought I'm logged in and I get CRFS token. If I disable this module, all works good again and I can log in and do all CRUD operations. I have checked it with three differents webs (Drupal 7.64 and 7.65).
I only need to enable the module and change settings.php ($conf['cache_backends'][] ...) and I get the problem with webservices (even without check any role). I have checked Authcache and It's working good when I enable the module and config roles, and I get cache hits (if I enable authcache debug), and then, I think it's not a problem with authcache configuration. Some suggestion?

Comments

briantes created an issue. See original summary.

znerol’s picture

Category: Bug report » Support request

Thanks for the report. Could you please give more details about your webservices? Are you using a contrib module for that? If yes which one (URL). Also could you post request/response headers returned by those webservices for successful and for failed attempts? If those webservices are called from a browser, you can capture them with your browsers developer tools.

briantes’s picture

I'm using Services and Redis, and they are e-commerce sites (drupal 7 commerce kickstart). I use webservices to sync up my ERP with the shop. I have only one endpoint with a path (I tried to solve it adding this path to the exclude configuration field, but It didn't work) and I do "put", "post", ... to commerce products, nodes, etc. It has always run good, until I've decided to use Authcache in order to speep up the webs.
With authcache enabled and using web services I can log in and GET without problems. I've verified that I logged in because I get nodes and content that it's only visible for that user. But If I try to PUT or POST, I always get HTTP/1.1 401 Unauthorized : Access to this operation not granted.
If I disable Authcache module and erase its configuration in settings.php, everything runs good again with the same commands, and I do PUT and POST without problems.
This is my settings.php file (only the latest lines):

// Redis configuration
$conf['redis_client_interface'] = 'PhpRedis'; // Can be "Predis".
$conf['redis_client_host']      = '127.0.0.1';  // Your Redis instance hostname.
$conf['lock_inc']               = 'sites/all/modules/redis/redis.lock.inc';
$conf['path_inc']               = 'sites/all/modules/redis/redis.path.inc';
$conf['cache_backends'][]       = 'sites/all/modules/redis/redis.autoload.inc';
$conf['cache_default_class']    = 'Redis_CacheCompressed';
$conf['cache_compression_size_threshold'] = 100;
$conf['cache_compression_ratio'] = 5;

/**
 * Use Redis for the page cache and authcache keys.
 */
$conf['cache_class_cache_page'] = 'Redis_Cache';
$conf['cache_class_cache_authcache_key'] = 'Redis_Cache';

// Minimum cache lifetime setting. Not setting $conf['cache_lifetime'] (or some
// custom redis TTL config value) makes Redis set default TTL length which is
// 365 days which makes Redis storage full of keys, with huge expiration
// values. Therefore it shouldn't be left unset.
$conf['cache_lifetime'] = 10800;

/**
 * When serving cached pages, do not bother connecting to the database.
 */
$conf['authcache_builtin_cache_without_database'] = TRUE;

/**
 * All customized settings influencing page delivery need to be set here.
 */

// Deliver gzip compressed pages if possible
$conf['page_compression'] = 1;

// Allow browsers to store the page for up to 10 minutes
$conf['page_cache_maximum_age'] = 600;

/**
 * Required configuration for Authcache Builtin Storage Backend.
 */
$conf['cache_backends'][] = 'sites/all/modules/authcache/authcache.cache.inc';
$conf['cache_backends'][] = 'sites/all/modules/authcache/modules/authcache_builtin/authcache_builtin.cache.inc';

I think It could be solved at all if I had a way to disable authcache for webservices. Is there anyway I could do it?
Anyway, If you think you need more information, please ask me. Thanks for your help.

briantes’s picture

I've done more tests. It seems that after log in and the first GET all is good. But after this, the next commands are all with anonymous user, altough I haven't log out. I have enabled "debug mode" (an option in services module) and I can see it in drupal log.

znerol’s picture

Status: Active » Closed (cannot reproduce)