Bazel: Bazel fails during analysis phase - "Server terminated abruptly"

Created on 17 May 2017  路  9Comments  路  Source: bazelbuild/bazel

Description of the problem / feature request / question:

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"

If possible, provide a minimal example to reproduce the problem:

N/A

Environment info

  • Operating System: Ubuntu 16.04, build inside docker container.

  • Bazel version (output of bazel info release):

Bazel 0.4.5

Have you found anything relevant by searching the web?

Same issue is seen here, but no resolution in sight
https://github.com/bazelbuild/bazel/issues/2939

Anything else, information or logs or outputs that would be helpful?

(If they are large, please upload as attachment or provide link).

Most helpful comment

Turns out this was the OOM killer, the CI machines were running out of memory during the Bazel run.

All 9 comments

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 \ on the second of the SIGKILL would be as effective as it is dirty, also, imo.

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ob picture ob  路  3Comments

sandipmgiri picture sandipmgiri  路  3Comments

davidzchen picture davidzchen  路  3Comments

kastiglione picture kastiglione  路  3Comments

f1recracker picture f1recracker  路  3Comments