aws lambda : Invalid cross-device link
Copy link to clipboard
Copied
I have tried creating layer and the main code file in ec2 linux instance. Because i thought it might be due to OS dependencies, as lambda uses linux and i was using windows.
Now the code is runing but file is not being saved it shows error like,
Response
{
"errorMessage": "[Errno 18] Invalid cross-device link: '/tmp/extractSdkResult/b0ad3e245d6211eca02c3e63cbdf52ea.zip' -> '/var/task/ExtractTextInfoFromPDF.zip'",
"errorType": "OSError",
"stackTrace": [
" File \"/var/task/lambda_function.py\", line 40, in lambda_handler\n result.save_as(\"./ExtractTextInfoFromPDF.zip\")\n",
" File \"/opt/python/adobe/pdfservices/operation/internal/io/file_ref_impl.py\", line 45, in save_as\n os.rename(self._file_path, abs_path)\n"
]
}
It is not saving file.
I have tried shutil.copy() mtd instead of os.rename() in adobe library but still file is not getting saved
If you think i can use another mode instead of using this line
# Execute the operation.
result: FileRef = extract_pdf_operation.execute(execution_context)
# Save the result to the specified location.(THIS ONE)
result.save_as("./ExtractTextInfoFromPDF.zip")
Have something to add?

