When uploading images into galleries, the first three go allright, but for the others I keep on getting this error:

Validation error, please try again. If this error persists, please contact the site administrator.

When uploading other images into another album, some of the failed images from the previous album come along into the new album.

I'm trying to import images into acidfree galleries.

Versions: Drupal 6.8, image_fupload 6.x-2.1, image 6.x-1.0-alpha3, acidfree 6.x-1.x-dev

Comments

grandcat’s picture

Status: Active » Postponed (maintainer needs more info)

Please try to activate "normal caching" at Home >> Administer >> Site configuration >> Performance (Page cache) and tell me if it helps.

Holie’s picture

Grandcat,

Normal caching is allready active.
the images names contain spaces and "(" ")", could that have anything to do with it?

grandcat’s picture

No, spaces are no problem for image_fupload.
Have you set another thing at performance page? For example, minimum page lifetime?
Could you create a screenshot of this page?

EDIT:
I saw that you were using Chrome, could you also test this special case in Firefox or IE 7?

Holie’s picture

StatusFileSize
new65.71 KB
new55.23 KB
new53.46 KB
new56.96 KB

I'm having these issues in chrome, ie7, ff3.0.5

The screenshots also include the installed modules and the error I get on image_fupload

Edit: Turning all caching completely off and clearing the cache doesn't seem te be a solution. When uploading 4 images there is no problem, when uploading 60 there is.

grandcat’s picture

StatusFileSize
new100.96 KB

So, I think, it's a configuration thing:
I saw that you have set "minimum lifetime" to 1 min. This could be a problem. Try to disable this option by setting it to the following:
<none>
Have a look at the screenshot and tell me if it helps.

Holie’s picture

Status: Postponed (maintainer needs more info) » Fixed

When setting it to <none> the problem is solved, thanks!

grandcat’s picture

OK, so I think, this is a Drupal Issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

mumsix’s picture

I am having the same problem and disabling the minimum cache lifetime worked but this isn't really a solution. Is there another way to fix this?

tntclaus’s picture

+1

I agree.

grandcat’s picture

At the moment, no.

dicreat’s picture

subscribe

donquixote’s picture

subscribe.

Why is this a Drupal issue?

omerida’s picture

I worked around this by disabling the cache_lifetime in function image_fupload_imagefield_node_create()

added this after global $user (line 236) :

  $cache_lifetime = variable_get('cache_lifetime', '');
  variable_set('cache_lifetime', '');

and this before the function closes (line 431)

  variable_set('cache_lifetime', $cache_lifetime);
hansrossel’s picture

Status: Closed (fixed) » Active

I'm using Boost for static caching, and #6 (setting cache to ) does not work. But for the rest the issue is the same.

#14 solves the problem in my site. Would it be possible to implement that fix into the code of the next release?

alanburke’s picture

Version: 6.x-2.1 » 6.x-3.0-rc2
StatusFileSize
new860 bytes

Patch based on 14,
but at a different location in the file

alanburke’s picture

Category: support » bug
Status: Active » Needs review
grandcat’s picture

Status: Needs review » Needs work

The location the settings are done, can't be taken. This would be too buggy.

inforeto’s picture

Tried the lines in #14 (http://drupal.org/node/353915#comment-1860284) and the validation error ceased.

inductor’s picture

Also this error occures when using memcache. Any chance for it to be fixed?

Macronomicus’s picture

Status: Needs work » Reviewed & tested by the community

Patch in #16 worked for me and I am using memcache among other things .. thanks a ton alanburke for fixing it, my new server and fupload were not playing nice until I found your fix, awesome!

Cheers!

theruslan’s picture

Patch in #16 worked for me. Thanks a lot.

p4trizio’s picture

Patch in #16 worked for me too, thanks

grandcat’s picture

Status: Reviewed & tested by the community » Needs work

I repeat that #16 is a hack. You could do the same by setting the value in Drupal's cache settings.

inforeto’s picture

What exactly cause conflict for sites with the page cache turned on?
(apparently on function fupload_filetransfer)

grandcat’s picture

It's the AJAX mechanism which is repeated for each image. If there's no cache enabled, the form won't be cached.

geerlingguy’s picture

Setting minimum lifetime to fixed the problem for me as well!

inforeto’s picture

Can we change the title of the issue to "Validation error when cache is enabled" ?

grandcat’s picture

Title: Validation error when uploading images » Validation error when minimal life time is set (cache)
geerlingguy’s picture

I can *also* confirm that this fixes problems with uploading behind a proxy server. I was at my wits end trying to fix this problem, and turning off the minimum cache lifetime solved both problems in one fell swoop!

das-peter’s picture

Hi there,

I changed a small piece of code to workaround this issue. My "minimal caching duration" is set to 5 minutes and everything works.

// Load the form from the Form API cache and check if valid
    $oldUserCacheTime = $user->cache;
    $user->cache = 0;
    $form_state = array('rebuild' => TRUE, 'values' => $_POST); // rebuild option needed to prevent that "_image_node_form_submit" gets executed by drupal_process_form
    if (!($form = form_get_cache($form_build_id, $form_state))) {
      // code based on upload.module (15/08/2008)
      form_set_error('form_token', t('Validation error, please try again. If this error persists, please contact the site administrator.'));
      $output = theme('status_messages');
      drupal_json(array('status' => TRUE, 'data' => $output));
      exit();
    }
    $user->cache = $oldUserCacheTime;

Cheers,
Peter

frankcarey’s picture

I've turned minimum cache off (we turned it on last week and then turned it off again for more than a week now) but I'm still getting the error. Images upload, and then the processing starts, but the processing widgets just keeps trying post requests over and over, but keeps getting this response:

{ "status": true, "data": "\x3cdiv class=\"messages error\"\x3e\nValidation error, please try again. If this error persists, please contact the site administrator.\x3c/div\x3e\n" }

We are also running memcache, but not for sessions. And we are running behind a load balancer.

frankcarey’s picture

yeah #16 fixed it for some odd reason. Looking at my variables table 'cache_lifetime' == 's1:0' . Again, I manually set min cache lifetime to none, and this was still an issue.

geerlingguy’s picture

I tried patching with #16, but that didn't do the trick for me.

My site is accessed behind a corporate firewall (MS proxy server), and upon upload, the first three or four pictures always go through, then the rest get stuck in the queue, while a proxy authentication window pops up, asking me to log into the proxy server again.

When I tunnel via SSH, or access the site from practically everywhere else, everything works swimmingly. :(

grandcat’s picture

O,k, but for your case: It seems to be the proxy's fault.

geerlingguy’s picture

Hmm... I was having trouble with this in both IE and FireFox all morning, then I changed line 26 of swfupload-settings.tpl.php to:

        debug: true,

After doing this, I could see all the data output of swfupload, and everything worked [Edit: works in IE after one failed attempt, doesn't work in FF]... I'll try a few other settings as well, and we'll see how it goes! (I think setting the "use_query_string" setting to 'true' in the SWFUpload settings might help as well, but wouldn't be as secure).

(By the way, it seems you're using tabs - at some point, you might want to switch to soft tabs).

EDIT: When I set the debug mode to 'true' and try uploading via firefox, here's the output (it doesn't advance past the last line):

SWF DEBUG: StartUpload: First file in queue
SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0
SWF DEBUG: Global Post Item: PHPSESSID=[redacted]
SWF DEBUG: Global Post Item: fieldname=field_image_gallery_image
SWF DEBUG: Global Post Item: nodetype=image_gallery
SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload.  Starting upload to /fupload/flash for File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 165043. Total: 165043
3dloco’s picture

Thanks Omerida & Alanburke....#16 worked for me too..