Skip to content

[Bug]: MongoDB crashes because ulimit is too low #10150

@CLOVIS-AI

Description

@CLOVIS-AI

Module

MongoDB

Testcontainers version

1.19.8

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host Arch

x86

Docker version

Docker version 28.0.1, build 068a01ea94

What happened?

MongoDB crashes while the tests are running.

Relevant log output

{"t":{"$date":"2025-03-28T10:47:39.000+00:00"},"s":"E",  "c":"ASSERT",   "id":23077,   "ctx":"ftdc","msg":"Assertion","attr":{"error":"Location13538: couldn't open [/proc/1/stat] Too many open files","file":"src/mongo/util/processinfo_linux.cpp","line":83}}
{"t":{"$date":"2025-03-28T10:47:39.282+00:00"},"s":"E",  "c":"WT",       "id":22435,   "ctx":"conn24","msg":"WiredTiger error message","attr":{"error":24,"message":{"ts_sec":1743158859,"ts_usec":282251,"thread":"1:0x7142a7603640","session_name":"WT_SESSION.create","category":"WT_VERB_DEFAULT","category_id":9,"verbose_level":"ERROR","verbose_level_id":-3,"msg":"__posix_directory_sync:135:/data/db/: directory-sync: open","error_str":"Too many open files","error_code":24}}}
{"t":{"$date":"2025-03-28T10:47:39.282+00:00"},"s":"E",  "c":"WT",       "id":22435,   "ctx":"conn24","msg":"WiredTiger error message","attr":{"error":24,"message":{"ts_sec":1743158859,"ts_usec":282319,"thread":"1:0x7142a7603640","session_name":"WT_SESSION.create","category":"WT_VERB_DEFAULT","category_id":9,"verbose_level":"ERROR","verbose_level_id":-3,"msg":"__posix_directory_sync:151:/data/db/collection-945-3757964622610459637.wt: directory-sync","error_str":"Too many open files","error_code":24}}}
{"t":{"$date":"2025-03-28T10:47:39.282+00:00"},"s":"E",  "c":"WT",       "id":22435,   "ctx":"conn24","msg":"WiredTiger error message","attr":{"error":-31804,"message":{"ts_sec":1743158859,"ts_usec":282337,"thread":"1:0x7142a7603640","session_name":"WT_SESSION.create","category":"WT_VERB_DEFAULT","category_id":9,"verbose_level":"ERROR","verbose_level_id":-3,"msg":"__posix_directory_sync:151:the process must exit and restart","error_str":"WT_PANIC: WiredTiger library panic","error_code":-31804}}}
{"t":{"$date":"2025-03-28T10:47:39.282+00:00"},"s":"F",  "c":"ASSERT",   "id":23089,   "ctx":"conn24","msg":"Fatal assertion","attr":{"msgid":50853,"file":"src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp","line":741}}
{"t":{"$date":"2025-03-28T10:47:39.282+00:00"},"s":"F",  "c":"ASSERT",   "id":23090,   "ctx":"conn24","msg":"\n\n***aborting after fassert() failure\n\n"}
{"t":{"$date":"2025-03-28T10:47:39.282+00:00"},"s":"F",  "c":"CONTROL",  "id":6384300, "ctx":"conn24","msg":"Writing fatal message","attr":{"message":"\n"}}
{"t":{"$date":"2025-03-28T10:47:39.282+00:00"},"s":"F",  "c":"CONTROL",  "id":6384300, "ctx":"conn24","msg":"Writing fatal message","attr":{"message":"Got signal: 6 (Aborted).\n"}}

Additional Information

MongoDB recommends setting ulimit -n 64000, which is much more than Docker's default of 1024.

In a docker-compose file, I can use:

        ulimits:
            nofile: 64000

to increase the file ulimit. However, I can't find a way to do so with testcontainers-java.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions