Trouble with new uploader

213 views
Skip to first unread message

Jon Schewe

unread,
Apr 3, 2020, 7:39:03 PM4/3/20
to Gallery 3 Users
I'm running Gallery 3.1.0. I'm quite happy with the upgrades. However I'm having a problem with the uploader. It worked for me in initially. However when I'm uploading today I get part of the first photo uploaded and then it stops. Looking in the apache log files I see the following:

CLIENT_IP - - [03/Apr/2020:19:15:34 -0400] "POST /gallery/index.php/uploader/add_photo/16800 HTTP/1.1" 400 1063 "https://HOST/gallery/index.php/ALBUM_URL" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0"

[Fri Apr 03 19:16:04.807338 2020] [proxy_fcgi:error] [pid 3133] (70008)Partial results are valid but processing is incomplete: [client CLIENT_IP] AH01075: Error dispatching request to : (reading input brigade), referer: https://HOST/gallery/index.php/ALBUM_URL

I tried disabling the apache module reqtimeout, but that didn't help.

Does anyone have any suggestions to fix this?

Thank you,
Jon

Brad Dutton

unread,
Apr 3, 2020, 7:48:51 PM4/3/20
to Gallery 3 Users
Is your upload taking a long time?

It looks like you are using Apache and PHP FPM, I think timeout and proxytimeout are the settings you need to update if a timeout is the problem:

Jon Schewe

unread,
Apr 3, 2020, 10:05:15 PM4/3/20
to gallery...@googlegroups.com
Looking at my configuration I see that I already have Timeout set to 300 seconds. I don't have ProxyTimeout set and that defaults to Timeout. The difference between the access and the error here is 30 seconds. So I don't think those variables are it.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/a5feea73-032a-470d-8d25-5212055f2aa3%40googlegroups.com.

Brad Dutton

unread,
Apr 3, 2020, 10:42:16 PM4/3/20
to Gallery 3 Users
Which version of Apache are you running?
To unsubscribe from this group and stop receiving emails from it, send an email to gallery...@googlegroups.com.

Jon Schewe

unread,
Apr 4, 2020, 1:44:31 PM4/4/20
to gallery...@googlegroups.com
2.4.29-1ubuntu4.13

>php --version
PHP 7.2.24-0ubuntu0.18.04.3 (cli) (built: Feb 11 2020 15:55:52) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.24-0ubuntu0.18.04.3, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

Is mod_php better for this than php-fpm? My server is low on RAM, so I'm looking to reduce memory usage where possible.

Jon Schewe

unread,
Apr 12, 2020, 10:33:29 AM4/12/20
to gallery...@googlegroups.com
Anyone else have ideas on why large pictures won't upload?

JR

unread,
Apr 13, 2020, 2:53:57 PM4/13/20
to gallery...@googlegroups.com

Jon,

Sorry for the delay, the Easter weekend got in the way. There are a couple other settings in your server's php configuration you should check (and possibly change):

