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

3 Answers
1
Accepted Answer

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
answered 2 months ago
profile picture
EXPERT
reviewed a month ago
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
answered 2 months ago
  • 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!

answered 2 months ago
  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions