Skip to content

Unable to deploy single functions #189

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

Closed
jacobevans opened this issue May 8, 2018 · 8 comments
Closed

Unable to deploy single functions #189

jacobevans opened this issue May 8, 2018 · 8 comments

Comments

@jacobevans
Copy link

I have an issue possibly related to #161, but I don't think it's a duplicate. I was experiencing the issues described in #161, I updated this package, and now I'm getting a different error when I try to deploy a single function. See below for command full debug output. Please let me know if there's any pertinent info that I've left out.

$ SLS_DEBUG=* sls deploy function -f my_function_name
Serverless: Load command run
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 emit
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command requirements
Serverless: Load command requirements:clean
Serverless: Load command requirements:install
Serverless: Invoke deploy:function
Serverless: Installing requirements of requirements.txt in .serverless...
Serverless: Docker Image: lambci/lambda:build-python2.7
Serverless: Invoke package:function
Serverless: Packaging function: my_function_name...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...

  Type Error ---------------------------------------------

  path must be a string or Buffer

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

TypeError: path must be a string or Buffer
    at fs.readFile (fs.js:379:11)
    at go$readFile (~/project-dir/node_modules/graceful-fs/graceful-fs.js:73:14)
    at Object.readFile (~/project-dir/node_modules/graceful-fs/graceful-fs.js:70:12)
    at Object.readFile (~/project-dir/node_modules/universalify/index.js:5:67)
    at injectRequirements (~/project-dir/node_modules/serverless-python-requirements/lib/inject.js:24:6)
    at ServerlessPythonRequirements.injectAllRequirements (~/project-dir/node_modules/serverless-python-requirements/lib/inject.js:115:12)
    at runCallback (timers.js:763:18)
    at tryOnImmediate (timers.js:734:5)
    at processImmediate (timers.js:716:5)
    at process.topLevelDomainCallback (domain.js:101:23)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           9.10.0
     Serverless Version:     1.26.1
@jacobevans
Copy link
Author

This may be useful also:

$ npm list
project@0.1.0 ~/project-dir
└─┬ serverless-python-requirements@4.0.2
  ├── bluebird@3.5.1
  ├─┬ fs-extra@5.0.0
  │ ├── graceful-fs@4.1.11
  │ ├─┬ jsonfile@4.0.0
  │ │ └── graceful-fs@4.1.11 deduped
  │ └── universalify@0.1.1
  ├─┬ glob-all@3.1.0
  │ ├─┬ glob@7.1.2
  │ │ ├── fs.realpath@1.0.0
  │ │ ├─┬ inflight@1.0.6
  │ │ │ ├── once@1.4.0 deduped
  │ │ │ └── wrappy@1.0.2
  │ │ ├── inherits@2.0.3
  │ │ ├─┬ minimatch@3.0.4
  │ │ │ └─┬ brace-expansion@1.1.11
  │ │ │   ├── balanced-match@1.0.0
  │ │ │   └── concat-map@0.0.1
  │ │ ├─┬ once@1.4.0
  │ │ │ └── wrappy@1.0.2 deduped
  │ │ └── path-is-absolute@1.0.1
  │ └─┬ yargs@1.2.6
  │   └── minimist@0.1.0
  ├── is-wsl@1.1.0
  ├─┬ jszip@3.1.5
  │ ├── core-js@2.3.0
  │ ├── es6-promise@3.0.2
  │ ├─┬ lie@3.1.1
  │ │ └── immediate@3.0.6
  │ ├── pako@1.0.6
  │ └─┬ readable-stream@2.0.6
  │   ├── core-util-is@1.0.2
  │   ├── inherits@2.0.3 deduped
  │   ├── isarray@1.0.0
  │   ├── process-nextick-args@1.0.7
  │   ├── string_decoder@0.10.31
  │   └── util-deprecate@1.0.2
  ├── lodash.get@4.4.2
  ├── lodash.set@4.3.2
  ├── lodash.uniqby@4.7.0
  ├── lodash.values@4.3.0
  └─┬ rimraf@2.6.2
    └── glob@7.1.2 deduped

@dschep
Copy link
Contributor

dschep commented May 9, 2018

Oh. hadn't released that fix yet. Done. update to 4.0.3

@dschep dschep closed this as completed May 9, 2018
@jacobevans
Copy link
Author

oh, I didn't realize that, sorry!

thanks for your help

@dschep
Copy link
Contributor

dschep commented May 10, 2018

no worries! Thanks for the nudge to make a release 😉

@grvhi
Copy link

grvhi commented Jun 14, 2018

Hi @dschep - I'm seeing exactly the same issue but with version 4.0.4. I'm new to serverless in general, so any pointers gratefully received!

Here are the details:

Serverless: Load command run
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 emit
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command requirements
Serverless: Load command requirements:clean
Serverless: Load command requirements:install
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Generating requirements.txt from Pipfile...
Serverless: Installing requirements of requirements.txt in .serverless...
Serverless: Docker Image: lambci/lambda:build-python3.6
Serverless: Packaging service...
Serverless: Injecting required Python packages to package...
 
  Type Error ---------------------------------------------
 
  path must be a string or Buffer
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Stack Trace --------------------------------------------
 
TypeError: path must be a string or Buffer
    at fs.readFile (fs.js:379:11)
    at go$readFile (<path>/node_modules/graceful-fs/graceful-fs.js:73:14)
    at Object.readFile (<path>/node_modules/graceful-fs/graceful-fs.js:70:12)
    at Object.readFile (<path>/node_modules/universalify/index.js:5:67)
    at injectRequirements (<path>/node_modules/serverless-python-requirements/lib/inject.js:24:6)
    at ServerlessPythonRequirements.injectAllRequirements (<path>/node_modules/serverless-python-requirements/lib/inject.js:118:12)
    at ServerlessPythonRequirements.BbPromise.bind.then.then (<path>/node_modules/serverless-python-requirements/index.js:135:43)
    at runCallback (timers.js:763:18)
    at tryOnImmediate (timers.js:734:5)
    at processImmediate (timers.js:716:5)
    at process.topLevelDomainCallback (domain.js:101:23)
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           9.9.0
     Serverless Version:     1.27.3
> npm list
└─┬ serverless-python-requirements@4.0.4
  ├── bluebird@3.5.1
  ├─┬ fs-extra@6.0.1
  │ ├── graceful-fs@4.1.11
  │ ├─┬ jsonfile@4.0.0
  │ │ └── graceful-fs@4.1.11 deduped
  │ └── universalify@0.1.1
  ├─┬ glob-all@3.1.0
  │ ├─┬ glob@7.1.2
  │ │ ├── fs.realpath@1.0.0
  │ │ ├─┬ inflight@1.0.6
  │ │ │ ├── once@1.4.0 deduped
  │ │ │ └── wrappy@1.0.2
  │ │ ├── inherits@2.0.3
  │ │ ├─┬ minimatch@3.0.4
  │ │ │ └─┬ brace-expansion@1.1.11
  │ │ │   ├── balanced-match@1.0.0
  │ │ │   └── concat-map@0.0.1
  │ │ ├─┬ once@1.4.0
  │ │ │ └── wrappy@1.0.2 deduped
  │ │ └── path-is-absolute@1.0.1
  │ └─┬ yargs@1.2.6
  │   └── minimist@0.1.0
  ├── is-wsl@1.1.0
  ├─┬ jszip@3.1.5
  │ ├── core-js@2.3.0
  │ ├── es6-promise@3.0.2
  │ ├─┬ lie@3.1.1
  │ │ └── immediate@3.0.6
  │ ├── pako@1.0.6
  │ └─┬ readable-stream@2.0.6
  │   ├── core-util-is@1.0.2
  │   ├── inherits@2.0.3 deduped
  │   ├── isarray@1.0.0
  │   ├── process-nextick-args@1.0.7
  │   ├── string_decoder@0.10.31
  │   └── util-deprecate@1.0.2
  ├── lodash.get@4.4.2
  ├── lodash.set@4.3.2
  ├── lodash.uniqby@4.7.0
  ├── lodash.values@4.3.0
  └─┬ rimraf@2.6.2
    └── glob@7.1.2 deduped

@grvhi
Copy link

grvhi commented Jun 14, 2018

To add to my last, I see the same error with 4.0.3

@grvhi
Copy link

grvhi commented Jun 14, 2018

It seems that I might actually be experiencing #161

The value of this.serverless.service.package.artifact || funcArtifact on line 122 in inject.js is undefined... I'm still digging around, but it seems to fit with the TypeError I'm seeing

@grvhi
Copy link

grvhi commented Jun 14, 2018

Perhaps unsurprisingly, this is a PEBCAK issue.... Turns out I was being over-zealous with my indentation of the functions block in my serverless.yml.

Apologies for all the noise!

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

3 participants