AWS Lambda error when using start_file_transfer() method

0

"[ERROR] ParamValidationError: Parameter validation failed: Missing required parameter in input: "SendFilePaths" Unknown parameter in input: "RetrieveFilePaths", must be one of: ConnectorId, SendFilePaths Unknown parameter in input: "LocalDirectoryPath", must be one of: ConnectorId, SendFilePaths"

Above error happens when i run the start_file_transfer() method in Lambda but not when i run locally in VScode

chris
已提問 3 個月前檢視次數 567 次
3 個答案
1
已接受的答案

Solved: Ok so apparently what is going on is that my function in AWS lambda is using python 3.10 runtime which for the start_file_transfer() method only allows the 2 parameters: ConnectorId, SendFilePaths under the boto3 version in python 3.10. So the solution is to create a new function running python 3.12 which will contain the latest boto3 version.

chris
已回答 2 個月前
profile picture
專家
已審閱 2 個月前
0

Hi,
From the boto3 doc, the parameter is required:SendFilePaths
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/transfer/client/start_file_transfer.html

Request Syntax: response = client.start_file_transfer( ConnectorId='string', SendFilePaths=[ 'string', ], RetrieveFilePaths=[ 'string', ], LocalDirectoryPath='string', RemoteDirectoryPath='string' )

So you need to check the method parameter, but if it can run successfully on your local env, you need to check the boto3's version and Python version.

The Lambda runtime and boto3 versions you can refer to this doc:
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

profile picture
已回答 3 個月前
  • Hi, i am running in python3.10 runtime in AWS lambda. Does it mean that start_file_transfer() method in python3.10 does not support SFTP connector parameters? I am able to input parameters "RetrieveFilePaths" and "LocalDirectoryPath" in vscode runnning python 3.12 but not in AWS lambda runnning python 3.10 runtime.

0

Hi, I'm trying to implement the same. Transfer file from remote sftp server to S3. Created a lambda (python version 3.12) for start_file_transfer and I get the following error in the connector logs: "failure-code": "RETRIEVE_FILE_NOT_FOUND", "failure-message": "SFTP error (SSH_FX_NO_SUCH_FILE): File does not exist.",

Can someone help me how to resolve this error. Thanks!

已回答 2 個月前
  • Have you checked if the file you are trying to pull from your remote sftp server exists or perhaps in the parameter of the start_file_transfer method the name of the file being passed is wrong. For example, "name_of_file.txt" instead of "name_of_file" or vice versa.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南