Does server_add work in 3.1.3 on Nginx?

62 views
Skip to first unread message

Stian Lund

unread,
Mar 23, 2021, 2:13:15 PM3/23/21
to Gallery 3 Users
Now that I have the Gallery up and running again on Nginx, I'm trying the server_add module and it can't seem to find the local files.

It's been a long while since I've tried the module, so I can't fully remember how it was supposed to work. I've added the full path in the admin setting.

When I trigger the server_add dialog it makes an XHR request to:
gallery/index.php/server_add/browse/1763
Where 1763 I assume is the current album ID.

This page contains some JS:
var GET_CHILDREN_URL = "/gallery/index.php/server_add/children?path=__PATH__";
var START_URL = "/gallery/index.php/server_add/start?item_id=1763&csrf=<code>";

When trying the GET_CHILDREN_URL replacing __PATH__ with the full path to the upload dir I get a page containing the files correct files.

Trying the START_URL I get a JSON:
{"result":"started","status":"","url":"\/gallery\/index.php\/server_add\/run\/53?csrf=<code>"}
Which in turn leads to:
{"done":false,"status":"Starting up","percent_complete":"0.000000"}

Any ideas what goes on? Is it meant to work in 3.1.3 and do I have to make some Nginx config changes for it to work?

regards,
Stian


JR

unread,
Mar 23, 2021, 6:56:43 PM3/23/21
to gallery...@googlegroups.com

Stan,

I do know that some people have successfully used server_add with version 3.1.3 -- but I don't know if any of them were trying to do it running on Nginx.

Of course, Gallery 3 was designed specifically to run on Apache servers. There is even a disclaimer on the old forum under the "Unsupported Servers" category that starts off with "Gallery 3 is not supported to run with Windows, Postgres, Nginx, etc." So it's pretty cool you've managed to get it to mostly-work. It's been a long time since I used the module but I found server_add tricky to get working even under Apache. and I had to play around with it for days to get it working for me. I suppose you've already poured over the info about server_add here:

http://codex.galleryproject.org/Gallery3:Modules:serveradd.html

and here:

https://github.com/gallery/gallery3/search?q=server_add

The old forum pages are a wealth of information, but unfortunately there no longer seems to be any way to search them, so one has to rely on the brief headings displayed with each topic post -- but I remember from back when the forum was still active somewhere in there there is a long support thread on server_add:

http://galleryproject.org/forum.html

-- 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/acac4d29-d526-4124-b3b9-53d330567717n%40googlegroups.com.

Stian Lund

unread,
Mar 24, 2021, 5:21:21 AM3/24/21
to Gallery 3 Users
Hello J.R. and thanks for the informative reply :)

Thanks for reminding me of the Codex, I've had a look over it and it did give a couple of helpful pointers but nothing really that could solve this issue.

I do remember that I had issues with it before on Apache, for instance I think the need to *double-click* the folder for the files to show was something I struggled with before, as double-clicking is not a common thing for web-applications.

The Codex page also states that "You can't upload directly to/from the gallery3/var/ directory or any sub-directory of it." But I do think that's what I used to do, i.e. I used "var/uploads" and that's what was saved in the server_add configuration. Of course, I've tried to add different directories now to see if any of them work.

The thing is, I kind of suspect that this is a case of the actual *client-side dialog* not working, and maybe not a server-side  error. The dialog seems to use a combination of JS and PHP and maybe it just doesn't work in modern browsers. I've tried to look in the Devtools console to see if any JS errors might be relevant. It just seems that the double-click function just won't trigger.

Unfortunately the forum thread linked at the bottom of the Codex page (http://galleryproject.org/node/96806#comment-351255) seems to give a 404, and like you say the search is non-functional...

It would be great to hear from someone using server_add on their install, even under Apache to know if it's supposed to work at all these days.

All the best, 
Stian

JR

unread,
Mar 24, 2021, 5:15:38 PM3/24/21
to gallery...@googlegroups.com

Stian,

There is some kind of weird URL trap at the front page of the codex forums. I finally figured out a way to access them, but your initial url must include one of the valid page numbers already existing inside the forum archive. That will get you into the specific page of the archived forum and then you can click the arrow near the top of that page to go the actual first "Home Page" -- look for where it says "Home  >>  Forums" but only click on the word "Forums" -- if you click on the word "Home" it doesn't work. This behavior is probably why there is no longer a search function working there anymore. This exact URL I have manually typed out below should work -- but it probably has to be entered manually in the URL field of your browser, rather than clicked from inside this email:

http://galleryproject.org/forum/96 

This trick works in Firefox under Win 7 and also Firefox on my Linux Mint 20 laptop. At least it does for now. I note there is no "https" in the above URL, which is going to cause some browsers to trip up.

Hey... I just tried manually entering the above url into the Duck Duck Go search window and the first result that popped up is a clickable link that will get you into the forum archive page, but nothing on that page is clickable -- you have to go up to the top of the page and click on the word "Forums" to get to the Home page, where all the links there are working. But when I tried the same trick with a direct google search, but Google did not return a result for the archive.

-- J.R.

On 03/24/21 5:21 AM, Stian Lund wrote:
Hello J.R. and thanks for the informative reply :)

Thanks for reminding me of the Codex, I've had a look over it and it did give a couple of helpful pointers but nothing really that could solve this issue.

I do remember that I had issues with it before on Apache, for instance I think the need to *double-click* the folder for the files to show was something I struggled with beforeis not a common thing for web-applications.

