Raghav Suri
Raghav Suri

Reputation: 57

Wrapper error in Django Zappa deployment

I am trying to deploy my Django application using Zappa. I am using python 3.6 (although, I also have python 2.7 installed on my MacBook; never used it). Everything goes smoothly with the deployment except when I go to the url, I get this 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):\n', ' File \"/var/task/handler.py\", line 452, in handler\n response = Response.from_app(self.wsgi_app, environ)\n', ' File \"/var/task/werkzeug/wrappers.py\", line 903, in from_app\n return cls(*_run_wsgi_app(app, environ, buffered))\n', ' File \"/var/task/werkzeug/wrappers.py\", line 57, in _run_wsgi_app\n return _run_wsgi_app(*args)\n', ' File \"/var/task/werkzeug/test.py\", line 884, in run_wsgi_app\n app_rv = app(environ, start_response)\n', \"TypeError: 'NoneType' object is not callable\n\"]}"

When I use the tail command, I get the following error.

[1522350439826] 'NoneType' object is not callable

[1522350561286] [DEBUG] 2018-03-29T19:09:21.282Z afbf4f1c-3384-11e8-8a03-a1095dcd99f5 Zappa Event: {'time': '2018-03-29T19:09:19Z', 'detail-type': 'Scheduled Event', 'source': 'aws.events', 'account': '753712688736', 'region': 'us-east-1', 'detail': {}, 'version': '0', 'resources': ['arn:aws:events:us-east-1:753712688736:rule/r-suri-production-zappa-keep-warm-handler.keep_warm_callback'], 'id': 'f15a5fd5-aaf9-dfb7-1553-d14bb33d1b2b', 'kwargs': {}}

[1522350561286] [DEBUG] 2018-03-29T19:09:21.282Z afbf4f1c-3384-11e8-8a03-a1095dcd99f5 Zappa Event: {}

I have tried resetting my virtual env and requirements.txt from the scratch, but no help.

This is what my Zappa settings file looks like

{
    "production": {
        "aws_region": "us-east-1",
        "django_settings": "r_suri.settings",
        "profile_name": "default",
        "slim_handler": "true",
        "project_name": "r-suri",
        "runtime": "python3.6",
        "s3_bucket": "r-suri2"
    }
}

Does anyone know what this error is? and how can I fix it?

Upvotes: 3

Views: 1775

Answers (2)

Pawel Furmaniak
Pawel Furmaniak

Reputation: 4816

This error can be caused by this SQLite problem: https://github.com/Miserlou/Zappa/issues/1880

Please check zappa logs during deployment with zappa tail <ENV_NAME>

Upvotes: 1

Manto
Manto

Reputation: 1652

https://github.com/Miserlou/Zappa/issues/795 contains a list of things to try that has worked for different folks in the community. Some common ones are:

  • Underlying issue with slim_handler (try turn it off)
  • Deleting .pyc files that became part of the zip package

Upvotes: 0

Related Questions