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

Publishing fails on first photo if publish mode is "CheckExisting" #17

Closed svenwiegand closed 7 years ago

svenwiegand commented 7 years ago

If I set publish mode to CheckExisting and start publishing, the process fails on the first photo to be published.

The full settings: image

The full log (debug):

18:31:32, DEBUG: getDefaultCollectionSettings(Photo Station): found 2 collections and 0 collection sets
18:31:32, TRACE: getDefaultCollectionSettings(Photo Station): Found Default Collection 'Default Collection'
18:31:32, TRACE: Found Default Collection 'Default Collection' for service: Applying plugin defaults to unitialized values of Service Default Collection
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key captionDownload, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key titleDownload, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key commentsDownload, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key locationDownload, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key psVersion, orig_value 65
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key dstRoot, orig_value 
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key downloadMode, orig_value Yes
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key tagsDownload, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key srcRoot, orig_value 
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key exifXlatFaceRegions, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key copyTree, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key PS2LrLabel, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key exifXlatLabel, orig_value true
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key storeDstRoot, orig_value true
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key exifTranslate, orig_value true
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key exifXlatRating, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key sortPhotos, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key PS2LrFaces, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key hasError, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key ratingDownload, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key locationTagDownload, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key isCollection, orig_value true
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key dstFilename, orig_value 
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key publishMode, orig_value Publish
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key RAWandJPG, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key PS2LrRating, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key renameDstFile, orig_value false
18:31:32, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key createDstRoot, orig_value false
18:31:32, TRACE: Applying defaults from Service Default Collection to unitialized values of current collection
18:32:04, DEBUG: getDefaultCollectionSettings(Photo Station): found 2 collections and 0 collection sets
18:32:04, TRACE: getDefaultCollectionSettings(Photo Station): Found Default Collection 'Default Collection'
18:32:04, TRACE: Found Default Collection 'Default Collection' for service: Applying plugin defaults to unitialized values of Service Default Collection
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key captionDownload, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key titleDownload, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key commentsDownload, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key locationDownload, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key psVersion, orig_value 65
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key dstRoot, orig_value 
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key downloadMode, orig_value Yes
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key tagsDownload, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key srcRoot, orig_value 
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key exifXlatFaceRegions, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key copyTree, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key PS2LrLabel, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key exifXlatLabel, orig_value true
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key storeDstRoot, orig_value true
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key exifTranslate, orig_value true
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key exifXlatRating, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key sortPhotos, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key PS2LrFaces, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key hasError, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key ratingDownload, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key locationTagDownload, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key isCollection, orig_value true
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key dstFilename, orig_value 
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key publishMode, orig_value Publish
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key RAWandJPG, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key PS2LrRating, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key renameDstFile, orig_value false
18:32:04, DEBUG: applyDefaultsIfNeededFromTo: copying orig_key createDstRoot, orig_value false
18:32:04, TRACE: Applying defaults from Service Default Collection to unitialized values of current collection
18:32:09, TRACE: updateExportSettings: done
18:32:09, INFO : Environment: plugin: 5.10.1.20160812 Lr: 6.0 OS: Windows 8.1 Home Premium Edition Lang: de
18:32:11, INFO : processRenderedPhotos starting
18:32:11, DEBUG: openSession: operation = ProcessRenderedPhotos, publishMode = Publish
18:32:11, DEBUG: openSession: copy collection settings
18:32:11, DEBUG: getCollectionUploadPath() returns {Date %Y}/{LrFM:folderName}
18:32:11, DEBUG: PSPhotoStationAPI.initialize(serverUrl=http://janosch2, Standard PS)
18:32:11, DEBUG: callSynoAPI: LrHttp.post(http://janosch2/photo/webapi/query.php, api=SYNO.API.Info&query=all&method=query&version=1&ps_username=
18:32:11, DEBUG: Got Body:
{"success":true,"data":{"SYNO.PhotoStation.Auth":{"path":"auth.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Info":{"path":"info.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Album":{"path":"album.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Permission":{"path":"permission.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Photo":{"path":"photo.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Thumb":{"path":"thumb.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Cover":{"path":"cover.php","minVersion":1,"maxVersion":2},"SYNO.PhotoStation.SmartAlbum":{"path":"smart_album.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.File":{"path":"file.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Download":{"path":"download.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Category":{"path":"category.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.About":{"path":"about.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Tag":{"path":"tag.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.PhotoTag":{"path":"photo_tag.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Comment":{"path":"comment.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Timeline":{"path":"timeline.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Group":{"path":"group.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Rotate":{"path":"rotate.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.SlideshowMusic":{"path":"slideshow_music.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.DsmShare":{"path":"dsm_share.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.SharedAlbum":{"path":"shared_album.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.PhotoLog":{"path":"log.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Path":{"path":"path.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Watermark":{"path":"watermark.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Public":{"path":"public.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.Migration":{"path":"migration.php","minVersion":1,"maxVersion":1},"SYNO.PhotoStation.ACL":{"path":"acl.php","minVersion":1,"maxVersion":1},"SYNO.API.Info":{"path":"query.php","minVersion":1,"maxVersion":1}}}
18:32:11, DEBUG: callSynoAPI: LrHttp.post(http://janosch2/photo/webapi/auth.php,...)
18:32:12, DEBUG: Got Body:
{"success":true,"data":{"sid":"plv358i198i2622vnpdgkj8em6","username":"Sven","reg_syno_user":true,"is_admin":false,"allow_comment":true,"permission":{"browse":true,"upload":true,"manage":true},"enable_face_recog":false,"allow_public_share":true,"allow_download":true,"show_detail":true}}

18:32:12, INFO : Login to Standard Photo Station(http://janosch2) OK
18:32:12, INFO : processRenderedPhotos(mode: CheckExisting).
18:32:12, INFO : --------------------------------------------------------------------
18:32:12, TRACE: Next photo: C:\Users\kunde\AppData\Local\Temp\A21D9CFC-5E1F-4B37-A8A7-6CAEAB4885FB\0116_20080905_05166.jpg
18:32:12, TRACE:   dateTimeOriginal: 2008-09-05 10:34:17
18:32:12, TRACE: evaluatePathOrFilename: date format %Y --> 2008
18:32:12, DEBUG: mkLegalFilename: was 0116_2008-09-05 Pauline als Hase
18:32:12, DEBUG: mkLegalFilename: now 0116_2008-09-05 Pauline als Hase
18:32:12, TRACE: evaluatePathOrFilename: LrFM:folderName = 0116_2008-09-05 Pauline als Hase, pattern <Nil> --> 0116_2008-09-05 Pauline als Hase
18:32:12, DEBUG:   sanitized dstRoot: 2008/0116_2008-09-05 Pauline als Hase, dstFilename 0116_20080905_05166.jpg
18:32:12, TRACE: getPublishPath('H:\Bilder\0_negative\2008\0116_2008-09-05 Pauline als Hase\0116_20080905_05166.dng', jpg, Flat, '2008/0116_2008-09-05 Pauline als Hase')
    returns '0116_20080905_05166.jpg', '2008/0116_2008-09-05 Pauline als Hase/0116_20080905_05166.jpg'
18:32:12, TRACE: Old publishedPhotoId: '<Nil>', New publishedPhotoId: '2008/0116_2008-09-05 Pauline als Hase/0116_20080905_05166.jpg'
18:32:12, DEBUG: existsPic: dstFilename 2008/0116_2008-09-05 Pauline als Hase/0116_20080905_05166.jpg --> dstDir 2008/0116_2008-09-05 Pauline als Hase
18:32:12, DEBUG: callSynoAPI: LrHttp.post(http://janosch2/photo/webapi/album.php, api=SYNO.PhotoStation.Album&method=list&version=1&id=album_323030382f303131365f323030382d30392d3035205061756c696e6520616c732048617365&type=photo,video&offset=0&limit=-1&recursive=false&additional=album_permission,photo_exif
18:32:12, DEBUG: Got Body:
{"success":false,"error":{"code":417}}
18:32:12, ERROR: PSPhotoStationAPI.callSynoAPI: SYNO.PhotoStation.Album returns error 417
18:32:12, INFO : cacheListAlbum: Error on listAlbum: 417
18:32:12, TRACE: existsPic: Error on listAlbum: 417
18:32:12, INFO : --------------------------------------------------------------------
18:32:12, TRACE: closeSession() starting
18:32:12, TRACE: closeSession() done.
18:32:27, DEBUG: openSession: operation = GetCommentsFromPublishedCollection, publishMode = Publish
18:32:27, DEBUG: openSession: copy collection settings
18:32:27, DEBUG: getCollectionUploadPath() returns {Date %Y}/{LrFM:folderName}
18:32:27, INFO : Get comments: comments not enabled for this collection.
18:32:27, DEBUG: openSession: operation = GetRatingsFromPublishedCollection, publishMode = Publish
18:32:27, DEBUG: openSession: copy collection settings
18:32:27, DEBUG: getCollectionUploadPath() returns {Date %Y}/{LrFM:folderName}
18:32:27, INFO : Get ratings/metadata: options(title: false, caption: true, location: true, locationTag: true rating: true, tags: true, face xlat: false, label xlat: false, rating xlat: false)
18:32:27, INFO : Get ratings/metadata: Metadata download is not enabled for this collection.
flingo64 commented 7 years ago

Hey cool: Metadata placeholders in the Target Album definition! Good to see, somebody is using this feature! :-)

Error code 417. The API call

18:32:12, DEBUG: callSynoAPI: LrHttp.post(http://janosch2/photo/webapi/album.php, api=SYNO.PhotoStation.Album&method=list&version=1&id=album_323030382f303131365f323030382d30392d3035205061756c696e6520616c732048617365&type=photo,video&offset=0&limit=-1&recursive=false&additional=album_permission,photo_exif

looks good, also the coding of the album_id (it's just hex coding of the pathname). Unfortunately, the PhotoStation API is undocumented, so I cannot tell what 417 means. If it wasa return code from the FileStation API (which is very similar to the PhotoStation API), it would mean: 'Input/output error' which is at least as meaningless as 417. :-( Which version of Photo Station is it? 5, 6.0, 6.5, 6.6? I see if I can grab some infos regarding 417...

flingo64 commented 7 years ago

Gotcha! :-)

417 happens when a non-administrative user tries to read a non-existing album.

Will be fixed quite soon!

svenwiegand commented 7 years ago

Awesome Martin! Thanks for the great support and kind regards from Berlin...

flingo64 commented 7 years ago

Fixed in Version 6.0.2. Please retest!

GreetXINGs from T-S @ Berlin to B-S @ Berlin ;-)

svenwiegand commented 7 years ago

Can confirm, that it's working now. Thanks a lot!