[support] Error Retrieving Form From Cache

Carl Wiedemann carl.wiedemann at gmail.com
Tue Aug 23 19:29:27 UTC 2011


Are you using memcache on the production server? I've run into problems
where cache_form is cleared out when cron runs. If cron runs after a form is
first loaded in the browser and before the form is submitted, the cache_form
entry is lost because memcache doesn't respect the cache_form lifetime for
some reason. Try excluding cache_form from the memcache bins, if possible.

There may be an issue for this but I didn't check since at the time we
didn't need memcache after all.

Carl Wiedemann
Website design and development consulting
carl.wiedemann at gmail.com | skype: c4rlww



On Tue, Aug 23, 2011 at 12:23 PM, Steve Edwards <killshot91 at gmail.com>wrote:

> I have been struggling for a few days with an issue with core form caching
> that is seen in filefield_sources (D6).  When I attempt to add an image
> using the Reference Existing option, I get the error "An unrecoverable error
> occurred. This form was missing from the server cache. Try reloading the
> page and submitting again." Other people have had the same error (see
> http://drupal.org/node/500646 and http://drupal.org/node/795004 for
> examples.).
>
> The main thing I'm not understanding is why the data is not being returned
> from the cache table.  First, here is the code from filefield module (the
> filefield_js() function) that throws the error:
>
>  // Build the new form.
>  $form_state = array('submitted' => FALSE);
>  $form_build_id = $_POST['form_build_id'];
>  $form = form_get_cache($form_build_id, $form_state);
>
>  if (!$form) {
>    // Invalid form_build_id.
>    drupal_set_message(t('An unrecoverable error occurred. This form was
> missing from the server cache. Try reloading the page and submitting
> again.'), 'error');
>    print drupal_to_js(array('data' => theme('status_messages')));
>    exit;
>  }
>
> As quicksketch points out in one of the issues, when the form is initially
> displayed, it should be cached in cache_form, and this error indicates that
> the form was not cached, and therefore is not retrieved from cache_form (he
> also points out this is not a filefield issue, but rather a core caching
> issue).  However, in watching the db, I can see that the form is saved in
> the cache (and I verified it using the form id displayed in the HTML against
> the cid value in cache_form), so it is there for to be retrieved by
> form_get_cache().  The only other option I can see is that
> $_POST['form_build_id'] is not available for some reason.
>
> What makes this more difficult is that I can't duplicate this on my local
> machine or our dev server.  This only happens on the production server at
> the hosting company.  Varnish is being used, but since this functionality is
> only used for logged in users, that should be an issue as far as I can tell.
>
> Can anyone offer any suggestions on how to fix this?
>
> Thanks.
>
> Steve
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110823/0b2c1fe2/attachment.html 


More information about the support mailing list