Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flask_Ask 500 Internal error with Zappa #933

Open
libert-xyz opened this issue Jun 16, 2017 · 14 comments
Open

Flask_Ask 500 Internal error with Zappa #933

libert-xyz opened this issue Jun 16, 2017 · 14 comments

Comments

@libert-xyz
Copy link

libert-xyz commented Jun 16, 2017

Context

Hi, I followed this tutorial to deploy an Alexa Skill with Zappa: video and I'm getting a 500 error

Expected Behavior

My skill should work from Alexa(works locally with ngrok)

Actual Behavior

Output from AWS API Gateway

"{u'message': u'An uncaught exception happened while servicing this request. You can investigate this with the zappa tail command.', u'traceback': ['Traceback (most recent call last):\\n', ' File \"/var/task/handler.py\", line 433, in handler\\n response = Response.from_app(self.wsgi_app, environ)\\n', ' File \"/tmp/pip-build-jW5QZX/Werkzeug/werkzeug/wrappers.py\", line 903, in from_app\\n', ' File \"/tmp/pip-build-jW5QZX/Werkzeug/werkzeug/wrappers.py\", line 57, in _run_wsgi_app\\n', ' File \"/tmp/pip-build-jW5QZX/Werkzeug/werkzeug/test.py\", line 884, in run_wsgi_app\\n', \"TypeError: 'NoneType' object is not callable\\n\"]}"

Steps to Reproduce

  1. source venv/bin/activate
  2. pip install flask_ask zappa
  3. zappa init / zappa deploy dev

Environment

  • Zappa version used: zappa==0.42.1
  • Operating System and Python version: Ubuntu / Python 2.7
  • pip freezeaniso8601==1.2.0 argcomplete==1.8.2 asn1crypto==0.22.0 base58==0.2.4 boto3==1.4.4 botocore==1.5.40 certifi==2017.4.17 cffi==1.10.0 chardet==3.0.4 click==6.7 cryptography==1.9 docutils==0.13.1 durationpy==0.4 enum34==1.1.6 Flask==0.12.1 Flask-Ask==0.9.3 future==0.16.0 futures==3.1.1 hjson==2.0.7 idna==2.5 ipaddress==1.0.18 itsdangerous==0.24 Jinja2==2.9.6 jmespath==0.9.3 kappa==0.6.0 lambda-packages==0.15.1 MarkupSafe==1.0 placebo==0.8.1 pycparser==2.17 pyOpenSSL==17.0.0 python-dateutil==2.6.0 python-slugify==1.2.4 PyYAML==3.12 requests==2.18.1 s3transfer==0.1.10 six==1.10.0 toml==0.9.2 tqdm==4.14.0 troposphere==1.9.4 Unidecode==0.4.20 urllib3==1.21.1 Werkzeug==0.12 wsgi-request-logger==0.4.6 zappa==0.42.1
  • zappa_settings.json
{
    "dev": {
        "app_function": "skill.app", 
        "profile_name": "default", 
        "s3_bucket": "zapa-XXXX"
    }
}

Any thoughts?

@libert-xyz
Copy link
Author

libert-xyz commented Jun 16, 2017

Fix

setupstools problem, refer link

Fix it with

pip install packaging

@hmc-cs-abaugus
Copy link

Hey there,

