pythonamazon-web-servicesaws-lambdachalice

Internal Server Error when deploying Chalice (AWS)


I am trying to deploy a simple REST API using Chalice. My basic boilerplate is

from chalice import Chalice

app = Chalice(app_name='helloworld')


@app.route('/')
def index():
    return {'hello': 'world'}

When I call chalice local and run it on localhost 8000, there is no issue and I am able to get back the returns. However, after I deployed it and used the REST API URL that was returned, it didn't work anymore. I keep getting the

{"message": "Internal server error"}

I would appreciate any help! Thanks!


Solution

    1. Good news, it looks like you are reaching your lambda.
    2. Check aws cloudwatch logs: /aws/lambda/helloworld-{dev|prod}
    3. If can't solve it, upload .chalice/config.json and the error of the logs in clouwatch