Thanks you for this module, it seems to be exactly what i need!
Unfortunately it is not quite working for me. I have all the required modules installed, fields seem to be set up correctly, and when i choose the multiple files source option, the plupload widget is there. Browse and upload all seems to work, but when the file upload is complete, the files aren't added, and a second instance of the upload dialog appears. I have seen this problem in the latest versions of firefox and chrome, so i don't think its a browser issue.
This is all in a fresh drupal install with up to date modules, using the seven theme.
Anyone else seen this issue or know what it might be ?
Thanks !
Comments
Comment #1
_paul_meta commentedFurther info .. normal file uploads work for this drupal site. Php is set to allow uploads up to 8M. Files directory is set to 777. Issue still exists even when i remove all the cck filefield settings for image size/dimensions etc.
Everything seems fine right up to the point that the files have uploaded. The throbber appears but instead of displaying the uploaded files, the widget reverts back to the file upload and there's two file upload widgets onscreen, both with standard upload and multiple files options.
Any help appreciated !
Comment #2
jbova commentedIs there anything pertinent in either the web server error logs, or the Drupal logs? Have you tried uploading a single file via the FileField Sources Plupload widget as suggested by Atle? Please check the destination folder to see if the files are actually being placed there, but just not being linked to the node.
Comment #3
atlea commented@_paul_meta: Please check your drupal and php logs for any clues, and try uploading a single file less than 5mb. If this fails, try one less than 1mb. I'm also curious if you can check your php post_max_size settings.
I did try to set up a new site to try to reproduce this. After a few tries without beeing able to break anything I did manage to get an error buy using very small values in php.ini. If I set php upload_max_filesize OR post_max_size settings to less than 1mb I got errors. They did however casue log entries in both phps error_log and drupals logs, so I am curious what you could find there.
The casue of the errors I was able to produce is that I have hardcoded a chunk size of 1mb. Since phps defaults starts at 2M for upload_max_filesize and 8M for post_max_size I dit not anticipate this to cause any issues.. but I might have to more intelligently determine a minimum here if this is what is causing your issue. Also make sure your php memory_limit is larger than post_max_size.
Atle
Comment #4
atlea commented@_paul_meta: Another thought.. check that your temporary directory is set up corretly and is writeable at admin/config/media/file-system
Comment #5
_paul_meta commentedThankyou so much for the quick replies and suggestions :)
Responses as follows:
Jbova
- Is there anything pertinent in either the web server error logs, or the Drupal logs?
drupal status report is all green, no log entries pertaining to file upload fails.
- Have you tried uploading a single file via the FileField Sources Plupload widget as suggested by Atle?
Single upload via standard upload works. Single upload via FileField Sources Plupload widget fails. Multiple upload via FileField Sources Plupload widget fails.
- Please check the destination folder to see if the files are actually being placed there, but just not being linked to the node.
Files are not uploaded to the destination folder.
Atlea
- Please check your drupal and php logs for any clues
no log entries relating to file upload fails
- and try uploading a single file less than 5mb. If this fails, try one less than 1mb.
the files i've uploaded are all less than 1mb
- I'm also curious if you can check your php post_max_size settings.
currently set to 8mb - this is running on a dedicated server. upload_max_filesize is set to 10mb
- Also make sure your php memory_limit is larger than post_max_size.
currently set to 512mb.
- check that your temporary directory is set up corretly and is writeable at admin/config/media/file-system
tmp directory is set up, and is set to 777. i checked in there and there is actually a backlog of files which if i download and set to .jpg instead of .tmp files, are in fact the files i have uploaded. they show up with the correct owner, group and permissions, but the process seems to have stalled there. the images sit as .tmp files in the directory but are not added to the node and the process fails.
Not sure if its relevant but i have transliteration module installed, and both options checked at admin/config/media/file-system.
Finally .. i looked at what was happening in the normal file upload process which works. Once the upload is complete, the actual file arrives in the /files directory named as an image file like image.jpg. but when attempting the upload with plupload widget, the process fails, and the file exists in files/tmp as a .tmp file. Seems like something in the final process is failing and i can't see why it would be permissions related since the standard upload works. The only difference i can see is that the .tmp file is 644, owner and group is nobody, and the .jpg file is 664, owner and group is nobody.
I am running this server with dso as the php handler as it helps performance a bit. It does mean i need to keep my files directory as 777, but aside from that, all my drupal sites usually work fine, and file uploads have never been an issue.
I hope this info helps and I really appreciate your time and help !
Paul
Comment #6
jbova commentedPaul,
FYI: I'm using this module with mod_php (DSO) without issue. Your permissions are correct.
Do you have either of the Core logging modules installed, Database logging or Syslog? Depending on your PHP log levels, these may show information that you won't see in your Apache error log, such as notifications and warnings.
If you have the Syslog module installed and have SSH access, can you do something like this:
tail -f /var/log/syslog | grep drupalThen, try to upload files and see what you get.If you have the Database logging module installed, then you can just look there.
If your files still have the .tmp extension, it seems that either the file_stream_wrapper_uri_normalize() or file_unmanage_move() functions are not working. Please try removing "Allowed file extensions" from your field.
If you are able to help narrow this down, please alter line filefield_sources_plupload.module starting around line 140 by adding watchdog lines as follows:
This will put messages in your logging facility as follows:
Please post those results back.
Thanks,
Jim
Comment #7
_paul_meta commentedThanks very much, I will run through this very soon and let you know how it goes :)
Comment #8
_paul_meta commentedHi again.
I tried removing the "Allowed file extensions" but its a required option for defining an image field.
I don't have syslog installed. The drupal install has database logging installed though.
I modified the module as suggested, cleared the logs, cleared the tmp directory. Attempted multiple file upload again and same issue occurred. Nothing showed up in the database log. Tmp files are still there. Permissions are nobody, 644.
Not sure if this is relevant or not, but i was experiencing one other file/permissions related issue. In files/fontyourface there was an issue writing to font.css. Even after setting both file and folder to 777 this persisted. Following advice from http://drupal.org/node/1177370#comment-4957324 I deleted the folder and file and after the module recreated the folder and file, it worked ok and no more errors occurred.
Obviously i can't do that to my entire files directory, but i did rename the tmp directory and then a new tmp directory was created on the next multiple file upload but the same issue with multiple image upload fail happened again.
This error showed up but i think it was a once off when the tmp directory was not there .. Warning: file_put_contents(temporary://file00w322) [function.file-put-contents]: failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1904 of /home/metamedi/public_html/d7cms/includes/file.inc). It didn't appear on subsequent attempts for multipe file upload.
I rechecked permissions again .. files folder, tmp folder, and destination folder for the field image are all set to 777 nobody. Standard image upload works every time, multiple image upload fails.
Open to any suggestions about the server setup, and willing to test patches if there is possibly an issue with the module.
Thanks !
Comment #9
jbova commentedPaul,
The only way the message wouldn't be added to the logs is if that particular block of code was never reached. So, I would continue putting watchdog() calls throughout the filefield_sources_plupload_element_value() function until you narrow down were the script stops processing.
Something like this:
Should result in the following logs:
If you don't see that, then maybe the callback isn't working? I'm *really* surprised that nothing showed up in your error logs. You aren't nearing your disk usage or disk quota are you? I'm not sure of the server setup, but it is common to put /tmp on its own small partition. Due to improper cleanup of temporary files, this partition could get full.
I have attached the module file with the changes listed above if it makes it easier for you.
Thanks,
Jim
Comment #10
_paul_meta commentedThanks Jim
I cleared my log, pasted in the code you provided to the module file, then attempted an upload of two images.
These log listings then appeared - listed in this order.
PluploadTest - Entered function filefield_sources_plupload_element_value
PluploadTest - Entered function filefield_sources_plupload_element_value
PluploadTest - Input isset
PluploadTest - Entered function filefield_sources_plupload_element_value
In terms of my setup .. the tmp file in in /public_html/files/tmp. And the server is a dedicated quad core server with 640gb hdd and generous ram allocations so i don't think its related to data/memory issues.
If its helpful to see any info from my phpinfo file just let me know.
Thanks,
Paul
Comment #11
jbova commentedPaul,
It looks like this may be related to the plupload module itself. Which version of the plupload module do you have installed, and which version of the plupload library do you have installed?
Jim
Comment #12
_paul_meta commentedLatest dev of the module
Information added by drupal.org packaging script on 2012-03-26
version = "7.x-1.x-dev"
core = "7.x"
Latest plupload
Version 1.5.4 (2012-04-12)
Thanks,
Paul
Comment #13
atlea commentedI'm have a hard time trying to reproduce this.. Like jbova suggest, your added logging points to plupload_element_value (from plupload instegration module) not returning any values.
I find it strange that you are not getting anything in the dblog nor in php's error logs. Can you check admin/config/development/logging and make sure it is set to "All messages"?
Comment #14
atlea commentedPaul: Could you test the Plupload Integration module by visiting yourdomain.com/plupload-test and try to upload a file? Then check for errors, and if you get none - check if the file has been downloaded to sites/all/default/files.
Comment #15
_paul_meta commentedHi Atlea
Confirming that logging is set to 'all messages'
When i did the test upload for 3 files at mydomain.com/plupload-test i got these messages.
Notice: Undefined property: stdClass::$source in imagecache_profiles_file_validate() (line 129 of /home/.../sites/all/modules/imagecache_profiles/imagecache_profiles.module).
Notice: Undefined property: stdClass::$source in imagecache_profiles_file_validate() (line 129 of /home/.../sites/all/modules/imagecache_profiles/imagecache_profiles.module).
Notice: Undefined property: stdClass::$source in imagecache_profiles_file_validate() (line 129 of /home/.../sites/all/modules/imagecache_profiles/imagecache_profiles.module).
This is when i chose the files and pressed the submit button. Following this test, the files end up in my files directory (which is public_html/files .. not sure if that is an issue.)
I also did a test where i chose the files and pressed 'start upload' inside the plupload widget. In this case the files upload but then the process stalls and the files are still as .tmp files in my tmp directory.
Thanks for your help :)
Paul
Comment #16
atlea commentedHi Paul
That's weird. :)
It's interesting that you can recreate the problem without using this module. FileField Sources Plupload removes the "start upload" options, triggering this on form/ajax-submit.
Since you can upload using the submit button - running the upload and moving from tmp in one operation, but not if you first push them to temp and then copy them on form submit, I am wondering if this could be caused by different web server processes trying to access the temp files? The standard /tmp location would not allow that, but you have a separate tmp inside the files directory from what I can tell.... hum..
Since imagecache_profiles is giving warning, did you try disabling this module?
Comment #17
_paul_meta commentedSorry for the slow reply - really busy week.
I tried disabling imagecache_profiles and this made no change.
As this is my first drupal 7 site i set up my files directory in public_html/files and the tmp directory in public_html/files/tmp.
Would it make a difference if it was in public_html/sites/default/files?
The reason i did this was as i use dso as my php handler, i need the files directory to be 777 and wasn't sure if i could do that within a restricted permissions directory like public_html/sites/default
When i have a free moment i'll do a completely fresh install and not change the files directory from the install setup, and see if i can replicate the problem.
If you have any other suggestions i'm willing to try it .. i'd love to have this module working and it seems so strange it keeps failing.
Comment #18
cyberwolf commentedWe encountered a similar problem and it appeared the problem was the limitations on post variable names set by PHP's Suhosin patch. We increased the value of some PHP settings and that fixed the problem:
suhosin.post.max_name_lengtgh: 128
suhosin.request.max_varname_length 128
Comment #19
dep85 commentedI had a similar problem on my website, when I moved this module on production server. On my localhost all worked fine... I started digging around and found source of the problem.
For me that happend because of ajax_comment module.
Without init function, ajax comment module works anyway... so I just get rid of that.
Maybe you've got same problem
Comment #20
fluffy commentedHad the exact same problem, the plupload by itself was working but not the filefield integration: no files after upload was complete. The suggestion in #19 cleared it up, thank you dep85.
Comment #21
jlab commentedI am experiencing the same problem. I don't have ajax comments module installed.
I can find no log entries that anything has failed.
This is on a clean install of Drupal.
Comment #22
sashken2 commentedI have this problem too. I'm uninstall ajax comments module. And all works good.
Comment #23
atlea commentedThe ajax comments module is not the issue. But since it is manipulating post variables, is can cause a length issue as described in #18. Increasing name length fixes this. Thanks Cyberwolf. :)
Comment #24
lpalgarvio commentedany developments for a fix? i'll test whatever i can ;)
Comment #25
sekhar33 commentedDid any one found solution for this? We are having the same issue, please keep us posted if there is any solution.
Thanks in Advance..!!
Comment #26
szantog commentedI added this to my module:
Also posted issue to ajax comments: #1866668: Fine-tuning of $_POST modification condition;
Comment #27
muschpusch commentednone of the above was fixing the issue for me. I used multiupload_imagefield_widget instead
Comment #28
sherynust commentedHey, i have found the issue. Why it's happening. There is nothing wrong with directories, permissions. All is due to the javascrit we're replacing in the file filefield_sources_plupload.module
we we comment the following line
$element['#attached']['js'] = array($module_path . '/js/plupload.js');
you ll see another option of start upload which works fine and uploads files successfully. But Next to this i tried to sovle this '/js/plupload.js'
but didn't get the solution. Please now what to do next kindly guide me. It's become the painful headache and getting worst.
Comment #29
jefftrnr commentedUpdating core to 7.23 seems to cause issues with the var $_POST['ajax_html_ids'] - it's now an array, with the [0] element containing the same comma-delimited list.
My plupload seemed to have the same trouble as #26 above, but I think it was for this array reason rather than something else. I added the following code to a custom module to override it's structure. I'm not sure if this is a good fix, but I'm not sure how to otherwise path. But it seems to be working fine now.
Comment #30
alex.bukach commentedSolution from #29 works (thanks for debugging, jefftrnr!), though it seems to be not the best solution. Any idea how to fix FileField Sources Plupload module to take into account this new structure of
$_POST['ajax_html_ids']?Comment #31
atlea commentedI have added the recommended Suhosin settings to README.txt in Dev.
This should solve these issues:
In php.ini add:
suhosin.request.max_varname_length = 128
suhosin.post.max_name_length = 128