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개 답변
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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