The Codex page also states that "You can't upload directly to/from the gallery3/var/ directory or any sub-directory of it." But I do think that's what I used to do, i.e. I used "var/uploads" and that's what was saved in the server_add configuration. Of course, I've tried to add different directories now to see if any of them work.

The thing is, I kind of suspect that this is a case of the actual *client-side dialog* not working, and maybe not a server-side  error. The dialog seems to use a combination of JS and PHP and maybe it just doesn't work in modern browsers. I've tried to look in the Devtools console to see if any JS errors might be relevant. It just seems that the double-click function just won't trigger.

Unfortunately the forum thread linked at the bottom of the Codex page (http://galleryproject.org/node/96806#comment-351255) seems to give a 404, and like you say the search is non-functional...

It would be great to hear from someone using server_add on their install, even under Apache to know if it's supposed to work at all these days.

All the best, 
Stian

--
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.

Stian Lund

unread,
Mar 24, 2021, 6:29:36 PM3/24/21
to Gallery 3 Users
Hey JR, again thanks for the input :)

I found the thread referred to, good ol' Internet Archive to the rescue!

Unfortunately I don't think that solution would work for me as I don't think that's the issue, but I will try. 

However, it did give a tip to enable debugging logs so I will see if that helps.

cheers,
Stian


Brad Dutton

unread,
Mar 24, 2021, 10:30:59 PM3/24/21
to Gallery 3 Users
It's just a point of reference but on my test site with nginx the server add module works without issue.

Stian Lund

unread,
Mar 25, 2021, 8:13:28 AM3/25/21
to Gallery 3 Users
On Thursday, 25 March 2021 at 03:30:59 UTC+1 Brad Dutton wrote:
It's just a point of reference but on my test site with nginx the server add module works without issue.

Thank you Brad, that helped me knowing that it should still work. I did some investigating, installed a clean gallery test and it worked there. So I figured it was likely a module conflict, so did the job of disabling all non-standard modules and enabling one by one. Apparently the "BatchTag" module was the culprit... so now I feel kind of silly for not having done that from the start, it should be basic Troubleshooting 101 :P

I think the problem is both modules use Jquery.start() for autocompletion. But I don't see much use for autocompletion in BatchTag, and as far as I can see, autocomplete isn't even used for the server_add album dialog (only in admin). I might try changing BatchTag and removing the offending code, or I could just leave it disabled and enable when I (very rarely) need it.

Thanks for the help and your work on Gallery Revival! :)

cheers!
Stian
 

JR

unread,
Mar 25, 2021, 2:28:48 PM3/25/21
to gallery...@googlegroups.com

Stian,

Huh. I did not know you could do such a specific search on the Wayback Machine. Cool. When working with software that has not had a core update in over 7 years, for many issues we can only do this kind of deep internet detective work. Also, since this thread you discovered dates from 2010 to 2011 we can see that server_add has been a tricky module even back then. I do know that some people have had success using server_add with the latest version 3.1.3 -- but who knows what type of server configuration they had?

I'm hoping someone who has made server_add work with 3.1.3 will let us know if they had to tweak or if it worked for them "right out of the box".

But here's a possible alternative. On many servers, such as my A2hosting web hosting account, the CPanel has been updated with an "upload" function where you can navigate to a specific directory folder using the Cpanel "file manager" and from there execute the "upload" function and your server will upload the files you select into that location and, unlike the bad old days, this "in house" upload function works fairly quickly. Given all the time you're spending trying to get server_add to work, if your server has that option it might be the way to go.

-- 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.

JR

unread,
Mar 26, 2021, 5:47:53 PM3/26/21
to gallery...@googlegroups.com

Stian,

Happy to hear you finally tracked down the problem. This kind of thing happens all the time and all you can do is look on the bright side: Even though you spent a lot of time on this, you now know more than you ever wanted to know about configuring server_add, nginx, and troubleshooting logs for gallery. Like they say, "it's always the last thing you try..." and, of course, that's because if it works you don't have to try anything else :)

--
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.

Stian Lund

unread,
Mar 27, 2021, 11:21:11 AM3/27/21
to Gallery 3 Users
Hey JR, thanks for that positive note :)

Yes, I'm very happy it's working again, at least in a "reasonable" way. I did know quite a bit lot about its internal workings 10-15 years ago. I'd forgotten most of it, but it's coming back again :)

If not for the work of Gallery Revival (thanks guys!) I would have seriously considered moving to something like Piwigo, Zenphoto or even (ugh) Coppermine. Maybe one day when it completely breaks and is no-one is updating it I might do so, but I know there will be a lot of time spent configuring any new software how I like it, and at the moment I can't be bothered with that. But still happy to dive into Gallery PHP code, understand it if you will ;)

all the best,
Stian

JR

unread,
Mar 28, 2021, 11:35:02 AM3/28/21
to gallery...@googlegroups.com

Stian,

I gave Zenphoto and Piwigo a good test run about 6 years ago, when it became apparent that the original gallery development team was serious about not doing anything more with Gallery 3. I was very disappointed and frustrated with both alternatives and so stayed with Gallery -- like you and so many others I am glad I did. And I am more than grateful that Brad Dutton decided to take it upon himself to yank Gallery into the modern world of PHP 7 and cut out the festering sore that was the old Flash-based image uploader. I also deeply appreciate those people with the technical expertise, like yourself, who are assisting in what must inevitably be an on-going process.

-- 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.
Reply all
Reply to author
Forward
0 new messages