[SOLVED] Troubleshooting app restarts

I have a meteor application running in production with Phusion Passenger. When I check the error logs it looks like the app is restarting every couple of minutes. How can I start troubleshooting this?

Partial log example:

[ N 2018-10-02 12:01:15.5881 13634/T7 age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 27312, application /var/www/vhosts/myapp/live (production)
App 28045 stdout:
App 28045 stderr: Note: you are using a pure-JavaScript implementation of bcrypt.
App 28045 stderr: While this implementation will work correctly, it is known to be
App 28045 stderr: approximately three times slower than the native implementation.
App 28045 stderr: In order to use the native implementation instead, run
App 28045 stderr:
App 28045 stderr: meteor npm install --save bcrypt
App 28045 stderr:
App 28045 stderr: in the root directory of your application.

The only reason I’m recognising the app is restarting is because of the bcrypt message that only appears during startup. Also users say the app is sometimes slow, I guess this is when they are waiting during the restart.

What happens if you install the native bcrypt? I am running Passenger and don’t have that problem. What version and OS are you on? Passenger native or as nginx module?

The problem is not so much about the bcrypt message, it’s ok that the slightly slower bcrypt is used. It’s just that I know whenever I see that message I know the app has just started and I see the message sometimes every 5 minutes.

To make sure that your app restarted, try to add a script in Meteor.startup function, which writes some logs.

1 Like

In case anyone else runs into this problem, it was caused by a different version of node on the server, which was causing segmentation vaults:

Oct 5 15:26:37 hosting212 kernel: traps: Passenger NodeA[10337] general protection ip:207359b45792 sp:7f7db0e8ebf0 error:0
Oct 5 15:26:37 hosting212 abrt-hook-ccpp: Process 10337 (node) of user 10028 killed by SIGSEGV - dumping core

Local development version:
$ meteor node --version

On the server:
$ node --version v8.11.1

After installing node v8.11.3 on the server everything is running smooth again.