When running Bazel in CI and building targets with rules_go the build will infrequently fail with the message
Server terminated abruptly (error code: 14, error message: '', log file: '...')
The "jvm.out" file given as the log file is empty. The last message in the bazel java.log file is
"INFO: Starting analysis"
N/A
Operating System: Ubuntu 16.04, build inside docker container.
Bazel version (output of bazel info release):
Bazel 0.4.5
Same issue is seen here, but no resolution in sight
https://github.com/bazelbuild/bazel/issues/2939
(If they are large, please upload as attachment or provide link).
Turns out this was the OOM killer, the CI machines were running out of memory during the Bazel run.
I will close this since it wasn't a bazel issue.
Is there no way for bazel to print OOM? This is very difficult to debug.
When the OOM killer comes into play all bets are off. OOM just sends a SIGKILL nothing special that would be possible for bazel to determine why it's process is getting killed vs some random person killing one off. Possibly you could use some heuristic to say a process was killed and I see that I'm using X% of allocated memory so maybe OOM?
Checking if dmesg has an oom-killer entry with \
I also have same problem, but solved by setting swap memory. more detail see http://www.jishuyiliu.com/archives/209.html
same issue here when running on 800MB ram
My bazel target had been running fine on my local desktop, but failing with the aforementioned error 14.... Solved this by constraining bazel's memory usage (https://stackoverflow.com/questions/34382360/decrease-bazel-memory-usage).
same issue here when running on 800MB ram
But with 22G of RAM seems to be difficult.
Server terminated abruptly (error code: 14, error message: 'Socket closed', log file: '/home/cosev/.cache/bazel/_bazel_cosev/86567ccce8de0c1bf6e7f43fe83a5013/server/jvm.out')
Maybe the jvm configuration?
Most helpful comment
Turns out this was the OOM killer, the CI machines were running out of memory during the Bazel run.