When using zappa to deploy my project from OSX everything works as expected. When I run zappa update from an ubuntu 17.04 box running in EC2 I get the following exception in the first request to the lambda:
Traceback (most recent call last):
File "/var/task/handler.py", line 505, in lambda_handler
return LambdaHandler.lambda_handler(event, context)
File "/var/task/handler.py", line 239, in lambda_handler
handler = cls()
File "/var/task/handler.py", line 145, in __init__
wsgi_app_function = get_django_wsgi(self.settings.DJANGO_SETTINGS)
File "/var/task/zappa/ext/django_zappa.py", line 20, in get_django_wsgi
return get_wsgi_application()
File "/tmp/webapp/django/core/wsgi.py", line 13, in get_wsgi_application
django.setup(set_prefix=False)
File "/tmp/webapp/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/tmp/webapp/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/tmp/webapp/django/apps/config.py", line 94, in create
module = import_module(entry)
File "/var/lang/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/tmp/webapp/push_notifications/__init__.py", line 4, in <module>
__version__ = pkg_resources.require("django-push-notifications")[0].version
File "/tmp/webapp/pkg_resources/__init__.py", line 972, in require
needed = self.resolve(parse_requirements(requirements))
File "/tmp/webapp/pkg_resources/__init__.py", line 858, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pycparser' distribution was not found and is required by cffi
and TypeError: 'NoneType' object is not callable on every following request.
Expected Behavior
lambda function works after zappa update on Ubuntu/EC2
Actual Behavior
lambda does not function when updated from EC2
Possible Fix
Possibly user error, but I can't figure out why pycparser would be included when packaging on OSX and not on Ubuntu
I can see pycparser in my site-packages, but it's not in the Zip that I can download from lambda neither when build from OSX or Ubuntu.
Steps to Reproduce
zappa update zappa_dev
zappa tail -since 1m
Your Environment
Zappa version used: 0.43.2
Operating System and Python version: Python 3.6.1, OSX 10.12.6, Ubuntu 17.04
Originally from: https://github.com/Miserlou/Zappa/issues/1074 by aarcro
Context
When using zappa to deploy my project from OSX everything works as expected. When I run zappa update from an ubuntu 17.04 box running in EC2 I get the following exception in the first request to the lambda:
and
TypeError: 'NoneType' object is not callable
on every following request.Expected Behavior
lambda function works after
zappa update
on Ubuntu/EC2Actual Behavior
lambda does not function when updated from EC2
Possible Fix
Possibly user error, but I can't figure out why
pycparser
would be included when packaging on OSX and not on UbuntuI can see pycparser in my site-packages, but it's not in the Zip that I can download from lambda neither when build from OSX or Ubuntu.
Steps to Reproduce
Your Environment
pip freeze
:zappa_settings.yml
: