Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi. (sorry by my poor english)
I have a content type with a imagefield 6.x-3.0 with cck 6.x-2.4 in drupal 6.12
When i try to upload a image file appear this error:
"An unrecoverable error occurred. This form was missing from the server cache. Try reloading the page and submitting again." and the form dissapear.
Thanks for your help
Comment | File | Size | Author |
---|---|---|---|
#74 | drupal-500646-74-fix-ahah-form-cache-error.patch | 559 bytes | mikeytown2 |
aaa2009-06-24_111034.jpg | 77.35 KB | cbuetas |
Comments
Comment #1
quicksketchThis problem does not exist on a fresh install of FileField. You'll need to provide a list of steps to reproduce this problem starting with a fresh install so that I can reproduce. You might also try disabling other modules until uploading works properly.
Comment #2
quicksketchComment #3
desunit CreditAttribution: desunit commentedIt's not a problem with ImageField, see this:
http://drupal.org/node/331941
All that you need to do is create hook_form_alter and set there for a form:
Comment #4
manuelBS CreditAttribution: manuelBS commentedi added the $form['#cache] = TRUE in hook_form_alter but the error is still the same. I have now disabled cacherouter an so it works....But I would like to have cachrouter enabled...is there another problem eventually?
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedFor me, the error mostly occurs when I open multiple browser windows with a node/edit page (different nodes). The image upload ajax form is then often "lost" on the server. Any ideas? The cache hook solution above also did not work for me.
Comment #6
Tom Verhaeghe CreditAttribution: Tom Verhaeghe commentedI just had the exact same error. This error occured after installing the Node Clone module. Fixed this error after adding these lines under imagefield_form_content_overview_form_alter in imagefield.module. This fix worked instantly. Let me know if it fixed yours!
Comment #7
TC44 CreditAttribution: TC44 commentedI'm getting the same error now when trying to upload an image. It seemed to start happening after a certain number of images were uploaded. That was really the only change. There were no modules installed between it working, and the error message starting. In my case it happens everytime, once you select an image and hit "upload"
#6 did not work for me.
Comment #8
TC44 CreditAttribution: TC44 commentedrelated - http://drupal.org/node/539476
Comment #9
asb CreditAttribution: asb commentedSame issue here.
I'd like to try the hack suggested in #3, but can't locate
imagefield_form_content_overview_form_alter
in imagefield.module.related (in proper syntax): #539476: "Unrecoverable error" is giving *me* a headache, too! and #500220: Wrong conditions for cache flush in memcache.inc? (in my case, the error appeared directly after enabling memcache-module).
Any suggestings?
Thanks & greetings, -asb
Comment #10
beetbe.com CreditAttribution: beetbe.com commentedHaving the same problem and still has no solution. Any ideas, link to resolve it ?
Comment #11
beetbe.com CreditAttribution: beetbe.com commented@Heart Driven
I can't find "imagefield_form_content_overview_form_alter in imagefield.module" as you say
Is there anyone here fixed this ?
Comment #12
asb CreditAttribution: asb commented> Is there anyone here fixed this ?
I can't fix this issue, but I know what it caused it in my case: enabling the memcache.module directly triggers the "unrecoverable error" (cf. #500220: Wrong conditions for cache flush in memcache.inc?). However, this issue seems to be far more complex and needs to be solved by it's root since lots of this fancy CCK stuff went into the D7 code...
Greetings, -asb
Comment #13
ckngHaving the same problem when memcached is enabled (using memcache.inc). See #500220: Wrong conditions for cache flush in memcache.inc?
For me, it is not an issue of upload file size, post max size or suhosin, as they are high enough for my need (on VPS). The $form['#cache'] = TRUE; into form_alter also does not solve the problem.
Comment #14
ronnbot CreditAttribution: ronnbot commentedWe are seeing the same error too in a similar installation: cck, imagefield, multiple memcache severs (one for each web server accessed via cache router)
The problem for us is that when the form is sent back, it may end up in a different webserver that did not originally generate the form, hence not having any of the additional form data cached in its memory (memcache).
We get around this (for now) by accessing one of the webservers directly to do the admin stuff.
We are trying out each of the following as a more permanent fix:
UPDATE:
We did the simplest change for now - changed settings.php so that cache_form bin points to one of the webservers, and it works.
Comment #15
den2penguin CreditAttribution: den2penguin commentedHi!! I have the same problem. But i already fixed it.
The problem occurred to me when i hide/disabled this code in my template.php file
$vars['whole_form'] = drupal_render($vars['form']);
Then, after in enable it again in my template.php and hide it in my *.tpl.php file.
The error is gone.
btw, Thanks for all the instructions/way how to solve this kind of problem. This might be useful in the future.
Comment #16
flavor CreditAttribution: flavor commentedI solved this problem by going into my Performance settings and disabling all the cache settings. I set the min lifetime to none and it fixed it.
Comment #17
hedac CreditAttribution: hedac commentedI have the same error with filefield for mp3 files... not an issue of imagefield.
I think I started to have this error since I enabled APC RFC1867 as described in the status report: admin/reports/status
Comment #18
jthaxton CreditAttribution: jthaxton commentedI have this same problem and solved it, temporarily, updating any content types that had BOTH an imagefield and embedded media field so the image field loaded AFTER the embedded media field. Weird, but it solves my problem. Not a true solution but clearly these two modules are having at it.
Comment #19
justinlevi CreditAttribution: justinlevi commentedI just got this bug as well.
Modifying imagefield.module, by adding the imagefield_form_alter function, worked for me the first time I tried to re-upload a large video. However, I'm still seeing this issue on every large image upload now.
Justin
*UPDATE - I have continued to run into this issue on different Drupal installs and only seem to be able to fix the situation if I disable all cache settings.
Comment #20
marcus178 CreditAttribution: marcus178 commentedI'm having the same result too. Although I'm sure it worked yesterday and can't work out why.
Comment #21
dicreat CreditAttribution: dicreat commentedsubscribe
Comment #22
Rasta00 CreditAttribution: Rasta00 commentedSo I don't know if this will help, but I found a fix that worked for me. Hopefully it will be of some assistance.
I had been playing around with the cache table right before this problem appeared. I was having the exact same problem as everyone else. I was getting the Unrecoverable Error message, and the 'Upload' button would disappear. I tried a bunch of the fixes but nothing worked.
I know I had backups set to dump the database everyday and when I went to look at the archived dumps, I noticed they were all too small. On further inspection, I saw the dumps weren't happening because some of the tables were messed up and needed to be repaired.
The first error pointed to the cache table. I took a look at the table via PHPMyAdmin and got the message - 'the table is corrupted -repair it' (or something to that effect). So I entered into the SQL box 'repair table cache;'.
After doing that the table was repaired but the problem persisted.
After some further inspection, I noticed that I had another error emerging from the failed backups regarding the cache_form table.
The error was:
Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `cache_form`': Incorrect key file for table './database_name/cache_form.MYI'; try to repair it (126)
Again, I took a look at the cache_form table in PHPMyAdmin, and there was also a warning there again stating - 'the table's messed up - repair it'. Again, entered 'repair table cache_form;'
The table was repaired, and when I went back to my site I was able to upload the image successfully.
I've been looking for a fix for this problem for almost a week now, and have been following these threads (and others) and hope this helps. My advice would be to check all of your 'cache' and 'cache_' tables to see if any of them need repairing. PHPMyAdmin was a helpful tool in easily checking this.
Good luck!
Comment #23
wickedskaman CreditAttribution: wickedskaman commentedIf you are working with preprocess variables and templates comment #15 by den2penguin is very helpful.
You might be forgetting to load the rest of the form data which has some of the settings needed for the imagefield to work.
After assigning variables to the appropriate form elements print the rest of the form inside a div that you hide like this:
In your preprocess function:
In your template:
Yes, I am aware that inline CSS is nasty... but it's there for the implicit example.
If you are a stickler like me you can unset visible form elements one by one in the preprocess function like so:
This did the trick for me. There's a very good step-by-step tutorial here: http://blip.tv/file/1139210 (video!)
There's also some good reading here: http://drupal.org/node/368776
Bon apetit.
Comment #24
Anonymous (not verified) CreditAttribution: Anonymous commentedSolution found for cacherouter users:
If you use an opcode cache like APC cache w/ cacherouter, then think about the 'cache_form' table. APC cache doesnt cache the form sessions correctly. You need to remove that table from apc caching, similar to this (in settings.php):
So put 'cache_form' back into the regular db.
Comment #25
madwalo CreditAttribution: madwalo commentedi got the same error, i have memcached on my server and the error was shown when memcached went down or full, i've restarted memcached and it worked again
Comment #26
jaydubb181 CreditAttribution: jaydubb181 commented#16 solved the problem for me.
Comment #27
Kane CreditAttribution: Kane commentedSame problem here. Don't know where to put
because there's no imagefield_form_content_overview_form_alter.
Maybe disabling cache can help with it, but for me that's just not an option.
Comment #28
Steven Jones CreditAttribution: Steven Jones commentedIf you're encountering the error, and you have memcached running, you might want to look at #719588: Documentation of memcached installation
Comment #29
mkalbere CreditAttribution: mkalbere commented#24 solved it for me ...
Comment #30
rwd CreditAttribution: rwd commented#24 solved this issue for me; thanks morningtime.
Comment #31
RikiB CreditAttribution: RikiB commented#24 worked for me
Comment #32
asb CreditAttribution: asb commentedComment #33
quicksketchHmm, so mark this as fixed? What can ImageField do about CacheRouter breaking the cache_form table/bin?
Comment #34
quicksketchUpdating title for future searchability.
Comment #36
Exploratus CreditAttribution: Exploratus commentedI tried #24 using memcache but it didnt work. Still get the error from #1 every time more than one user tries to add a node at once. If two people add a node, or if one person tries to add two nodes at once, then imagefield gives the error. One needs to save, and reupload...
$conf['cacherouter'] = array(
'default' => array(
'engine' => 'memcache', // apc, memcache, db, file, eacc or xcache
'servers' => array('localhost:11211'),
'shared' => TRUE,
'prefix' => '',
'path' => 'sites/default/files/filecache',
'static' => FALSE,
),
'cache_form' => array(
'engine' => 'db',
),
);
Comment #37
winawer CreditAttribution: winawer commentedI have the same problem. for me it solved by making writable "file" folder.
Comment #38
winawer CreditAttribution: winawer commentedjust see your "file" folder in address: sites\default\files. if this folder or subfolders be "read only" can make this problem.
I hope this help.
Comment #39
asb CreditAttribution: asb commentedFixing title (as of #34)
Comment #40
opdavies#16 worked for me too!
Comment #41
opdaviesThis worked for me too!
Comment #42
Exploratus CreditAttribution: Exploratus commented#37. But I am not writing to folder.. I am using memcahce and db... Why would I need to make the files folder 777. I have it at 775.
Comment #43
AlanAtLarge CreditAttribution: AlanAtLarge commented#16 setting min lifetime to worked, but isn't that just a workaround?
Comment #44
mkalbere CreditAttribution: mkalbere commentedyes : #16 is very bad. Of course you wont get any cahe error if you disable your cache ... seems obvious. But even for sites web with low traffic, cache should be used at least for anonymous.
No cache= bad performance, server overload, hangry customer ..
#24 did work perfectly for me and allow you to serve cached pages.
Comment #45
Fleshgrinder CreditAttribution: Fleshgrinder commentedSame problem here, comment #24 solved the problem for me. Here the related part of my
settings.php
:Comment #46
blueprint CreditAttribution: blueprint commentedHejo,
I had tried the various solutions, to no avail. However, it seemed clear that improper form handling might be a problem. I had had functioning uploads UNTIL I installed / enabled the popup module. After disabling it, everything was fine. Should this be reported to the popup issue queue?
Comment #47
mattwmc CreditAttribution: mattwmc commentedI have this problem as well.
I need to reload the page and then it works fine.
Comment #48
domidc CreditAttribution: domidc commentedThe upload problem caused by a form cache error due to memcached ceased when I gave the cache_form table its own bin cache bin as described in #14
Maybe this should be taken into the documentation when installing memcached?
Comment #49
sp_key CreditAttribution: sp_key commentedFor me it happened when I installed taxonomy super.
btw, I don't have cacherouter installed, how is this a cacherouter configuration issue?
Comment #50
sp_key CreditAttribution: sp_key commentedI have the same problem.
I can confirm with certainty the following:
All cache optimizations under /admin/settings/performance are ALREADY disabled (this is my staging environment) and the problem is there every time I try to upload an image.
I can also confirm I haven't installed CacheRouter OR memcache however, if I run Cron I get the below warning:
Performance logging APC disabled.
Performance logging on live web sites works best if APC is enabled.
I don't know if this is any related - can you please advice?
Also, I want to try #24 but I can't follow the instructions of how to achieve this (in particular removing the table and putting it back?). Can someone please be a bit more detailed?
Many thanks in advance
Comment #51
sp_key CreditAttribution: sp_key commentedUpdate: After many tests, I've found out that in my case it might be the 'drupal for facebook' module.
The problem is this: In my site users log in to create events. If they create a new drupal account then uploading an image works. If they connect using facebook connect they get the aforementioned issue
Comment #52
bleen CreditAttribution: bleen commentedsubscribing ... I am having the same problem, but only intermittently. I use the memcache module (not cache_router) and I have been playing with variaous combinations of settings for days ... no dice yet
Comment #53
mr.j CreditAttribution: mr.j commentedSame problem here. Sadly the error is intermittent and a reload of the edit page and re-upload of the image works. I do not use cacherouter or memcached at all, and it can't be a php upload limit as I read on another thread, as it does work after reloading.
Setting the site caching mode to disabled in performance settings does not fix the problem.
So it is extremely difficult to debug.
Comment #54
bleen CreditAttribution: bleen commentedmemcache users ... this solved my problem:
#959200: Add ability to exclude bins (tables) from memcache
Comment #55
manuelBS CreditAttribution: manuelBS commentedFor cacherouter Users, you have to set
'cache_form' => array(
'engine' => 'db',
),
in your cachrouter array in settings.php
This worked for me.
Comment #56
marsh CreditAttribution: marsh commentedHad the same problem. Disabling the Popup module did the trick.
Comment #57
superflyman CreditAttribution: superflyman commentedI am having the same problem as well. Using Imagefield, Filefield and Insert modules. Typically, after 1 or more uploads somewhere along the line we get this error. Also, if you save a node and them come back and try and add images, it breaks immediately.
Comment #58
marios88 CreditAttribution: marios88 commented#24 fixed it
Comment #59
bharathi2626 CreditAttribution: bharathi2626 commented/etc/init.d/memcached restart
Comment #60
fchandler CreditAttribution: fchandler commentedI had this issue with a Drupal 6.20 install running Filefield 6.x-3.10, Imagefield 6.x-3.10 and Imagecache 6.x-2.0-beta12. Got the errors on trying to upload. Could refresh and load the image, but the thumbnails would not show up in the view (6.x-2.12). Turns out there was an "&" in the file names. Took that out and the thumbnails showed up in the view. And did not get the error, if that helps.
Comment #61
mr.j CreditAttribution: mr.j commentedI can reproduce this by editing nodes in multiple tabs. Go to a node list somewhere and click the edit links on several of them to open in multiple tabs. Once you have uploaded an image to one and saved it, the upload of images to the others will fail every time until you reload their pages.
Comment #62
enjoylife-2 CreditAttribution: enjoylife-2 commentedmorningtime, did you solve the problem? my site recently have the same problem with you.
Comment #63
enjoylife-2 CreditAttribution: enjoylife-2 commentedmy site works fine some time. but recently it occurs the same problem as #5 #7.
how to correct it? i didn't install the module memecache and cacherouter. what's the reason that maybe cause this problem?
Comment #64
enjoylife-2 CreditAttribution: enjoylife-2 commentedanybody solved this problem?
Comment #65
bshensky CreditAttribution: bshensky commentedJust wanted to share my facepalm moment...
Our Development server runs memcache. Our Production server does not.
Production was misbehaving on ALL AHAH form code associated with file uploads as well as file delete requests. The errors included the one discussed here:
as found at lines 575 and 587 in filefield.module
Culprit?
There's no memcache daemon running on our Production server as there was on the Development server, so I had disabled the memcache module on Production. Seems simple enough.
BUT memcache module requires that you set a reference to an include file ('cache_inc' => './sites/all/modules/memcache/memcache.inc') in the $conf hash in the sites/SITENAME/settings.php file. I had forgotten to remove that entry alongside turning off memcache support module.
Having it in the $conf hash was enough for the AHAH to go apesh!t on me, despite having turned off the memcache support module.
I removed the offender from the $conf hash, and the problem went away.
Soon, my blood pressure will return to normal.
Comment #66
Thomasr976 CreditAttribution: Thomasr976 commentedSame problem as #63 and in search of a solution. Seems to occur mainly withy blog nodes.
Comment #67
uday4ru CreditAttribution: uday4ru commentedThanks , I got this error after moving website to other server. I have added your code and now things works perfect.
Comment #68
jmensonen CreditAttribution: jmensonen commented#45 fixed the problem with me. So if you're using cachrouter with apc, definitely try this out. Cheers!
Comment #69
bserem CreditAttribution: bserem commentedIn my case the cache_form table needed repairs.
I suggest to everybody to check this first if they are not using memcache/cacherouter.
I also posted this info here: http://drupal.org/node/795004#comment-5118256
in case it helps somebody
Comment #70
webcomm CreditAttribution: webcomm commentedRemoving the following from my settings.php fixed the problem for me:
$conf = array(
'cache_inc' => 'includes/cache-install.inc',
);
Comment #71
joyofkolkata CreditAttribution: joyofkolkata commentedI got the solution from this article:
http://www.kdweb.co.uk/blog/drupal-filefield-module-bug-and-other-modules-using-ahah-form-%E2%80%9C-form-was-missing-server-cache%E2%80%9D
The solution is updating one line in includes/cache.inc from
From
if (isset($user->cache) && $user->cache > $cache->created) {
To
if (isset($user->cache) && $user->cache > $cache->expire) {
Comment #72
DRUPALON CreditAttribution: DRUPALON commentedso many thanks #71
this works fine
Comment #73
atutweb CreditAttribution: atutweb commented#24 is working. Thank you so much.
Comment #74
mikeytown2 CreditAttribution: mikeytown2 commentedPatch attached. I haven't looked into the fundamentals of this, but we have this issue popup every now and then so there is something wrong. Patch works for core and for pressflow.
Comment #75
silios CreditAttribution: silios commentedDisabling the option "Show memcache statistics at the bottom of each page" at /admin/settings/memcache stopped the error and images are uploaded normally again on my installation (with memcache module). Might try that as well before patching and what not.
Comment #76
mikeytown2 CreditAttribution: mikeytown2 commentedIf your using memcache, this patch (#74) will do nothing as cache.inc from core is replaced with the one from memcache.
Comment #77
kaanon CreditAttribution: kaanon commentedThought I'd chime in.
For me, memcache had stopped. I just needed to restart it.
Comment #78
jmonma CreditAttribution: jmonma commentedFor those using memcache, and/or project mercury, encountering this issue (and are sure it's still running on your server), the following variation of #24 fixed it for me...
change the memcache bin for forms to 'database' in settings.php. For me I had to change from:
To:
Comment #79
Peter Törnstrand CreditAttribution: Peter Törnstrand commented#74 solved my problem. I'm not using memcache.
Comment #80
abhigupta CreditAttribution: abhigupta commented#74 didn't fix my problem. However, I noticed that on my server mysql variable max_allowed_packet was set to 1M and when I increased it to 8M, it fixed the issue. Some of those serialized cache variables are very big.
Comment #81
pasive CreditAttribution: pasive commentedThanks @ronn abueg The simplest approach with cache_form bin changes in settings file worked for us on bounty.com website.
Comment #82
deggertsen CreditAttribution: deggertsen commented#74 worked for me as well. Hopefully this can be in the next release.
Comment #83
chales CreditAttribution: chales commentedNote for others who may run across this error. Please check your error logs because I also just experienced this error with a new migration. The issue was as posted in #80, mysql had max_allowed_packet set to the default of 1M. Adding max_allowed_packet = 16M to the my.cnf file took care of the error for me.
Comment #84
e0ipsoRestarting memcached solved the problem for me.
Comment #85
Anonymous (not verified) CreditAttribution: Anonymous commentedI will repair the table cache_form and this will worked for me.
Comment #86
BrockBoland CreditAttribution: BrockBoland commentedNeeds issue summary (badly)
Comment #87
Anonymous (not verified) CreditAttribution: Anonymous commentedI think #78 is right when using memcached. Don't store the cache_form table in memcached.
Comment #88
aveldina CreditAttribution: aveldina commentedHad this issue this morning, am using memcache. In my case it seems memcache had stopped and had to be restarted. Now wondering why memcache stopped..
Comment #89
Damien Tournoud CreditAttribution: Damien Tournoud commented#74 is totally bogus.
The problem is that the minimum cache lifetime feature is broken as it should track the clearing per bins. For Drupal 7, it has been fixed in #1015946: Eliminate $user->cache and {session}.cache in favor of $_SESSION['cache_expiration'][$bin].
For Drupal 6, just disable the minimum cache lifetime feature. It is way more trouble then it worth.
Comment #90
marc.groth CreditAttribution: marc.groth commented#25 worked for me.
Didn't check that memcache was running after migrating to a different server... Turns out it wasn't. Restarting it fixed the issue :)
Comment #91
marthinal CreditAttribution: marthinal commentedI got the same issue here. Memcache service was stopped, so verify the status of the service.
Thanks!
Comment #92
warmnoise CreditAttribution: warmnoise commentedFor those of you visiting this thread that are using APC opcode cache, it seems that using it for upload progress will generate issues. In this case, an image field generated an HTTP error 0 when trying to upload. You will need to either:
* Disable apc.rfc1867
* Use an alternative uploadprogress such as PECL.
Comment #93
AaronBaumanGot this problem while running on Acquia (memcache, apc, other goodies) and #78 fixed it.
Comment #94
mattwmc CreditAttribution: mattwmc commentedRestaring memcached worked for me
Comment #95
kollimited CreditAttribution: kollimited commentedIt happens sometime that what we want does not happen even when we are on the right way.So, try it once more.I am sure this time it wont show an error. Web development london
Comment #96
eddie_c CreditAttribution: eddie_c commentedI'm not using memcache or cacherouter but like #69 and #85 the cache_form table was marked as crashed.
I checked this was the case by running this query:
select * from cache_form limit 10;
And got the response:
ERROR 144 (HY000): Table './<database>/cache_form' is marked as crashed and last (automatic?) repair failed
To fix it I then ran:
REPAIR TABLE cache_form;
Comment #97
pkum CreditAttribution: pkum commented#78 solved my problem. Thanks a lot!
Comment #98
soulfroys#96 is my case too :-)
Comment #99
franekdziupla CreditAttribution: franekdziupla as a volunteer commentedHello,
I've had the same problem...
In my case i logged in phpmyadmin and seen, that the table cache_form was missing! No idea why. So, I got structure of one from another installation of Drupal and....
Boom! Works fine for me :)
Strange this thing...
Comment #100
rschletty CreditAttribution: rschletty commentedThe reason I received this error was because I had an accented vowel in the filename: Un día caminaba
Changing the file name to Un dia caminaba fixed it.