max_file_uploads  =  50 (It means max 50 files can be uploaded in the php session... maybe simultaneously? not sure.... I have mine at 50 since I don't' think it's a good idea to hit Gallery 3 with more than 50 files at a time)

upload_max_filesize = 256 M (megabytes) (you might want to change that to a higher number and see if it solves the problem. CAUTION: 256 megabytes is a very big file. I never upload files bigger than 5 to 6 megabytes to my gallery. Anything larger, once you get a couple hundred of them into your gallery, will tend to slow down response time dramatically -- if not for you then for your users. People with 50+ GB internet connections tend to forget that 60% of people in North America can still only get 5 to 10 GB download speed).

There's a third setting I don't know much about, but there's a chance it might need changing --

post_max_size = 128 M (I never noticed this before, but it seems strange to allow a file up to 256 M to be uploaded and only limit the "maximum post size" to half that amount).

-- J.R.

--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Jon Schewe

unread,
Apr 13, 2020, 9:13:48 PM4/13/20
to gallery...@googlegroups.com
Thanks for the pointers. Here are my current settings:

max_file_uploads = 20

Increasing this size didn't help and my images are only 10MB.
upload_max_filesize = 400M

This needs to be as large or larger than upload_max_filesize according to the manual.
post_max_size = 450M

Brad Dutton

unread,
Apr 13, 2020, 11:45:41 PM4/13/20
to Gallery 3 Users
For clarification, were you running nginx/php-fpm before the upgrade? I'm trying to narrow down what changed in the upgrade process. If you just switched to nginx you need a larger client_max_body_size, it defaults to 1meg. Also, for the PHP settings I like to verify them using phpinf(), sometimes the wrong ini files get updated and the settings aren't what you think they are.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery...@googlegroups.com.

--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery...@googlegroups.com.

JR

unread,
Apr 13, 2020, 11:58:07 PM4/13/20
to gallery...@googlegroups.com

Jon,

Yeah, I thought upload_max_filesize and post_max_size to be the same... don't know how my own configuration got out of wack. Luckily I never upload a file much bigger than 5M or I would have been the one asking questions.

About the only thing I can suggest is that you run a series of tests. Start with like a 2M file and try to upload it. If successful, try a 3M file, etc. until you hit a file size that won't upload. That might give an indicator of where the problem is kicking in.

-- J.R.

Jon Schewe

unread,
Apr 14, 2020, 7:59:32 AM4/14/20
to gallery...@googlegroups.com
I'm using Apache with php-fpm. That has been the same both before and after the upgrade. Attached is the output from phpinfo. I temporarily added an info.php file to my gallery install to gather this to ensure that it's the same values that gallery sees.
phpinfo.html

Jon Schewe

unread,
Apr 14, 2020, 9:21:41 PM4/14/20
to gallery...@googlegroups.com
Some more data on this. I tried some images of different sizes. It seems to me that it's somehow time limited as I noticed that for 4.0MB and 5.2MB the images showed up, but the checkmark didn't show stating that processing has finished. I'm wondering if something is killing the channel that this information comes down.


Counting seconds from start of upload to checkmark
1.3 - good
2.2 - good 20 seconds
4.0 - upload appears to have finished, but processing didn't 40+ seconds, image did show up, but the checkmark didn't show up in the uploader
5.2 - upload appears to have finished, but processing didn't 40+ seconds, image did show up, but the checkmark didn't show up in the uploader
6.6 - upload stopped at 26 seconds
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/8c5adc3d861c356020129e6421e35fb3c2aa4e73.camel%40mtu.net.

Jon Schewe

unread,
Oct 13, 2020, 10:08:22 PM10/13/20
to gallery...@googlegroups.com
I'm looking into this again and noticed the following in the javascript console:

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/

I'm wondering if the browser is killing the upload because it's running on the main thread?

Jon Schewe

unread,
Oct 14, 2020, 8:48:05 PM10/14/20
to gallery...@googlegroups.com
I did some testing with a simple form based upload and the files upload just fine, no errors on the server side. I expect it's related to this browser warning about XMLHttpRequest on the main thread. 


Here's the form:

<!DOCTYPE html>
<html>
<body>

<form action="upload.php" method="post" enctype="multipart/form-data">
    Select image to upload:
    <input type="file" name="fileToUpload" id="fileToUpload">
    <input type="submit" value="Upload Image" name="submit">
</form>

</body>
</html>

Here's the PHP to save the file:

<?php
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);

move_uploaded_file( $_FILES["fileToUpload"]["tmp_name"], $target_file );

echo "upload complete";

?>

Jon Schewe

unread,
Oct 14, 2020, 9:19:22 PM10/14/20
to gallery...@googlegroups.com
I found this simple form based upload module and it allows me to upload large files. Granted the form only allows 3 images at once, but it doesn't get killed by the browser like the default upload module does.

Sean Ster

unread,
Oct 18, 2022, 12:21:42 AM10/18/22
to Gallery 3 Users
Hi. My new phone takes huge photos and I got really fed up with the uploader timing out. If a photo or video takes longer than 30 seconds the transfer is cancelled.
I tested Opera, Chrome, and Firefox.

As previously discussed here about 2 yrs ago, it was due to a deprecated technique using XMLHttpRequest. I see this message in the network inspector on every failed file.

