Announcement

#1 2019-04-20 16:39:27

bentterp
Member
2019-04-20
3

Upload HTTP Error

Hello/Hi/Greetings,

Just installed Piwigo and trying out before migrating from my obsolete Menalto Gallery

When I try and upload a handful of files, it seems to stall for a long time (more than a minute) after each file and I get a yellow warning triangle ("HTTP Error") but the image appears fine and viewing/resizing works as expected.

How do I obtain some more information about the problem?

Piwigo version: 2.9.5
PHP version: 7.3.4 (php-fpm)
MySQL version: 5.5.5-10.1.38-MariaDB
Piwigo URL: http://piwigo.htv7.net

Offline

 

#2 2019-04-20 19:15:38

flop25
Piwigo Team
2006-07-06
7037

Re: Upload HTTP Error

Hello
when uploading open the developer console of your web browser ( F12 ) and got to the Network tab: check what kind of htpp error it is. OR check the server log
I bet those are 500 errors due to a server with very low resources or intentionally limited (like on shared hosting)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2019-04-21 07:46:05

bentterp
Member
2019-04-20
3

Re: Upload HTTP Error

Hi and thanks for taking an interest

Yes I do get a 504 Gateway Timeout from NginX, but by that time the image has been available for a long time in the album, it only takes a couple of seconds before I can see the image in the album list.

I don't get any errors from PHP-FPM or anywhere which is a bit annoying.

Offline

 

#4 2019-04-21 09:42:14

bentterp
Member
2019-04-20
3

Re: Upload HTTP Error

I use the same FPM pool for running Grav and experience no issues when uploading images there.
Can it be something with the progress bar? It stays whirling forever after the upload has finished also
It's like it doesn't get the "ok done, next job please" signal from the "POST /ws.php"

NginX access log:
192.168.64.50 - - [21/Apr/2019:09:37:14 +0200] "POST /ws.php?method=pwg.images.upload&format=json HTTP/1.1" 200 38 "http://piwigo.htv7.net/admin.php?page=photos_add" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36" "-"
192.168.64.50 - - [21/Apr/2019:09:38:14 +0200] "POST /ws.php?method=pwg.images.upload&format=json HTTP/1.1" 504 537 "http://piwigo.htv7.net/admin.php?page=photos_add" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36" "-"

NginX error log:
2019/04/21 09:37:14 [warn] 677#677: *1119 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000015, client: 192.168.64.50, server: piwigo.htv7.net, request: "POST /ws.php?method=pwg.images.upload&format=json HTTP/1.1", host: "piwigo.htv7.net", referrer: "http://piwigo.htv7.net/admin.php?page=photos_add"
2019/04/21 09:37:14 [warn] 677#677: *1119 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000016, client: 192.168.64.50, server: piwigo.htv7.net, request: "POST /ws.php?method=pwg.images.upload&format=json HTTP/1.1", host: "piwigo.htv7.net", referrer: "http://piwigo.htv7.net/admin.php?page=photos_add"
2019/04/21 09:38:14 [error] 677#677: *1119 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.64.50, server: piwigo.htv7.net, request: "POST /ws.php?method=pwg.images.upload&format=json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9003", host: "piwigo.htv7.net", referrer: "http://piwigo.htv7.net/admin.php?page=photos_add"

FPM access log:
127.0.0.1 -  21/Apr/2019:09:37:14 +0200 "POST /ws.php" 200
127.0.0.1 -  21/Apr/2019:09:37:14 +0200 "POST /ws.php" 200


FPM error log:
[21-Apr-2019 09:37:14.030856] DEBUG: pid 1845, fpm_pctl_perform_idle_server_maintenance(), line 377: [pool www] currently 0 active children, 4 spare children, 4 running children. Spawning rate 1
[21-Apr-2019 09:37:14.923047] DEBUG: pid 1845, fpm_event_loop(), line 417: event module triggered 1 events
[21-Apr-2019 09:37:15.031196] DEBUG: pid 1845, fpm_pctl_perform_idle_server_maintenance(), line 377: [pool www] currently 1 active children, 3 spare children, 4 running children. Spawning rate 1

