Comments (8)
(Aside: the forum is a better place to ask for help with using the software)
-
You haven't shown anything which could help debug your problem, in particular your
serverless.yml
file. -
What version of serverless-wsgi are you running?
-
Here it says that you need nodejs v6.5.0 or later, although admittedly here it says v4 is fine.
You seem to be running old versions of other code - for example you are using serverless 1.15.1 (released back in April) while the current version is 1.21.1. Hence you might want to bring everything up to date before you try debugging.
from serverless-wsgi.
@candlerb Thanks for taking time to reply.
(Will move this question to the forum)
- I've updated the older serverless version now.
- The problem was serverless not detecting the wsgi.py file, although it was present in the root directory (as shown in the error)
- My serverless file had the standard config as shown on the repo page. Working with latest serverless-wsgi version.
I was able to overcome these issues by using https://github.com/alexmilowski/flask-openwhisk instead. But the function gave a 404 error while the logs showed 500 errors. This made me give up on Open Whisk. Switched to AWS and everything works just fine.
from serverless-wsgi.
My serverless file had the standard config as shown on the repo page
Which repo page? With respect, I don't think it could be the example on the front page because that doesn't have provider: openwhisk
from serverless-wsgi.
Example on the front page + provider changed to openwhisk.
from serverless-wsgi.
I haven't tried OpenWhisk myself, but if wsgi.py is present in the package zip, then this plugin has done its job, and it may be an issue with serverless. In order to find the cause, you could try a few things:
- Place wsgi.py in the root directory manually, see if it helps
- If not, try getting a simple non-wsgi python function working first
from serverless-wsgi.
I'm closing this issue for now, please reopen if you are still having problems with OpenWhisk and suspect that it might be due to a bug in this plugin.
from serverless-wsgi.
I'm still having this issue, I'm using the template created from $ serverless install --url https://github.com/alexdebrie/serverless-flask --name my-flask-app
but changing the serverless.yml
file to:
service: my-flask-app
plugins:
- serverless-python-requirements
- serverless-wsgi
- serverless-openwhisk
custom:
wsgi:
app: app.app
packRequirements: false
pythonRequirements:
dockerizePip: true
package:
exclude:
- node_modules/**
- venv/**
provider:
name: openwhisk
runtime: python3.6
functions:
app:
handler: wsgi.handler
events:
- http: ANY /
- http: 'ANY {proxy+}'
I'm getting the exact same error:
$ SLS_DEBUG=* sls deploy
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command requirements
Serverless: Load command requirements:clean
Serverless: Load command requirements:install
Serverless: Load command wsgi
Serverless: Load command wsgi:serve
Serverless: Load command wsgi:clean
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Parsing Python requirements.txt
Serverless: Installing required Python packages for runtime python3.6...
Serverless: Docker Image: lambci/lambda:build-python3.6
Serverless: Linking required Python packages...
Serverless: Using Python specified in "runtime": python3.6
Serverless: Packaging Python WSGI handler...
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Unlinking required Python packages...
Serverless: Using Python specified in "runtime": python3.6
Serverless: Compiling Functions...
Serverless Error ---------------------------------------
Function handler (wsgi.py) does not exist.
Stack Trace --------------------------------------------
ServerlessError: Function handler (wsgi.py) does not exist.
at Python.generateActionPackage (/Users/username/my-flask-app/node_modules/serverless-openwhisk/compile/functions/runtimes/base.js:77:13)
at Python.exec (/Users/username/my-flask-app/node_modules/serverless-openwhisk/compile/functions/runtimes/base.js:27:17)
at Runtimes.exec (/Users/username/my-flask-app/node_modules/serverless-openwhisk/compile/functions/runtimes/index.js:29:49)
at OpenWhiskCompileFunctions.compileFunction (/Users/username/my-flask-app/node_modules/serverless-openwhisk/compile/functions/index.js:96:26)
at functionPromises.serverless.service.getAllFunctions.map (/Users/username/my-flask-app/node_modules/serverless-openwhisk/compile/functions/index.js:152:28)
at Array.map (<anonymous>)
at OpenWhiskCompileFunctions.compileFunctions (/Users/username/my-flask-app/node_modules/serverless-openwhisk/compile/functions/index.js:133:72)
at BbPromise.reduce (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/lib/classes/PluginManager.js:390:55)
From previous event:
at PluginManager.invoke (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/lib/classes/PluginManager.js:390:22)
at PluginManager.spawn (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/lib/classes/PluginManager.js:408:17)
at Deploy.BbPromise.bind.then.then (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:123:50)
From previous event:
at Object.before:deploy:deploy [as hook] (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:113:10)
at BbPromise.reduce (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/lib/classes/PluginManager.js:390:55)
From previous event:
at PluginManager.invoke (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/lib/classes/PluginManager.js:390:22)
at PluginManager.run (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/lib/classes/PluginManager.js:421:17)
at variables.populateService.then.then (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/lib/Serverless.js:157:33)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
at Serverless.run (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/lib/Serverless.js:144:8)
at serverless.init.then (/Users/username/.nvm/versions/node/v8.11.2/lib/node_modules/serverless/bin/serverless:43:50)
at <anonymous>
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information -----------------------------
OS: darwin
Node Version: 8.11.2
Serverless Version: 1.29.2
I placed wsgi.py in the root directory manually, but running sls deploy
actually removes that file even when I put it there myself, resulting in the same error. It looks like it gets deleted when serverless tries to clean out unneeded dependencies.
I haven't solved it but thought I would give some more info.
from serverless-wsgi.
I've also tried changing my serverless.yml to include:
package:
excludeDevDependencies: false
include:
- wsgi.py
But no luck.
from serverless-wsgi.
Related Issues (20)
- Error: ENOTDIR: not a directory HOT 2
- Serverless wsgi application and aws http api fail to integrate HOT 1
- empty header in event HOT 1
- Any reason why we are raising an exception here?
- Cannot deploy Hello World
- Unable to link dependency 'click' because a file by the same name exists in this service
- Attempting to run sls wsgi serve locally is freezing
- -c no longer works but --command does HOT 1
- Question: http/1.1 chunked transfer encoding
- hasbin dependency
- tag 3.0.1 does not contain some fixes from master. HOT 2
- Response contain status code and headers HOT 2
- I got error when I deploy Flask app on AWS lambda HOT 1
- AWS Custom Authorizer via django (drf)
- Provide function to execute when calling sls wsgi command
- Alternative directory structure does not seem to work
- replace calls to werkzeug.urls with urllib.parse HOT 6
- Request for new release based on latest master branch HOT 2
- Finalize Deploy Hook not working HOT 2
- Command fails, but shows as succeeded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-wsgi.