When I upload large files (somewhere around 10M or greater) I get the following message.

"An unrecoverable error occurred. This form was missing from the server cache. Try reloading the page and submitting again."

My .htaccess has

php_value memory_limit 512M
php_value post_max_size 256M
php_value upload_max_filesize 128M

and my settings.php has

ini_set('memory_limit', '512M');

Any have a clue what might be causing this ? Because I don't and it's bothering the crap out of me.

Comments

quicksketch’s picture

Category: bug » support

Do you by chance have the subhosin PHP plugin installed? It will override any settings you make. You also should check phpinfo() and see what what level of maximum uploads you are allowed, regardless of what settings you're providing. If you're on a shared host, it's very likely that they are capping you at 10 MB. This, like all "uploads of X size" problems is likely caused by server configuration.

bryancasler’s picture

Thanks for responding quicksketch

After typing up a whole post I looked once over my phpinfo() and I do have Suhosin Patch 0.9.6.2 installed! What now? This is all new to me, never heard of Sohosin before. Anyone who can point me in the right directions would be more then helpful.

P.S. I also checked my phpinfo() and I am set up with "upload_max_filesize 128M"

bryancasler’s picture

I just found this article here. http://drupal.org/node/423478 Giving it a shot and will report back with the results.

bryancasler’s picture

SOLUTION FOUND!

Since Rackspace doesn't give me access to my php.ini file I had to edit my .htaccess file instead. I added the following code and everything worked like a charm. I'll be honest, I have no idea what those numbers mean but their big enough to allow me to upload a 128M file with no problem.

#Settings to surpass PHP's security around large and numerous file uploads
#http://drupal.org/node/423478
#http://www.hardened-php.net/suhosin/configuration.html#suhosin.post.max_...
#php_value suhosin.post.max_vars DEFAULT 200
#php_value suhosin.request.max_vars DEFAULT 200
#php_value suhosin.post.max_value_length DEFAULT 65000
#php_value suhosin.request.max_value_length DEFAULT 65000
php_value suhosin.post.max_vars 200000
php_value suhosin.request.max_vars 20000
php_value suhosin.post.max_value_length 265000
php_value suhosin.request.max_value_length 265000
php_value suhosin.upload.max_uploads 100

quicksketch’s picture

Status: Active » Fixed

Yay, great. Suhosin gave us more than a few headaches before we figured that out the first time. Thanks for the followup.

Mark LaCroix’s picture

Title: "Unrecoverable error" is giving me a headache » "Unrecoverable error" is giving *me* a headache, too!
Status: Fixed » Active

Sorry, I have to reopen this.

I have this same problem, and none of the posted solutions have worked for me. I'm on shared hosting, so who knows what other nonsense I'm subject to, but I have successfully raised my upload limits to the heavens, and according to phpinfo I don't have Suhosin installed on my server.

Anytime I upload any file of any size (using filefield or imagefield) I get this warning, *and* the field itself disappears from the page (I've seen issues on each phenomenon, but no explicit mention of *both* happening, so maybe my problem is unique).

I can usually suss out an issue like this by retracing my steps and applying some amateur logic, but I feel that I'm totally missing the thought process here, and so I'm left with caveman-style trial and error. I mean, I don't really see any possible connection between upload limits and "this form was missing from the server cache." What led those of you who have successfully solved this problem to go that route?

This only started recently, so it must be reversible, right? I successfully configured FileField about a month ago on a large site I'm currently building/configuring, but I haven't begun populating my content (thus encountering this error) until just today, so I have no idea when this problem began affecting me. I don't know if it was something I did, an module/database update I applied recently, or a change/upgrade on the back-end by my webhost (which has happened before). Uninstalling/reinstalling CCK modules one at a time is an undesirable option, but none of the posted solutions in this and other threads have any effect on the issue for me.

What am I missing here? (Thanks!)

deadrich’s picture

Having the same problem here. Adding the suggested lines to htaccess does not resolve. I echo the previous comments, how are these issues related to the upload limits?

I am able to temporarily fix the problem by setting Minimum cache lifetime to in admin/settings/performance, but of course I would prefer to be able to leave caching on since this is a high traffic site.

Any other suggestions are recommended.

quicksketch’s picture

Anytime I upload any file of any size (using filefield or imagefield) I get this warning, *and* the field itself disappears from the page (I've seen issues on each phenomenon, but no explicit mention of *both* happening, so maybe my problem is unique).

I'm fairly sure this has been covered *at least* a half-dozen times before. This problem is caused by the POST size exceeding post_max_size. Even if upload_max_filesize has been increased, post_max_size needs to be at least this size. If the size of the upload exceeds the post_max_size, PHP just ditches the ENTIRE $_POST variable and Drupal has absolutely nothing to work with (hence the unrecoverable error). See the handbook page at http://drupal.org/node/422474 for information on how to increase this limit. Check your phpinfo() to ensure that the limit is as high as you expect, since your host is probably capping you at a much lower level than anything you're setting in .htaccess or php.ini.

Mark LaCroix’s picture

I'm fairly sure this has been covered *at least* a half-dozen times before.

I know that *that* has been covered, but my point was that (as I said) I have checked this and it that not the problem. In fact, I had successfully increased both those values long before this problem began, and I was previously able to upload using FileField and ImageField with no problems. It just stopped working suddenly.

I'm fairly sure that it's something I did, but I don't think that it's just my upload_max_filesize or post_max_size since php_info confirms that they are both the correct values and they have not changed since before, when it was working previously. I've updated both modules recently, and while I don't want to "cry bug," it's all I have to go on right now.

I am especially sure that is is not related to php.ini/php5.ini because I've tried uploading files that are less than 1kb and they still produce this exact error, so even uploads below the default max values are causing this problem. Perhaps there is something in the module (or somewhere else) tricking the site/server/module/whatever into thinking that those limits have been reduced to zero or near-zero, leading to this behavior? Since the behavior points to POST size, what could cause the site to think that the max and post sizes are not set correctly even when they definitively are?

I'm no expert, but I know what I know, and I know what I don't know. :-)

Anyone have any other brainchildren on this? Is there any more information I should provide here (in case I missed some *other* obvious solution)?

Thanks!

TC44’s picture

"EXACTLY" the same problem here as @heywetried, from the sounds of it. The #9 description echos mine to a tee.

This error just started coming up yesterday. There were no modules installed between it working and the errors, we had just uploaded around 20 images and the error started.

I've got a dedicated server and set the limits in php.ini, and image size is not exceeding max file or post sizes (100M). I'm attempting to upload 60kb images to test, and the error persists.

I'll check the info again in #8 and see if anything is incorrect..

also related: http://drupal.org/node/500646

TC44’s picture

My php.ini settings are:

php_value post_max_size 100M
php_value upload_max_filesize 100M

For imagefield settings, I've had max size per file at 5M, and max per node @ 8M, and I've also tried with both left blank.

The error persists..

TC44’s picture

@heywetried,

This may be a longshot, but can you check your database user table and see if UID = 0 is still intact?

I did a db rollback to the day before the error while troubleshooting this, and upon restore got a "duplicate entry b in key 1" message. Checking further I noticed UID = 0 was auto-incremented from 0 to 20 (I use navicat) as per this issue - http://drupal.org/node/204411

After getting the user and role tables back in order (at least temporarily), I'm not getting the "unrecoverable error" while trying to upload an image.

I'm not saying it's necessarily even related in my case (I think it probably isn't), but it might be worth checking. It's all I could come up with so far..

asb’s picture

Hi,

I'm getting a similar error when trying to delete/remove a file from an Imagefield (trying to replace the image):

An unrecoverable error occurred. This form was missing from the server cache. Try reloading the page and submitting again.

When reloading, as suggested, the old image simply reappears. I can reproduce this as often as I want. PHP memory limits are most probably not an issue (I'm self-hosting and have set it to 64M; the image in question is ~200kB). Also tried the suggestions from a href="http://drupal.org/node/539476#comment-1886426">comment 1886426, also without success.

Any ideas? Is this issue related, or should I open another issue? Is it a Filefield or an Imagefield issue?

Related issues: #500646: An unrecoverable error occurred. Form missing from server cache

Thanks & greetings, -asb

beetbe.com’s picture

This is is not related to php.ini/php5.ini. I am still waiting the solution. It had been hurting me for a long time

bfdi533’s picture

subscribing

beetbe.com’s picture

The error persists..
Is there anyone here found solution?

Yuki’s picture

subscribing

ckng’s picture

quicksketch’s picture

Status: Active » Closed (duplicate)

Consolidating related issues. See #473760: HTTP 0 error when uploading ANY file. Please do not reopen this issue.

ronline’s picture

Having the same problem with a cck video field in flashvideo module.
My upload_max_filesize and post_max_size in php.ini are set to 500M, while the issue appear with a 10M file.

protoplasm’s picture

An unrecoverable error occurred. This form was missing from the server cache. Try reloading the page and submitting again

I just had this problem and so did members of my site. No uploads of images possible. Yesterday I had just installed the popup module and the other popup modules in it. When I uninstalled the popup module, this problem and error went away. Clearing the cache with drush did not help prior to this. So, in this instance, it appears my issue was not with filefield, but maybe some sort of conflict with the popup module.

chrixix’s picture

thanks for your tip; I just installed popup module this afternoon, and I got the same error when I tried to upload a file. I disabled popup, and everything works fine.

onejam’s picture

@chrixix Yep, there seems to be a conflict which was causing the error.

So i've posted up an issue at: http://drupal.org/node/893092