Skip to content

aws-python-flask-api - Internal Server Error #716

Open
@romankurnovskii

Description

@romankurnovskii

aws-python-flask-api example works locally correct but after deploy getting {"message":"Internal Server Error"}

How to reproduce:

npm install
pip install -r requirements.txt
serverless deploy

log:

Using default Python executable: python
Packaging Python WSGI handler...

✔ Service deployed to stack aws-python-flask-api-project-dev (92s)

dashboard: https://app.serverless.com/xxxx/apps/aws-flask-api/aws-python-flask-api-project/
endpoint: ANY - https://xxxx.execute-api.eu-west-1.amazonaws.com
functions:
  api: aws-python-flask-api-project-dev-api (11 MB)

cloudwatch:

2022-09-02T04:37:10.629Z	835dece5-1e3a-50f9-5811-e0c60977e8b1	ERROR	Invoke Error 	{
    "errorType": "Error",
    "errorMessage": "Cannot find module './wsgi_handler.js'\nRequire stack:\n- /var/task/s_api.js\n- /var/runtime/UserFunction.js\n- /var/runtime/Runtime.js\n- /var/runtime/index.js",
    "code": "MODULE_NOT_FOUND",
    "requireStack": [
        "/var/task/s_api.js",
        "/var/runtime/UserFunction.js",
        "/var/runtime/Runtime.js",
        "/var/runtime/index.js"
    ],
    "stack": [
        "Error: Cannot find module './wsgi_handler.js'",
        "Require stack:",
        "- /var/task/s_api.js",
        "- /var/runtime/UserFunction.js",
        "- /var/runtime/Runtime.js",
        "- /var/runtime/index.js",
        "    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)",
        "    at Module._require.i.require (/var/task/serverless_sdk/index.js:9:73131)",
        "    at require (internal/modules/cjs/helpers.js:101:18)",
        "    at Object.<anonymous> (/var/task/s_api.js:25:23)",
        "    at Module._compile (internal/modules/cjs/loader.js:1085:14)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)",
        "    at Module.load (internal/modules/cjs/loader.js:950:32)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:790:12)",
        "    at Module.require (internal/modules/cjs/loader.js:974:19)",
        "    at require (internal/modules/cjs/helpers.js:101:18)"
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions