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.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