Debugging with REST API (Lightroom Plugin)

24 views
Skip to first unread message

Lord Beowulf

unread,
Jan 2, 2026, 8:54:12 AM (10 days ago) Jan 2
to Gallery 3 Users
Hi All, 

Since the AlloyPhoto website has been down for some time and my new camera just forced me to finally migrate to a newer version of Lightroom, I've been reworking that plug-in to get it working again.  I have everything I've tested working locally now (after wasting lots of times debugging stuff that didn't matter) and it's logging into the server fine, but at the end of the day, it's failing uploads.  I'm not sure if that's a bug on the plug-in side or the website/server side.  My server is painfully slow to begin with and even uploads with the dialog or server add have problems, but I can eventually get things uploaded manually as long as I do a few at a time.  From the plug-in, logs show that it starts the uploads and everything seems fine, but eventually it comes back and logs that the upload failed.  Looking at the PHP log in G3 vars doesn't show anything related to the upload attempts.  Is there a way to turn on some logging in G3 that would let me see what's going on server side without having to rewrite a bunch of PHP?  

Thanks,

Beo

Adrian London

unread,
Jan 2, 2026, 10:46:09 AM (10 days ago) Jan 2
to Gallery 3 Users
There is an option to enable more logging in G3, but it doesn't do much.  In fact, I don't even think the parameter is being set in the right place.  

You could still try though:  application/config/config.php and look for "Log thresholds".

I've removed all that from the config.php file and put it in modules/gallery/config/log_file.php where it seems to work.  However, it still relies on G3's own error messaging, which is very sparse.

Could it be a memory issue?  I have no parameters set any more in .user.ini (was php.ini) but I think G3 added some by default which I've since taken out.

If it's an Apache error then I've no idea where those logs go, as I'm on a hosted environment and have (so far) never needed to look at them.

Usually, I debug G3 code by adding text to the logs by sprinkling lots of Kohana_Log::add("error", "TEXT HERE") in the relevant G3 php file(s).

-- 
Adrian





Lord Beowulf

unread,
Jan 2, 2026, 11:46:55 AM (10 days ago) Jan 2
to Gallery 3 Users
Thanks Adrian,

Yeah, that's been my approach as well, at least for stuff I've written, but I was hoping to not have to reverse engineer/modify the REST API or anything else.  AlloyPhoto has a Lightroom Helper plug-in that I scanned through, but I don't think that's the culprit.  It only adds a few functions like the option to select a file as the album cover, etc.  I'm pretty sure the upload is using existing mechanisms.  It's bad enough having to decompile and then fix the various broken lua modules on the Lightroom side, but looks like I'll probably have to do some of the same in Gallery just to figure out what's happening.  I'll look for the various logging level flags (that was where I planned to start anyway) and see what I get.

Thanks,

Beo

Adrian London

unread,
Jan 2, 2026, 12:19:01 PM (10 days ago) Jan 2
to Gallery 3 Users
I have no further advice, as my photography equipment has dropped over the years from a 35mm SLR to a dSLR to a decent point & shoot to an iPhone.  I've never used an external processing tools for my photos - well, since MacOS Aperture was abandoned.

I've never tried to use an API to connect to my G3 installation.  However, if it connects and then just aborts, checking for timeouts and memory outs seem the quickest things to eliminate.

-- 
Adrian


Lord Beowulf

unread,
Jan 2, 2026, 7:46:33 PM (9 days ago) Jan 2
to Gallery 3 Users

Well, I have things working.  I turned on the debug logging in config.php, but didn't get anything different in the PHP log file.  Not sure if there was something needed to get that to refresh, but at this point, I just added a bunch more debug statements in my decompiled lua code and found that it was never actually calling the function to initiate the upload.  The odd thing was, the point where it was failing seemed like a bug in the fallback condition if certain flags weren't set right.  It doesn't look like one of the many decompiler induced bugs I was chasing, since the logic flow was the same in the unluac code, which just decompiles at the byte code operand level, as in the luadec code I'm using that attempts to reconstruct the original syntax.  The latter has major problems with the big tables that make up the GUI, so I've spent days fixing code, but this wasn't one of those cases.  Presumably, one of the flags in the environment is different than before, as looking at the code, I don't believe it could have ever worked under the conditions being passed to the function.  Ah well.  I'm sure I'll have more work to do, but I'm again able to upload to my gallery.  Thanks for the help.

Beo 

Info.RockEdge

unread,
Jan 4, 2026, 4:11:18 PM (8 days ago) Jan 4
to gallery...@googlegroups.com

There are two older WordPress plugins that used the G3 REST API and worked fairly well. Perhaps looking at how those interfaced might help

--
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 visit https://groups.google.com/d/msgid/gallery-3-users/6c7f92b2-cfa2-474f-96bb-e6f8ca70bd0cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages