Skip to content

Issue:414 - Fix Individual deploy of functions #428

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
wants to merge 7 commits into from

Conversation

ndanielsen
Copy link

Fixes #414

I created the mentioned issue awhile back.

It seems that the issue is that the serverless framework is no longer setting and passing on the package or artifact (zip file) location (ie func.package.artifact) for the function.

Also the injectAllRequirements is no longer passing on the funcArtifact, instead it is passed an undefined object.

This is more of a patch and I'm not sure if this will break other things. Individual deploys of function and deploying the entire service work for me on my Mac with:

    pythonRequirements:
    slim: true

Happy to write tests and etc with any feedback given.

@J-Light
Copy link

J-Light commented Dec 28, 2019

@ndanielsen The patch does not work for me. I cleaned all my plugins and install from your repo. I get the following error.

Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
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 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 rollback
Serverless: Load command rollback:function
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command requirements
Serverless: Load command requirements:clean
Serverless: Load command requirements:install
Serverless: Load command requirements:cleanCache
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Invoke deploy:function
Serverless: [AWS lambda 200 0.257s 0 retries] getFunction({ FunctionName: 'sampleproj-dev-Testfn' })
Serverless: Generated requirements from /home/user1/leapApps/serverless/Sampleproj/requirements.txt in /home/user1/leapApps/serverless/Sampleproj/.serverless/requirements.txt...
Serverless: Using static cache of requirements found at /home/user1/.cache/serverless-python-requirements/b3a0ae6c1169417f377b9af5a48cefafdf00e327e8940ad298e2f8093e6eaeae_slspyc ...
Serverless: Invoke package:function
Serverless: Packaging function: Testfn...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...
 
  Type Error [ E R R_ I N V A L I D_ A R G_ T Y P E] -----
 
  TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type undefined
      at readFile (fs.js:296:3)
      at go$readFile (/home/user1/.npm-packages/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:85:14)
      at readFile (/home/user1/.npm-packages/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:82:12)
      at go$readFile (/home/user1/leapApps/serverless/Sampleproj/node_modules/graceful-fs/graceful-fs.js:110:14)
      at Object.readFile (/home/user1/leapApps/serverless/Sampleproj/node_modules/graceful-fs/graceful-fs.js:107:12)
      at Object.readFile (/home/user1/leapApps/serverless/Sampleproj/node_modules/universalify/index.js:5:67)
      at injectRequirements (/home/user1/leapApps/serverless/Sampleproj/node_modules/serverless-python-requirements/lib/inject.js:23:6)
      at ServerlessPythonRequirements.injectAllRequirements (/home/user1/leapApps/serverless/Sampleproj/node_modules/serverless-python-requirements/lib/inject.js:161:12)
      at ServerlessPythonRequirements.BbPromise.bind.then.then.then (/home/user1/leapApps/serverless/Sampleproj/node_modules/serverless-python-requirements/index.js:181:43)
      at runCallback (timers.js:705:18)
      at tryOnImmediate (timers.js:676:5)
      at processImmediate (timers.js:658:5)
      at process.topLevelDomainCallback (domain.js:126:23)
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              10.16.3
     Framework Version:         1.60.4
     Plugin Version:            3.2.6
     SDK Version:               2.2.1
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0
 

@ndanielsen
Copy link
Author

Better fix in #490

Closing now

@ndanielsen ndanielsen closed this Feb 17, 2021
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

Successfully merging this pull request may close these issues.

Error in Individual Deployment of Function
2 participants