flingo64 / PhotoStation-Upload-Lr-Plugin

Photo StatLr (aka PhotoStation Upload) is a Lightroom Publish and Export Service Plugin that enables the export /publishing of photos and videos from Lr to a Synology Photo Station. It uploads the photos/videos and all required thumbnails. It can download comments and ratings and do a real two-way synch of various metadata (tags, ratings, labels).
http://messmer-online.de/index.php/software/11-photo-statlr
GNU General Public License v3.0
209 stars 21 forks source link

listfunction('/2021') returned <nil> - could not get folderId, returns <nil> #57

Closed kibuan closed 2 years ago

kibuan commented 2 years ago

I just upgraded to version 7.2 yesterday since I upgraded to Synology Photos from Photostation a couple of weeks ago. The upgrade was successful. I have + 20.000 photos published, and I ran a successful CheckExisting publish on all albums after the upgrade. I also published several thousands of new photos after the upgrade to several albums (existing and new albums).

In some of my "Published Smart collections" I have a number of photos I just cant publish, and I have spend several hours trying to solve the issue, but I just can't find the cause.

All my Published Smart collections use {Date %Y} as "Target Album". The photos that won't publish are clean untouched photos from my DLSR.

When I publish with mode: "CheckExisting" I get these errors:

14:35:29, INFO : Environment: plugin: 7.2.0.20220131 Lr: 8.0 OS: Windows 10 Lang: en
14:35:29, INFO : processRenderedPhotos starting
14:35:30, INFO : Login to Shared Space(http://myserver:5000) OK
14:35:30, INFO : processRenderedPhotos(mode: Publish).
14:35:30, INFO : --------------------------------------------------------------------
14:35:30, INFO : exiftool Listener(""C:\exiftool\exiftool.exe" -config "C:\PhotoStation_upload.lrplugin\PSExiftool.conf" -stay_open True -@ "C:\Users\Bruger\AppData\Local\Temp\ExiftoolCmds-666365730.04828.txt"  -common_args -charset filename=UTF8 -overwrite_original -fast2 -m > "C:\Users\Bruger\AppData\Local\Temp\ExiftoolCmds-666365730.04828.log" 2> "C:\Users\Bruger\AppData\Local\Temp\ExiftoolCmds-666365730.04828.error.log""): starting ...
14:35:43, ERROR: Photos_listAlbumItems('/2021') could not get folderId, returns <nil>
 is not a table, but nil
14:35:43, ERROR: getPhotoId(userid:0, path:'/2021\DSC_7267.jpg') listFunction('/2021') returned <nil>
14:35:43, ERROR: Upload of 'B:\2021\Katalogiserede\2021\03\DSC_7267.NEF' to '2021\DSC_7267.jpg' failed!!!
14:35:52, ERROR: Photos_listAlbumItems('/2021') could not get folderId, returns <nil>
 is not a table, but nil

When I publish with Mode: "Upload" and "Create Album, if needed" checked it fails with: "Target album creation failed" but no error shows in the error log (didn't spot any in debug mode either). I have tried to create the "/2021" folder on my "photos" volume and have tried removing it to let the plugin create it.

kibuan commented 2 years ago

I just did a little more testing. I seems like I can only publish to existing/migrated Target albums (Synology Photos root folders). The reported error occurs when ever I try to publish to a new album (root folder), and It doesn't madder if I create the album/folder in Synology Photos before I publish. I have no issues publishing to new subfolders in existing Albums.

flingo64 commented 2 years ago

I couldn't find a general issue here with creating folders in root dir both in Personal and Shared Area. Most likely, it's an issue of permissions of the account used by Photo StatLr. I would need a logfile w/ loglevel Debug to be more specific.

kibuan commented 2 years ago

I have attached a link to a log from a test run with Debug enabled: https://pastebin.com/FyyCBiNX

flingo64 commented 2 years ago

Look at line 281-283:

18:27:40, DEBUG: Photos_API: LrHttp.post(url='http://my-server:5000/webapi/entry.cgi', API=SYNO.FotoTeam.Browse.Folder params='version=1&api=SYNO.FotoTeam.Browse.Folder&name="2021"&target_id=1&method=create')
18:27:40, DEBUG: Got Body:
{"error":{"code":803},"success":false}

This is exactly the error code, that I get when using an account with no permission to create a folder in the root folder of the shared area. Just try to do the same in the Photos with your user 'PhotoUploader', I bet you won't even see the 'Add folder' button.

kibuan commented 2 years ago

Thank you for your answer. Sorry that I reported this as an error. You are probably right that wrong permissions on my Synology is causing the issue. I'm just very confused about the permissions on my Synology. I know this is out of scope, but maybe you can lead me in the right direction solving the issue?

The user I have for the plug-in is "PhotoUploader" and that user has read/write permissions to the entire Photos share (checked the read/write column on the Persmissions tab on the user in GUI).

When I check the folders and files in the /Photo folder they are a mix of: drwxrwxrwx 1 SynologyPhotos SynologyPhotos drwxrwxrwx 1 PhotoStation PhotoStation -rwxr-xr-x 1 PhotoUploader users

Permissions on photo folder it self: drwxrwxrwx 1 root root 246 Feb 12 19:35 photo

The /photo folder on my NAS is not "Windows ACL type". Should it be that?

flingo64 commented 2 years ago

Permissions for Photos are defined in Photos itself, not on the OS / Filesystem level. Login to Photos as admin and then click the avatar in the top right corner --> Settings --> Shared Space --> Set Access Permissions

kibuan commented 2 years ago

I feel so stupid, but thank you very much for your assistance! Problem solved. I have no idea why my upload user didn't have the correct permissions. I have been using this plug-in for years and have not changed the permissions since first install (as far as I can remember). Also thank you for your time and effort maintaining this great plug-in!