I've got identical behavior from the same tutorial, but pip install packaging did not work for me; pip check finds no broken requirements, but zappa tail outputs the following: No module named 'cryptography.hazmat.bindings._openssl': ModuleNotFoundError. It seems like this may be a typo, as the previous line successfully does "from cryptography.hazmat.bindings.openssl.binding import Binding", but I don't know where to go to fix the typo (I think it's possible the part that says _openssl should just say openssl). I've uninstalled and reinstalled cryptography as well as reinstalled pip but neither fixed the issue. Has anyone else had this problem?

@ghost
Copy link

ghost commented Jun 30, 2017

I had this issue last night with my lambda. Got super scared but I solved by deleting all *.pyc pycache folders and files. re-deploying my production and it came back up.

@robarthur
Copy link

Seeing a similar issue to the one listed above.
From my cloudwatch logs
No module named packaging.version: ImportError

Python 2.7 pip 9.0.1

pip freeze aniso8601==1.2.0 argcomplete==1.8.2 arrow==0.10.0 asn1crypto==0.22.0 base58==0.2.4 binaryornot==0.4.3 boto3==1.4.4 botocore==1.5.40 certifi==2017.4.17 cffi==1.10.0 chardet==3.0.4 click==6.7 cookiecutter==1.5.1 cryptography==1.9 docutils==0.13.1 durationpy==0.4 enum34==1.1.6 Flask==0.12.2 Flask-Ask==0.9.4 future==0.16.0 futures==3.1.1 hjson==2.0.7 idna==2.5 ipaddress==1.0.18 itsdangerous==0.24 Jinja2==2.9.6 jinja2-time==0.2.0 jmespath==0.9.3 kappa==0.6.0 lambda-packages==0.15.1 MarkupSafe==1.0 packaging==16.8 pkg-resources==0.0.0 placebo==0.8.1 poyo==0.4.1 pycparser==2.17 pyOpenSSL==17.0.0 pyparsing==2.2.0 python-dateutil==2.6.0 python-slugify==1.2.4 PyYAML==3.12 requests==2.18.1 s3transfer==0.1.10 six==1.10.0 toml==0.9.2 tqdm==4.14.0 troposphere==1.9.4 Unidecode==0.4.21 urllib3==1.21.1 Werkzeug==0.12.2 whichcraft==0.4.1 wsgi-request-logger==0.4.6 zappa==0.42.2
zappa_settings.json

{ "dev": { "app_function": "app.app", "aws_region": "eu-west-2", "s3_bucket": "zappa-xxxxxxxxx" } }

Any suggestions what this could be?

@libert-xyz
Copy link
Author

@robarthur installing packaging solved the problem in my case

pip install packaging

@GeorgianaPetria
Copy link

I'm having the same problem and pip install packaging didn't work for me. Any other solution that worked?

@ghost
Copy link

ghost commented Aug 2, 2017 via email

@GeorgianaPetria
Copy link

GeorgianaPetria commented Aug 2, 2017

When do you delete the python files? Before re-deploying?

I used removed all .pyc files in my virtual env find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf and then zappa update dev but it still doesn't work.

@ghost
Copy link

ghost commented Aug 2, 2017 via email

@GeorgianaPetria
Copy link

GeorgianaPetria commented Aug 2, 2017

Yes, it does it recursively, but unfortunately it's still not working.

Any idea how I can to narrow down the error?
"{u'message': u'An uncaught exception happened while servicing this request. You can investigate this with the zappa tail command.', u'traceback': ['Traceback (most recent call last):\\n', ' File \"/var/task/handler.py\", line 434, in handler\\n response = Response.from_app(self.wsgi_app, environ)\\n', ' File \"/tmp/pip-build-0Sv96s/Werkzeug/werkzeug/wrappers.py\", line 903, in from_app\\n', ' File \"/tmp/pip-build-0Sv96s/Werkzeug/werkzeug/test.py\", line 884, in run_wsgi_app\\n', \"TypeError: 'NoneType' object is not callable\\n\"]}"

@ghost
Copy link

ghost commented Aug 20, 2017

I started a new project from scratch and got this issue. Are you still having problems?

@RenegadeMaster
Copy link

I have successfully deployed several Zappa projects but only recently encountered this error. I also noticed for the first time, Zappa creation required cloudformation privileges. Could it be something in a newer version? This was a clean project, clean deploy

@variable
Copy link

variable commented Sep 7, 2017

Having the same problem with Django...

@Arttii
Copy link

Arttii commented Oct 6, 2017

I am having the same problem with Apistar, its complaining about dependencies, that are there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants