Search code examples
reactjsamazon-web-servicesgradleamazon-ec2

Ec2 instance not reachable after ./gradlew assemble


The problem : I have a react application in my ec2 instance(ubuntu). I'm trying to execute this command but it gets stuck while trying to execute "npm run build"

./gradlew :webapp:assemble

Faulty Process : When I do this, some process goes on succesfully, until it calls npm run build. After that terminal freezes as it is and does not give any error messages until I get an ssh connection time out error. When I try to reconnect to instance with ssh, instance doesn't respond in any way.

What I checked/tried : I've tried to do same operation with same application in my own pc and there isn't any problem. I also tried to run npm run build in ec2 without using gradle and its also working fine so I don't think there is any problem about my react application.

How can I troubleshoot this and learn what's causing instance to stuck in a not reachable state ? For example, is there a way to learn if this is caused by too high CPU usage ?


Solution

  • Thanks to @Riz 's comment I realized that there is a problem caused by insufficient ram. I Solved it by switching to another machine with more RAM