Are you using memcache on the production server? I&#39;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&#39;t respect the cache_form lifetime for some reason. Try excluding cache_form from the memcache bins, if possible. <div>
<br></div><div>There may be an issue for this but I didn&#39;t check since at the time we didn&#39;t need memcache after all.<div><div><br></div><font color="#333333">Carl Wiedemann</font><div><div><font color="#333333">Website design and development consulting</font></div>
<div><font color="#333333"><a href="mailto:carl.wiedemann@gmail.com" target="_blank">carl.wiedemann@gmail.com</a> | skype: c4rlww</font></div></div><br>
<br><br><div class="gmail_quote">On Tue, Aug 23, 2011 at 12:23 PM, Steve Edwards <span dir="ltr">&lt;<a href="mailto:killshot91@gmail.com">killshot91@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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 &quot;An unrecoverable error occurred. This form was missing from the server cache. Try reloading the page and submitting again.&quot; Other people have had the same error (see <a href="http://drupal.org/node/500646" target="_blank">http://drupal.org/node/500646</a> and <a href="http://drupal.org/node/795004" target="_blank">http://drupal.org/node/795004</a> for examples.).<br>

<br>
The main thing I&#39;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:<br>
<br>
  // Build the new form.<br>
  $form_state = array(&#39;submitted&#39; =&gt; FALSE);<br>
  $form_build_id = $_POST[&#39;form_build_id&#39;];<br>
  $form = form_get_cache($form_build_id, $form_state);<br>
<br>
  if (!$form) {<br>
    // Invalid form_build_id.<br>
    drupal_set_message(t(&#39;An unrecoverable error occurred. This form was missing from the server cache. Try reloading the page and submitting again.&#39;), &#39;error&#39;);<br>
    print drupal_to_js(array(&#39;data&#39; =&gt; theme(&#39;status_messages&#39;)));<br>
    exit;<br>
  }<br>
<br>
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[&#39;form_build_id&#39;] is not available for some reason.<br>

<br>
What makes this more difficult is that I can&#39;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.<br>

<br>
Can anyone offer any suggestions on how to fix this?<br>
<br>
Thanks.<br>
<br>
Steve<br>
<font color="#888888">--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</font></blockquote></div><br></div></div>