I am using memcache version 2.2.6 and ajax comment module 6.x-1.8.

when I try to post comment following error occurred and comment not posted.
An error occurred.
/ajax_comments/js
(no information available)

When I disabled memcache its working fine.

I have also checked other functionality in our site all functionality breaks where I used form submission using ajax.

Is there any way to disable memcache for ajax calls?

Comments

michiellucas’s picture

I have the same issue, looking for a way to exclude ajax paths from memcache.

Did you succeed?

edu2004eu’s picture

Am having the same issue with AJAX login in D7 with Memcache 7.x-0.0. I've traced it down to this line (somewhere in the drupal core):

$form = form_get_cache($form_build_id, $form_state);

This is returning nothing. The code is located in:
includes/ajax.inc -- around line 315

evete’s picture

We run into similar error with memcache, the user autocomplete and the location province autocomplete stop working. When disable memcache module, everything works. The "cache_form" in our settings.php is correctly set to "database".

As edu2004eu suggested, seems the two required path, in our case, user/autocomplete and the /location/autocomplete/* are not set correctly.

We use the current 6.10 release.

edu2004eu’s picture

Here's what I did to fix this, it might help someone.

Your sites/default/settings.php should look something like this:

$conf = array(
  'cache_default_class' => 'MemCacheDrupal',
  'memcache_servers' => array('server.com:11211' => 'default'),
  'memcache_bins' => array(
    'cache_page'    => 'default',
    'cache_menu'    => 'default',
    'cache_filter'  => 'default',
    'cache_views'   => 'default',
    'cache_content' => 'default',
    'cache_form'    => 'default',
    'session'       => 'default',
    'users'         => 'default',
  ),
);

Or at least something similar. What I did, was to comment out the line saying: 'cache_form' => 'default',

So the result was:

$conf = array(
  'cache_default_class' => 'MemCacheDrupal',
  'memcache_servers' => array('server.com:11211' => 'default'),
  'memcache_bins' => array(
    'cache_page'    => 'default',
    'cache_menu'    => 'default',
    'cache_filter'  => 'default',
    'cache_views'   => 'default',
    'cache_content' => 'default',
    //'cache_form'    => 'default',
    'session'       => 'default',
    'users'         => 'default',
  ),
);

It seems that some forms were badly cached in Memcache and they couldn't be retrieved (in your cases the comment form).

robloach’s picture

The issue is that Memcache statistics are being output with the AJAX request. Disabling the statistics output should fix the AJAX requests. Bug in Memcache module, which forces output of the statistics on every request, rather than just on HTML requests.

Martin Klinkigt’s picture

Hi

may I also vote for this bug. Currently this bug stops me from using this module. maybe I can give some debug information. Basically this module seems to work also for forms of all kind including ajax.

However, I have observed that the module stops working after some time which means forms are not processed anymore. I have check the cache_form table and it contains about 700 entries. I think this normal for a small site with some active users. I suppose this is not the problem. More dramatic is the fact that drupal stops adding the form build id into the database. Without a build id nearly everything will stop working since drupal will detect it as a xss attack.

restating the webserver or the database does not solve the issue. Only after restarting the whole server the website worked again for a while. I did not check whether restarting the memcached daemon helps.

I am using latest version 7.x-1.0 from January 19.

edit:
Some more info. I am running Ubuntu 12.10 in an VPS and followed the explanation from this site: https://www.digitalocean.com/community/articles/how-to-install-and-use-m...

edit 2 (maybe solved):
I maybe found my problem. It was due to incomplete documentation here: http://drupal.org/node/1131468
I check now the README.txt more carefully and found the following:

9. Make sure the following line also exists, to ensure that the special
cache_form bin is assigned to non-volatile storage:
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache'

I would recommend to update the documentation on the page above.

Thank you for your time and I apologize for causing trouble.

best

erikwebb’s picture

Status: Active » Postponed (maintainer needs more info)

You do not need to "enable" the use the cache backend. The point made in #5 is that the module itself could use a bug fix to remove this problem, but the cache backend itself should be unaffected.

Do the problems go away with the module disabled, but the cache backend still in use?

erikwebb’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)
ajlozier’s picture

Thank you Martin. Your solution worked for us, something that had been confounding us for weeks!

gauravktomar’s picture

Thanks Dude! It really helped me!!