I dug into the code and noticed that it's using a utility called "dropzone" that was dated 2012. Luckily it is actively maintained so I simply dropped in the new versions of the js & css files.

I made one other tiny change in form_dropzone.html.php

The default for maxThumbnailFilesize is 10 mb so it didn't want to show thumbnails on the upload form. I added that parameter and set it to maxFilesize.

Seems to be working fine now. I tested a few uploads that took well over a minute with no trouble.

Jon Schewe

unread,
Oct 18, 2022, 7:33:20 AM10/18/22
to gallery...@googlegroups.com
Can you put in a pull request to get this into the main distribution?

I tried making the change and using the uploader gave me a javascript error (see below).

The steps that I took were:
  1. cd gallery/lib
  2. mv dropzone.css dropzone.css.orig
  3. mv dropzone.js dropzone.js.orig
  4. curl -O https://unpkg.com/dropzone@5/dist/min/dropzone.min.js
  5. mv dropzone.min.js dropzone.js
  6. curl -O https://unpkg.com/dropzone@5/dist/min/dropzone.min.css
  7. mv dropzone.min.css dropzone.js
  8. cd ../modules/gallery/views
  9. cp form_dropzone.html.php form_dropzone.html.php.orig
  10. Change the call to Dropzone to 
Dropzone.options.gAddPhotosForm = {
init: function() {
this.on("success", function(file) {
setTimeout(function() {
myDropzone.removeFile(file);
}, 5000);
});
},
dictDefaultMessage: 'Drop files here or click to upload',
previewTemplate: document.querySelector('#imageStatusTemplate').innerHTML,
paramName: "Filedata", // The name that will be used to transfer the file
parallelUploads: <?= $simultaneous_upload_limit ?>,
acceptedFiles: "<?= implode(",", $extensions) ?>",
maxFilesize: <?= $size_limit_megs ?>,
maxThumbnailFilesize: <?= $size_limit_megs ?>
};

Did I do something different than what you did?


Uncaught SyntaxError: unexpected token: identifier
9527e5254ca9865a458466616b327fe3.js:1:19
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Sean Ster

unread,
Oct 18, 2022, 12:13:30 PM10/18/22
to Gallery 3 Users
Hi. Yep the steps you outlined generally look fine to me as that's more or less what I did. 

I use wget instead of curl. This line produces a garbage file only 62 bytes:
curl -O https://unpkg.com/dropzone@5/dist/min/dropzone.min.js

That's probably the cause of your javascript syntax error. Likely the same for css.

Unfortunately I didn't know about the github repository last night. Now that I do I will create issues there. 

My installation is not up to date with the git and it has a bunch of hacks for responsive template. I'll have to take some time to merge by hand. 

On Tuesday, October 18, 2022 at 7:33:20 a.m. UTC-4 Jon Schewe wrote:
Can you put in a pull request to get this into the main distribution?

I tried making the change and using the uploader gave me a javascript error (see below).
...

Jon Schewe

unread,
Oct 18, 2022, 9:25:12 PM10/18/22
to gallery...@googlegroups.com
Yep, that's a garbage file, need I forgot to add "-L" to the command, that follows redirects. Anyway, got the right sized file and it looks like it has reasonable content. However I still have the same error. I see that this is in some file that appears to be a single combined file from all of the files in the lib directory. However I don't see the dropzone files referenced there.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Sean Ster

unread,
Oct 18, 2022, 9:46:34 PM10/18/22
to Gallery 3 Users
so close! the server will on the fly combine all js and css into a single download for faster page loads. it is a client issue, try one of these

shift -key & refresh / clear cache / diff browser

Jon Schewe

unread,
Oct 18, 2022, 10:01:17 PM10/18/22
to gallery...@googlegroups.com
I had done the shift+refresh and that didn't work. I tried chromium instead of firefox and that worked. I did need to clear the firefox cache to get it to work. Restarting didn't do it.

On Tue, 2022-10-18 at 18:46 -0700, Sean Ster wrote:
so close! the server will on the fly combine all js and css into a single download for faster page loads. it is a client issue, try one of these

shift -key & refresh / clear cache / diff browser

--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages