serverless-python-requirements: Fatal error when trying to deploy single-functions
FYI: This is with the latest code from master Version: serverless@1.26.1 Steps to reproduce: Create any/simple stack which uses this plugin, and try to do a single-function deploy.
Error --------------------------------------------------
Unsupported type: data is neither a path or a Buffer
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Stack Trace --------------------------------------------
Error: Unsupported type: data is neither a path or a Buffer
at Object.ZipLocal.sync.unzip (/Users/farley/myService/node_modules/zip-local/main.js:386:15)
at injectRequirements (/Users/farley/myService/node_modules/serverless-python-requirements/lib/inject.js:45:27)
at ServerlessPythonRequirements.injectAllRequirements (/Users/farley/myService/node_modules/serverless-python-requirements/lib/inject.js:118:5)
From previous event:
at PluginManager.invoke (/Users/farley/.npm-packages/lib/node_modules/serverless/lib/classes/PluginManager.js:372:22)
at PluginManager.run (/Users/farley/.npm-packages/lib/node_modules/serverless/lib/classes/PluginManager.js:403:17)
at variables.populateService.then (/Users/farley/.npm-packages/lib/node_modules/serverless/lib/Serverless.js:102:33)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
at Serverless.run (/Users/farley/.npm-packages/lib/node_modules/serverless/lib/Serverless.js:89:74)
at serverless.init.then (/Users/farley/.npm-packages/lib/node_modules/serverless/bin/serverless:42:50)
# serverless.yml
service: myService
provider:
name: aws
runtime: python2.7
plugins:
- serverless-python-requirements
custom:
pythonRequirements:
dockerizePip: true
functions:
hello:
handler: handler.hello
# requirements.txt
requests
master/bleeding edge might not be ready yet, I was just developing something on top of it and ran into this.
Cheers!
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 16
Commits related to this issue
- test for #161 — committed to serverless/serverless-python-requirements by dschep 6 years ago
- Better mixed runtime & function deploy handling fixes #161 and fixes #179 — committed to serverless/serverless-python-requirements by dschep 6 years ago
- Better mixed runtime & function deploy handling fixes #161 and fixes #179 — committed to serverless/serverless-python-requirements by dschep 6 years ago
- Better mixed runtime & function deploy handling (#180) * Better mixed runtime & function deploy handling fixes #161 and fixes #179 * another tweak * fix again? * Fix corrupted zip archive... — committed to serverless/serverless-python-requirements by dschep 6 years ago
- Download and static caching as a feature (#165) Fixes #157 (filed by me) ## What this does * Makes the download caching of pip a "first-class citizen" as an option directly in this plugin's optio... — committed to serverless/serverless-python-requirements by AndrewFarley 6 years ago
@dschep While both seem to trigger the same “after” handler from plugin-hooks, it looks like when running
sls packagethe valuethis.serverless.service.package.artifactis correctly pointing to the “big zip file”. In contrast, when runningsls deploy -f funcnamethe artifact is undefined.I suspect what’s happening is that a non-null
artifactvalue is a side-effect of the packaging step, which is skipped when doing partial deploys. Specifically this part of the core serverless app: