nroi

nroi

Distillery: "Node is not running!" and non-zero exit code

Hi,

If I start the build with _build/prod/rel/projectname/bin/projectname foreground and then stop it with _build/prod/rel/projectname/bin/projectname stop I get the error message: “Node is not running!” and the exit code 1. The shutdown seems to work nonetheless, at least I don’t see any beam processes other than epmd lurking around, but I don’t want to just ignore the error since I use systemd to start and stop the processes. If processes exit with a non-zero exit code, systemd marks the unit as failed.

Perhaps the foreground option is not meant to be used with the stop command, but sending SIGINT or SIGTERM to the process instead doesn’t solve my problem either: The error message “Node ist not running!” disappears, but I still get a non-zero exit code. Starting the process with “start” instead of foreground is also not an option, since I want the log messages to appear in my systemd journal.

I’d appreciate any advice to solve this without workarounds such as adding SuccessExitStatus= to the systemd service file.

Marked As Solved

bitwalker

bitwalker

Leader

stop is meant as a counterpart to start - in my own applications where I use foreground I send SIGTERM to the bin/projectname script process, not the beam.smp process. This is because the script sets up a trap to ensure the application terminates gracefully. If you send SIGTERM directly to the beam.smp process, it will shutdown, but not gracefully, and the trap will then be executed which is what is generating the Node is not running message (because it can’t rpc to the node to tell it to stop).

Also Liked

nroi

nroi

I see. In that case, I suppose adding SuccessExitStatus=143 to the systemd service file is the best solution. I thought it was more of a workaround than a fix, but it seems this is a common approach for Java applications as well.

Where Next?

Popular in Questions Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49266 226
New

We're in Beta

About us Mission Statement