Articles in this section

NodeJS website randomly unavailable: 500 Internal server error

kb: technical nodejs

Symptoms

  • Website with NodeJS returns a 500 internal server error occasionally

Cause

One of the randomly picked sockets is missing. The following could be seen in /var/log/passenger/passenger.log:

CONFIG_TEXT: [ E 2023-01-22 17:06:07.0103 27101/T0 apa/Hooks.cpp:751 ]: Unexpected error in mod_passenger: Cannot connect to the Passenger core at unix:/tmp/passenger.20pAQXl/agents.s/core
Backtrace:
in 'Passenger::FileDescriptor Passenger::Apache2Module::Hooks::connectToCore()' (Hooks.cpp:343)
in 'int Passenger::Apache2Module::Hooks::handleRequest(request_rec*)' (Hooks.cpp:622)
[ D 2023-01-22 17:06:09.2120 35164/Tk age/Cor/Con/TurboCaching.h:246 ]: Clearing
turbocache
[ D 2023-01-22 17:06:09.2120 35164/Tk Ser/Server.h:880 ]: [ServerThr.7] 1 new client(s) accepted; there are now 1 active client(s)
[ D 2023-01-22 17:06:09.2122 35164/Tk age/Cor/App/Gro/SessionManagement.cpp:330 ]: Session checked out from process (pid=35483, group=/var/www/vhosts/example.com (production))

Resolution

Restart both apache2 and the NodeJS application to reload the passenger module and recreate the sockets.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.