question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: MongoDBContainer stuck at waiting for connection

See original GitHub issue

Module

MongoDB

Testcontainers version

1.16.3

Using the latest Testcontainers version?

Yes

Host OS

linux

Host Arch

x86_64

Docker version

20.10.11

What happened?

Hi

We are using GitHub runner. and our runners get stuck in the integration test phase.
Runners are self-hosted.

Our test uses both kafka testcontainer and mongo testcontainer. Kafka containers get started and the topic gets subscribed . However, for mongo container is stuck waiting for connections. Below is the code for how we start the mongo container. mongoDBContainer.start();

            // Create Mongo client
            mongoClient = MongoClients.create(mongoDBContainer.getReplicaSetUrl());

            // Set mongo uri property for the application context to load
            System.setProperty(mongoUriProperty, mongoDBContainer.getReplicaSetUrl());

The runner is stuck at : Container mongo:5.0.8 is starting: d6121e455a0b3775e4a8b3489f01e585a0649e55eadcda94351d608c6b6e0a05

I have enabled debug logs

21:45:35.883 [main] DEBUG docker[mongo:5.0.8] - Starting container: mongo:5.0.8
21:45:35.884 [main] DEBUG docker[mongo:5.0.8] - Trying to start container: mongo:5.0.8 (attempt 1/1)
21:45:35.884 [main] DEBUG docker[mongo:5.0.8] - Starting container: mongo:5.0.8
21:45:35.884 [main] INFO docker[mongo:5.0.8] - Creating container for image: mongo:5.0.8
21:45:35.884 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: mongo:5.0.8 at registry: index.docker.io
21:45:35.884 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - No matching Auth Configs - falling back to defaultAuthConfig [null]
21:45:35.884 [main] DEBUG org.testcontainers.dockerclient.AuthDelegatingDockerClientConfig - Effective auth config [null]
21:45:35.897 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: org.testcontainers.shaded.com.github.dockerjava.core.command.CreateContainerCmdImpl@7b29b052[name=<null>,hostName=<null>,domainName=<null>,user=<null>,attachStdin=<null>,attachStdout=<null>,attachStderr=<null>,portSpecs=<null>,tty=<null>,stdinOpen=<null>,stdInOnce=<null>,env={},cmd={--replSet,docker-rs},healthcheck=<null>,argsEscaped=<null>,entrypoint=<null>,image=mongo:5.0.8,volumes=com.github.dockerjava.api.model.Volumes@5ef4161a,workingDir=<null>,macAddress=<null>,onBuild=<null>,networkDisabled=<null>,exposedPorts=com.github.dockerjava.api.model.ExposedPorts@1325a2ba,stopSignal=<null>,stopTimeout=<null>,hostConfig=HostConfig(binds=[], blkioWeight=null, blkioWeightDevice=null, blkioDeviceReadBps=null, blkioDeviceWriteBps=null, blkioDeviceReadIOps=null, blkioDeviceWriteIOps=null, memorySwappiness=null, nanoCPUs=null, capAdd=null, capDrop=null, containerIDFile=null, cpuPeriod=null, cpuRealtimePeriod=null, cpuRealtimeRuntime=null, cpuShares=null, cpuQuota=null, cpusetCpus=null, cpusetMems=null, devices=null, deviceCgroupRules=null, deviceRequests=null, diskQuota=null, dns=null, dnsOptions=null, dnsSearch=null, extraHosts=[], groupAdd=null, ipcMode=null, cgroup=null, links=[], logConfig=LogConfig(type=null, config=null), lxcConf=null, memory=null, memorySwap=null, memoryReservation=null, kernelMemory=null, networkMode=null, oomKillDisable=null, init=null, autoRemove=null, oomScoreAdj=null, portBindings={}, privileged=null, publishAllPorts=true, readonlyRootfs=null, restartPolicy=null, ulimits=null, cpuCount=null, cpuPercent=null, ioMaximumIOps=null, ioMaximumBandwidth=null, volumesFrom=[], mounts=null, pidMode=null, isolation=null, securityOpts=null, storageOpt=null, cgroupParent=null, volumeDriver=null, shmSize=null, pidsLimit=null, runtime=null, tmpFs=null, utSMode=null, usernsMode=null, sysctls=null, consoleSize=null),labels={org.testcontainers=true, org.testcontainers.sessionId=b3cedfae-4aee-4691-ad1f-c6862fa5e527},shell=<null>,networkingConfig=<null>,ipv4Address=<null>,ipv6Address=<null>,aliases=<null>,authConfig=<null>]
21:45:36.944 [main] INFO docker[mongo:5.0.8] - Starting container with ID: a2f0ef76369c6ca21b882392f7b2d6e6bd9ce5a3624c43e1283120eb39ca9cdd
21:45:36.944 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: a2f0ef76369c6ca21b882392f7b2d6e6bd9ce5a3624c43e1283120eb39ca9cdd
21:45:37.366 [main] INFO docker[mongo:5.0.8] - Container mongo:5.0.8 is starting: a2f0ef76369c6ca21b882392f7b2d6e6bd9ce5a3624c43e1283120eb39ca9cdd
21:45:37.369 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: a2f0ef76369c6ca21b882392f7b2d6e6bd9ce5a3624c43e1283120eb39ca9cdd,false
21:45:37.371 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/a2f0ef76369c6ca21b882392f7b2d6e6bd9ce5a3624c43e1283120eb39ca9cdd/json], queryParams={}}
21:45:37.515 [ducttape-0] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: a2f0ef76369c6ca21b882392f7b2d6e6bd9ce5a3624c43e1283120eb39ca9cdd,false
21:45:37.515 [ducttape-0] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/a2f0ef76369c6ca21b882392f7b2d6e6bd9ce5a3624c43e1283120eb39ca9cdd/json], queryParams={}}
21:45:37.539 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.473+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"-","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
21:45:37.549 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.486+00:00"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=7400M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress,compact_progress],"}}
21:45:37.550 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.483+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"},"replication":{"replSet":"docker-rs"}}}}
21:45:37.550 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.483+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
21:45:37.550 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.483+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"5.0.8","gitVersion":"c87e1c23421bf79614baf500fda6622bd90f674e","openSSLVersion":"OpenSSL 1.1.1f  31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
21:45:37.550 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.483+00:00"},"s":"I",  "c":"CONTROL",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"a2f0ef76369c"}}
21:45:37.550 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.482+00:00"},"s":"I",  "c":"CONTROL",  "id":5945603, "ctx":"main","msg":"Multi threading initialized"}
21:45:37.550 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.482+00:00"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","ns":"config.tenantMigrationRecipients"}}
21:45:37.550 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.482+00:00"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","ns":"config.tenantMigrationDonors"}}
21:45:37.550 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.482+00:00"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
21:45:37.550 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.482+00:00"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
21:45:37.551 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.480+00:00"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
21:45:37.551 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.478+00:00"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
21:45:37.551 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:37.476+00:00"},"s":"I",  "c":"NETWORK",  "id":4915701, "ctx":"-","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":13},"outgoing":{"minWireVersion":0,"maxWireVersion":13},"isInternalClient":true}}}
21:45:38.242 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.241+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1658958338:241807][1:0x7fe68db2cc80], txn-recover: [WT_VERB_RECOVERY_ALL] Set global recovery timestamp: (0, 0)"}}
21:45:38.253 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.241+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1658958338:241879][1:0x7fe68db2cc80], txn-recover: [WT_VERB_RECOVERY_ALL] Set global oldest timestamp: (0, 0)"}}
21:45:38.267 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.254+00:00"},"s":"I",  "c":"RECOVERY", "id":23987,   "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
21:45:38.267 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.254+00:00"},"s":"I",  "c":"STORAGE",  "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":768}}
21:45:38.292 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.291+00:00"},"s":"I",  "c":"STORAGE",  "id":4366408, "ctx":"initandlisten","msg":"No table logging settings modifications are required for existing WiredTiger tables","attr":{"loggingEnabled":false}}
21:45:38.293 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.292+00:00"},"s":"I",  "c":"STORAGE",  "id":22262,   "ctx":"initandlisten","msg":"Timestamp monitor starting"}
21:45:38.318 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.317+00:00"},"s":"W",  "c":"CONTROL",  "id":22120,   "ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
21:45:38.329 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.327+00:00"},"s":"I",  "c":"FTDC",     "id":20625,   "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}}
21:45:38.329 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.327+00:00"},"s":"I",  "c":"SHARDING", "id":20997,   "ctx":"initandlisten","msg":"Refreshed RWC defaults","attr":{"newDefaults":{}}}
21:45:38.329 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.325+00:00"},"s":"I",  "c":"CONTROL",  "id":20536,   "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
21:45:38.330 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.325+00:00"},"s":"I",  "c":"STORAGE",  "id":5071100, "ctx":"initandlisten","msg":"Clearing temp directory"}
21:45:38.340 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.327+00:00"},"s":"I",  "c":"STORAGE",  "id":20320,   "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"local.startup_log","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"af71f774-ad5d-440e-a31b-6dc298bc06fd"}},"options":{"capped":true,"size":10485760}}}
21:45:38.366 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.365+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"local.startup_log","index":"_id_","commitTimestamp":null}}
21:45:38.377 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.368+00:00"},"s":"I",  "c":"STORAGE",  "id":20320,   "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"local.replset.oplogTruncateAfterPoint","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"9094614d-ef7e-4519-84e8-438ec28808ee"}},"options":{}}}
21:45:38.377 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.368+00:00"},"s":"I",  "c":"REPL",     "id":4280500, "ctx":"initandlisten","msg":"Attempting to create internal replication collections"}
21:45:38.377 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.366+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"ReadConcernMajorityNotAvailableYet: Read concern majority reads are currently not possible.","nextWakeupMillis":200}}
21:45:38.377 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.366+00:00"},"s":"I",  "c":"REPL",     "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigStartingUp","oldState":"ConfigPreStart"}}
21:45:38.387 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.380+00:00"},"s":"I",  "c":"STORAGE",  "id":20320,   "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"local.replset.minvalid","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"ec63d7f9-a830-4526-bb89-92f788d2665a"}},"options":{}}}
21:45:38.388 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.380+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"local.replset.oplogTruncateAfterPoint","index":"_id_","commitTimestamp":null}}
21:45:38.398 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.393+00:00"},"s":"I",  "c":"STORAGE",  "id":20320,   "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"local.replset.election","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"b8caedb4-6174-499d-8cc4-85d57c0d2b4a"}},"options":{}}}
21:45:38.399 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.392+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"local.replset.minvalid","index":"_id_","commitTimestamp":null}}
21:45:38.409 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.404+00:00"},"s":"I",  "c":"STORAGE",  "id":20320,   "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"local.system.rollback.id","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"d5113c8a-9eb5-4a21-a96e-fb462100ee44"}},"options":{}}}
21:45:38.409 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.404+00:00"},"s":"I",  "c":"REPL",     "id":21312,   "ctx":"initandlisten","msg":"Did not find local Rollback ID document at startup. Creating one"}
21:45:38.409 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.404+00:00"},"s":"I",  "c":"REPL",     "id":4280502, "ctx":"initandlisten","msg":"Searching for local Rollback ID document"}
21:45:38.409 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.404+00:00"},"s":"I",  "c":"REPL",     "id":21311,   "ctx":"initandlisten","msg":"Did not find local initialized voted for document at startup"}
21:45:38.409 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.404+00:00"},"s":"I",  "c":"REPL",     "id":4280501, "ctx":"initandlisten","msg":"Attempting to load local voted for document"}
21:45:38.410 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.403+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"local.replset.election","index":"_id_","commitTimestamp":null}}
21:45:38.426 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.425+00:00"},"s":"I",  "c":"STORAGE",  "id":20320,   "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"local.system.views","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"ef645f1d-d4ef-4937-a88a-53b9fac99249"}},"options":{}}}
21:45:38.426 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.424+00:00"},"s":"I",  "c":"REPL",     "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigUninitialized","oldState":"ConfigStartingUp"}}
21:45:38.426 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.424+00:00"},"s":"I",  "c":"REPL",     "id":21313,   "ctx":"initandlisten","msg":"Did not find local replica set configuration document at startup","attr":{"error":{"code":47,"codeName":"NoMatchingDocument","errmsg":"Did not find replica set configuration document in local.system.replset"}}}
21:45:38.426 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.424+00:00"},"s":"I",  "c":"REPL",     "id":21531,   "ctx":"initandlisten","msg":"Initialized the rollback ID","attr":{"rbid":1}}
21:45:38.426 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.424+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"local.system.rollback.id","index":"_id_","commitTimestamp":null}}
21:45:38.443 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.442+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"local.system.views","index":"_id_","commitTimestamp":null}}
21:45:38.445 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.444+00:00"},"s":"I",  "c":"REPL",     "id":40440,   "ctx":"initandlisten","msg":"Starting the TopologyVersionObserver"}
21:45:38.445 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.445+00:00"},"s":"I",  "c":"REPL",     "id":40445,   "ctx":"TopologyVersionObserver","msg":"Started TopologyVersionObserver"}
21:45:38.448 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: {"t":{"$date":"2022-07-27T21:45:38.446+00:00"},"s":"I",  "c":"NETWORK",  "id":23016,   "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
andyspierscommented, Aug 10, 2022

We did pick up the need to update to the latest version in the earlier helpful comments but even though @shubgene was specifying the latest version of testcontainers + mongo and kafka drivers, some other dependencies were somehow pulling in some older versions of some components. After these were explicitly pinned, the issue went away and we’re back to using a 100% default config (with ryuk enabled, docker config is being auto-detected correctly)

Thanks for your help in debugging 🙂

1reaction
akozhuharovcommented, Aug 17, 2022

Just a note for any future visitors of this issue. We were getting stuck with waiting for Mongo with the same setup:

  • GH Actions controller + self hosted runner
  • JDK 11
  • Latest version of testcontainers - 1.17.3
  • Mongo image 5.0.8
  • MongoDB container was starting and the message about receiving connections was present. The biggest problem was that the tests wouldn’t fail every time - some of the runs would pass. The fix that worked was adding this before starting the container: container.waitingFor(Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(30)));
Read more comments on GitHub >

github_iconTop Results From Across the Web

MongoDB Docker container not starting properly - Replication
When the docker stack is deployed, two of the containers are up and running, but the third one is taking a long time...
Read more >
MongoDB on Docker keeps waiting for connection
Trying to put up a mongo and mongo-express on Docker, but the DB won't initiate. I am on an online course to learn....
Read more >
Cannot connect to MongoDB in docker - Server Fault
This may not help, but I noticed in the mongo client error message that it said network error while attempting to run command...
Read more >
Docker/MongoDb, stuck on "Waiting for your environment ...
When I go to https://app.forestadmin.com/projects, and click on my project, I get the error: Access forbidden You don't have access to any ...
Read more >
Kubernetes ImagePullBackOff: Troubleshooting With Examples
The ImagePull part of the ImagePullBackOff error primarily relates to your Kubernetes container runtime being unable to pull the image from a private...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found