Saturday, December 16, 2017

Handler 'handler' missing on module 'copy': module 'copy' has no attribute 'handler'

In my AWS Lambda function I am getting the following error in cloudwatch.

 Handler 'handler' missing on module 'copy': module 'copy' has no attribute 'handler' 

I am using a zip upload function, with Python 3.6.

 Solution:
Here the fix is how we call the handler. Its name.

In my case, I have renamed the copy.py to index.py
Inside the index.py, I have a function - def handler(event, context):

So my lambda handler is : index.handler
ie. Module.Function (filename.function_name)

Zip the folder and upload to lambda. See this blog for zip
 

No comments:

Post a Comment