Lightroom SDK: LrTasks.pcall fails when called from an LrExportServiceProvider script or observer function

  • 2
  • Problem
  • Updated 2 years ago
  • In Progress
  • (Edited)
The following expression fails when called from an LrExportServiceProvider script:
LrTasks.pcall (LrFileUtils.exists, ".")
It generates the error "attempt to yield across metamethod/C-call boundary". This makes my Debugging Toolkit difficult, if not impossible, to use with an export service.  (The toolkit uses LrTasks.pcall() to catch errors, and it uses LrFileUtils.exists() to implement a more useful require().)

Tested in LR CC 2015.8 / OS X 10.11.5.

To reproduce the bug:

1. Start with a copy of  "ftp_upload.lrdevplugin" from the "Sample Plugins" folder of the Lightroom SDK 6.0.

2. Insert these lines at the top of "FTPUploadServiceProvider.lua":
local LrFileUtils = import 'LrFileUtils'local 
LrTasks = import 'LrTasks'
LrTasks.pcall (LrFileUtils.exists, ".")
3. Try to export a photo with FTP Upload. The post-processing action is never invoked.

4. Go to File > Plug-in Manager and observe that the plugin encountered an error:

5. Comment out the lines inserted in step 2 and reload the plugin in the Plug-in Manager.

6. Export a photo with FTP Upload again and observe that the post-processing action is invoked, prompting for a username and password.
Photo of John R. Ellis

John R. Ellis, Champion

  • 3903 Posts
  • 1037 Reply Likes

Posted 2 years ago

  • 2
Photo of Smit Keniya

Smit Keniya, Employee

  • 203 Posts
  • 93 Reply Likes
Official Response
Hi John,

I have logged a bug for this. Could you confirm if this worked prior to 6.8?

Smit Keniya
Adobe Lightroom Team