Sairam Venkataraman
Sairam Venkataraman

Reputation: 31

Error when invoking lambda function as a ZIP file

This is the error I get when I try to invoke my lambda function as a ZIP file.

"The file lambda_function.py could not be found. Make sure your handler upholds the format: file-name.method."

What am I doing wrong?

Upvotes: 2

Views: 2111

Answers (3)

Cristi Dascalu
Cristi Dascalu

Reputation: 171

Whenever getting these kind of messages, if you see all files and handlers have the right name, format, location, etc., check also if other parts of the Lambda configuration are set up properly for what the code is trying to do.

For example, you might receive that unrelated error if your code is trying to execute against an RDS database that is in a private subnet and you are missing the correct VPC configuration that allows connectivity to that database.

Missing VPC configuration for Lambda

Upvotes: 0

Sairam Venkataraman
Sairam Venkataraman

Reputation: 1

Just to clarify: If I want to invoke Keras all I have to do is download the Keras directories and put my lambda code and Keras directories as a zip folder and upload it directly from my desktop right?

Just wanted to know if this is the right method to invoke Keras.

Upvotes: 0

Vijayanath Viswanathan
Vijayanath Viswanathan

Reputation: 8541

Mostly it is because of the way zipping the files making the problem. Instead of zipping the root folder you have to select all files and zip it like below,

Please upload all files and subfolders. My example is using node.js but you can do the same for python

enter image description here

Upvotes: 3

Related Questions