Offline

 

#5 2019-04-25 10:34:27

Foto
Member
2019-04-22
11

Re: Upload HTTP Error

Me too 504 gateway time out while sync galleries.

Php-fpm:

2019/04/25 16:14:11 [error] 4249#101786: *2431 upstream timed out (60: Operation timed out) while reading response header from upstream, client: 192.168.0.10, server: pi                                                                            wigo, request: "POST /admin.php?page=site_update&site=1 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php72-fpm.sock", host: "192.168.0.116", referrer: "http://192.168.0                                                                            .116/admin.php?page=site_update&site=1"

Nginx:

[25-Apr-2019 09:13:24] NOTICE: ready to handle connections
[25-Apr-2019 10:22:13] WARNING: [pool www] child 4243 exited with code 124 after 4129.460511 seconds from start

Offline

 

#6 2020-08-22 11:18:35

biini
Member
2020-08-22
2

Re: Upload HTTP Error

Hi,

did you guys found a fix for this?
Facing the same issue, fresh install of 2.10.2 ; Photos get uploaded, but very slooooowly, I get 504 on F12 network status.

Cant see any warnings on firewall and dont really know how to troubleshoot this

Last edited by biini (2020-08-22 11:27:22)

Offline

 

#7 2020-08-22 12:17:51

erAck
Only trying to help
2015-09-06
2031

Re: Upload HTTP Error

There can be no fix on the Piwigo side because a 504 gateway error is not a Piwigo problem. It's a communication timeout failure between computers, either on the hoster's end, for example between the web server and a proxy (likely), or even your local network if it's using some proxy or bad router settings (unlikely). Ask your hosting provider if the problem persists.


Running Piwigo at https://erack.net/gallery/

Offline

 

#8 2020-08-24 17:51:37

biini
Member
2020-08-22
2

Re: Upload HTTP Error

Hi,

Thank you for your reply.
I had a friend of mine to take a look at this.
The solution (or workaraound) was to comment line 401

fetchRemote($derivative_url, $dest);

in admin/include/functions_upload.inc.php

web-upload is now blazing fast.

Offline

 

#9 2020-08-24 21:34:08

erAck
Only trying to help
2015-09-06
2031

Re: Upload HTTP Error

Ugly workaround curing only a symptom. You'll probably encounter a similar problem just later. Rather check why accessing $derivative_url in fetchRemote() (as $src there) is a problem.


Running Piwigo at https://erack.net/gallery/

Offline

 

#10 2022-01-03 22:46:02

jameswyper
Member
2021-12-28
4

Re: Upload HTTP Error

I had this issue after I put my installation behind an nginx reverse proxy.  Looking at the code for  functions_url.inc.php it appears that it will set the correct base URL to X-Forwarded-Host if that header is set.  So adding this line in my nginx config:

       proxy_set_header        X-Forwarded-Host $proxy_add_x_forwarded_for;

in the section where the proxy is configured appears to have fixed it.

Offline

 

#11 2022-01-03 23:13:22

jameswyper
Member
2021-12-28
4

Re: Upload HTTP Error

Actually that hasn't fixed it.  It's broken generating multiple size images in the batch manager.  I'll keep investigating.

Offline

 

#12 2022-01-03 23:51:40

jameswyper
Member
2021-12-28
4

Re: Upload HTTP Error

Okay, there are two things that need to be set, at least in my config, where the proxy nginx is configured to use SSL (and redirect plain http) and piwigo itself is hosted on a different nginx server on port 8081.

Firstly the correct proxy_set_header is

     proxy_set_header        X-Forwarded-Host $host;


(this needs to go in the nginx that's acting as the proxy)

Secondly the piwigo nginx server needs to *think* that it's running with HTTPS so that $_SERVER[HTTPS] will be set.  To do this I added a line to the set of fastcgi parameters of the nginx server running piwigo:

     fastcgi_param  HTTPS 'on';

I really do think it's working now.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact