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

empty serverless_wsgi.py and wsgi_handler.py files in zip package #163

Closed
jmcgrath207 opened this issue Jan 21, 2021 · 3 comments
Closed

Comments

@jmcgrath207
Copy link

Hey all,

I am having issue when I deploy to aws lambda where it can't find the wsgi_handler.handler entry point. What I found when looking in the zip package in the .serverless folder was the zip package did contain the serverless_wsgi.py and wsgi_handler.py files but the files themself were completely empty (no python code). This occurs with this configuration.

plugins:
 - serverless-wsgi
 - serverless-python-requirements
 - serverless-pseudo-parameters
 wsgi:
   app: app.app
   packRequirements: false
   pythonBin: python
 pythonRequirements:
   pythonBin: python

provider:
 name: aws
 runtime: python3.8
 stage: dev
 region: us-east-1


functions:
 app:
   handler: wsgi_handler.handler
   events:
     - http: ANY /
     - http: ANY {proxy+}

However if I change packRequirements: false to packRequirements: true it makes the serverless_wsgi.py and wsgi_handler.py files appear in my template directory and the files do contain python code similar to the repo, however the .serverless folder disappears.

I am using serverless-wsgi version 1.7.6

The command I am using is SLS_DEBUG=* sls deploy --config template.yaml

This might be related to #161

@renatogcarvalho
Copy link

Hello everyone,

I'm also running into this problem. Does anyone have any idea how we can address this issue?

Thank you.

-R.

@renatogcarvalho
Copy link

Hey @jmcgrath207

I did some digging in the internals of the plugin and the files are packaged correctly.

The problem seems to occur when the package is compressed and ready to be uploaded to AWS. After more research I found this issue: serverless/serverless#8794

If you're running node v15, try downgrading to v14.15.4. It worked on my end!

Best.

-R.

@jmcgrath207
Copy link
Author

Hey @renatogcarvalho

Thanks for looking into that for me, that's got to be it! If I have time to test I will update this, but for now I am just using the python files from the repo instead and those work great!

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

2 participants