Atlasian Elastic Bamboo build error: Too many open files error for Angular CLI build

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Atlasian Elastic Bamboo build error: Too many open files error for Angular CLI build



When I'm building my Angular-CLI project on Bamboo I'm getting the following error:


Error: EMFILE: too many open files, open '<file...>'
EMFILE: too many open files, open '<file...>'



I'm running elastic Bamboo on AWS EC2 linux instances. I've looked at Atlassian's support forum but they only gave general guidelines to solve the problem not how to actually add the fix to an existing bamboo setup that uses AWS EC2 instances.




1 Answer
1



In your Angular CLI project, under your .angular-cli.json (cli v1.x.x) or angular.json (cli v6.x.x+) under assets you've probably added a folder that contains a lot of files. When angular cli builds the project, the files are copied over to the build folder which is the main culprit for the error since the process hit the limit to the amount of files that can opened and copied over at the system level.


.angular-cli.json


angular.json


assets



To solve this you'll just need to update your AWS EC2 image config in the bamboo admin menu to include the fix described in the support forum.


Overview


ELASTIC BAMBOO


Image configurations


edit


Instance startup script



Add the following lines to the bottom of the script list


#increase open file limit
sudo echo "* soft nofile 40000" >> /etc/security/limits.conf
sudo echo "* hard nofile 40000" >> /etc/security/limits.conf



Please note * is to indicate any user but to be more specific you can replace it with Bamboo_USER


*


Bamboo_USER



Click Save


Save


ELASTIC BAMBOO


Instances


Terminate all instances






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS