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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容