• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

LrHttp.postMultipart Bug (attempt to perform arithmetic on field 'fileSize)

Community Beginner ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Hello,

When I add the code (mimeChunks[ #mimeChunks + 1 ] = { name = '0', fileName = filename , filePath = filepath  }) for LrHttp.postMultipart , 

Lightroom throws  "?:0: attempt to perform arithmetic on field 'fileSize' (a nil value)" error.

I cannot make a post multipart request.

Is there any idea or clue?

Thanks in advance..

TOPICS
SDK

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 20, 2018 Nov 20, 2018

You could enable LR stack tracebacks and perhaps see where in LR that error is originating from: Lightroom -traceback debugging tip

Votes

Translate

Translate
LEGEND ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Just a guess: Perhaps the file "filepath" isn't readable. You could verify it's readable by doing LrFileUtils.isReadable (filepath) and LrFileUtils.fileAttributes (filepath).  Note the latter returns a table with key "fileSize", and that key will be nil if the file doesn't exist or isn't accessible.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Hi johnrellis

Thanks for your answer.

LrFileUtils.isReadable (filepath)  = true

and I can read the fileAttributes without any issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

You could enable LR stack tracebacks and perhaps see where in LR that error is originating from: Lightroom -traceback debugging tip

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

johnrellis

Thank you so much for your prompt reply. I've got the traceback logs.

It seems like the bug is coming from the Adobe Side. Do I have a chance to do anything?

The log :

2018-11-21 09:09:05.144 Adobe Lightroom Classic[16249:2625307]

?:0: attempt to perform arithmetic on field 'fileSize' (a nil value)

    0:          [unnamed]                      - 1611948003:953+150

    1:          [unnamed]                      - tail

    2: upvalue  ?                              - TestApi.lua:458

    3:          [unnamed]                      - 2144215698:63+9

    4:          [unnamed]                      - 179812414:2279+12

---------------------------------

2018-11-21 09:09:05.144 Adobe Lightroom Classic[16249:2625307] Oops! An untagged string (?:0: attempt to perform arithmetic on field 'fileSize' (a nil value)) got thrown far enough that we display it to the user. This shouldn't happen.

sessionReadyCallback: 3

<140735765160832> <DynamicLink> <5> Attempting to launch dynamiclinkmanager

<140735765160832> <DynamicLink> <5> /Applications/Adobe Lightroom Classic CC/Adobe Lightroom Classic CC.app/Contents/Helpers/DynamicLinkSupport/support/common/dynamiclink/dynamiclinkmanager.app

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

I'm guessing that somewhere in the call to LrHttp.postMultipart(), it's trying to get the size of the file provided by "filePath", by calling LrFileUtils.fileAttributes(), which returns the empty table (which is only supposed to happen when it can't access the file).  But that's just a guess.  I don't know why fileAttributes() would return the empty table if the file exists and is readable. 

I don't have any other suggestions at this point...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

LATEST

johnrellis

Thanks for your great support. I  have created my export code from scratch and it works properly now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines