7

I am trying to restart my docker containers after upgrading my system yesterday. I am running an sbt (scala build tool) container. Unfortunately, it stopped working with the following error

library initialization failed - unable to allocate file descriptor table - out of memory/usr/share/sbt/bin/sbt-launch-lib.bash: line 46:    76 Aborted                 (core dumped) "$@"

I then found out that any java application I have dockerized stopped working. So I tried running a simple tomcat. The result is below (clipped at the bottom because it's hundreds of lines of [Too many errors, abort]

docker run -it --rm tomcat:8.0                                                                                                                                             
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /docker-java-home/jre
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
library initialization failed - unable to allocate file descriptor table - out of memory#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fb6b7b3e532, pid=1, tid=140422755079936
#
# JRE version: OpenJDK Runtime Environment (7.0_181-b01) (build 1.7.0_181-b01)
# Java VM: OpenJDK 64-Bit Server VM (24.181-b01 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea 2.6.14
# Distribution: Debian GNU/Linux 8.10 (jessie), package 7u181-2.6.14-1~deb8u1
# Problematic frame:
# C  [libc.so.6+0x36532]  abort+0x232
#
# Core dump written. Default location: /usr/local/tomcat/core or core.1
#
# An error report file with more information is saved as:
# /usr/local/tomcat/hs_err_pid1.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

I found this post just now which seems to be a trace that someone else has suffered similar issues in the recent arch release

https://github.com/neo4j/docker-neo4j/issues/155#issuecomment-471728441

2 Answers 2

15

Running the tomcat works when changing the ulimit on the container with

docker run -it --ulimit nofile=122880:122880 -m 3G --rm tomcat:8.0

I found out (because my /etc folder is managed with a git repo) that there was a line change in

systemd/system.conf 
  55│ #DefaultLimitNOFILE=1024:524288

It seems that systemd changed the DefaultLimitNOFile and this triggers my issues.

This article describes how to set the ulimit for docker. That however didn't cut it for me. I had to set

ExecStart=/usr/bin/dockerd --default-ulimit nofile=65536:65536 -H fd://

inside of /etc/systemd/system/docker.service Note the --default-ulimit flag which applies to each call of docker.

1
  • Thank you! For those who don't have any docker overrides on their install yet, follow this excellent walkthrough on updating this askubuntu.com/a/659268/299606 Commented Jul 4, 2021 at 23:31
0

Login to the Docker container using the command docker exec -it imagename bash and input the command ulimit -n 65536

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Mar 11 at 13:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .