Hello. I have an organization with multiple nodejs lambda services. Every service have different Github repository and Ci/Cd integration. They works well until yesterday.
Yesterday, after i commited some code to one of my services, Ci/Cd deploy throwed an error. Here is my deploy logs ;
Build step: serverless deploy --stage dev --region us-east-1 --force --org myorg --app myapp --debug
Serverless: Deprecation warning: Resolution of lambda version hashes was improved with better algorithm, which will be used in next major release.
Switch to it now by setting "provider.lambdaHashingVersion" to "20201221"
More Info: https://www.serverless.com/framework/docs/deprecations/#LAMBDA_HASHING_VERSION_V2
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: User Configuration warning: Cannot resolve local config file.
Error: EMFILE: too many open files, open '/My_Service/.serverlessrc'
Serverless: User Configuration warning: Cannot resolve global config file: /root/.serverlessrc
Error: EMFILE: too many open files, open '/root/.serverlessrc'
Serverless: Your previous global config was renamed to /root/.serverlessrc.bak for debugging. Default global config will be recreated under /root/.serverlessrc.
Serverless Error ---------------------------------------
Cannot read file node_modules/string-width/node_modules/strip-ansi/index.js due to: EMFILE: too many open files, open '/My_Service/node_modules/string-width/node_modules/strip-ansi/index.js'
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: linux
Node Version: 12.19.0
Framework Version: 2.28.3
Plugin Version: 4.4.3
SDK Version: 2.3.2
Components Version: 3.7.1
Build step failed: serverless deploy --stage dev --region us-east-1 --force --org myorganization --app myapp --debug
That file always changes to different file. And there are two points.
I can upload my code from my local with sls deploy. It works well. No problem. So i think there is no problem with my yaml file. But if anyone needs that, i can share.
My other services gives same error. All Ci/Cd integrasions throws same error.
I tried to clear or delete my CloudFormation Snacks and buckets. Thats not worked. Anyone help me? Im so confused.
Hi again. Finally i can fix the problem. I dont know why, but when i try to deploy my lambda project to cloud, error says : my npm packages size is too big. And i decided to take a look again my package.json. Here is my solution steps;
Make sure which dependencies you need. Make you sure you use devDependencies.
individually: true flag in package helps me too.
Also, you can use serverless-bundle package on npm for webpack.
I just started getting this same issue last week. I upgraded to use the latest AWS sdks which got rid of the problem for a few days, but it came back again. I installed serverless-plugin-include-dependencies which seems to help deploy in our CI/CD (circleci) but Iām not able to deploy locally and it feels like itās just a problem waiting to rear its head in the near future.
Cannot read file node_modules/uuid/dist/esm-node/nil.js due to: EMFILE: too many open files, open ā/Users/liron/Dev/SourceIP/sourceip/api/node_modules/uuid/dist/esm-node/nil.jsā
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 12.22.8
Framework Version: 2.72.2
Plugin Version: 5.5.4
SDK Version: 4.3.0
Components Version: 3.18.2
This is a great suggestion, but unfortunately Github Actions (GHA) pulls the Serverless from NPM so we canāt really do thatā¦
We started getting this problem in a few repos, then we bumped up the GHA runner to a beefier server and it ran for a few months, but now weāre back to getting this āEMFILE; too many filesā again regardless how many cores we throw at it as Github has a fixed ulimit on their runners which is the same regardless of the number of coresā¦