I'm running into an error after deploying my django app to lambda using zappa.
This is the error:
{'message': 'An uncaught exception happened while servicing this request. You can investigate this with the `zappa tail` command.', 'traceback': ['Traceback (most recent call last):', ' File /var/task/handler.py, line 540, in handler with Response.from_app(self.wsgi_app, environ) as response:', ' File /var/task/werkzeug/wrappers/base_response.py, line 287, in from_app return cls(*_run_wsgi_app(app, environ, buffered))', ' File /var/task/werkzeug/wrappers/base_response.py, line 26, in _run_wsgi_app return _run_wsgi_app(*args)', ' File /var/task/werkzeug/test.py, line 1119, in run_wsgi_app app_rv = app(environ, start_response)', TypeError: 'NoneType' object is not callable]}
These are my zappa settings:
{
"production": {
"aws_region": "eu-west-2",
"django_settings": "app.settings",
"profile_name": "deployment",
"project_name": "app",
"runtime": "python3.6",
"s3_bucket": "zappa-deployment-uploads",
"slim_handler": true,
"exclude": [".ebextensions/", ".elasticbeanstalk/", "webpack/", "app/static/"],
"vpc_config" : {
"SubnetIds": [ "..."],
"SecurityGroupIds": ["..."]
}
}
I've ensured that my API Gateway hostname has been added to my allowed hosts setting and redeployed.
I've called zappa tail, but it gives me an even shorter error respons "'NoneType' object is not callable".
Can anyone understand why I would be getting this?
You have an exception being thrown in your code. I have found NoneType
is a generic error when using AWS Lambda & Zappa that is masking the true issue.
Some debugging steps:
python manage.py runserver
zappa tail
to identify the section of code that is having troubles