Server failed with exit status 2

I have a Go-based private service (with HTTP listener) that fails several times per hour with

Server failed
Exited with status 2

and then immediately “Server back up”. The service is on a 1 GB plan but uses only around 60 MB of memory. In the logs, I cannot find any panics. Why does this happen and what does exit code 2 mean?

  • Louis

Hey Louis,

It looks like exit status 2 generally indicates the incorrect usage of a command:

All builtins return an exit status of 2 to indicate incorrect usage, generally invalid options or missing arguments.

Is it possible that you have a misconfigured command that is causing you server to crash?