flapdoodle-oss / de.flapdoodle.embed.mongo

...will provide a platform neutral way for running mongodb in unittests.
Apache License 2.0
910 stars 160 forks source link

Process starts locally but fails in docker container #474

Closed t0ry closed 1 year ago

t0ry commented 1 year ago

Hi there,

I'm experiencing the next problem.

Setup is the following:

This setup runs in docker container as expected.

On Change in application-test.properties : de.flapdoodle.mongodb.embedded.version=5.0.5 gradle componentTest runs as expected locally (Unbuntu 18) but fails in docker container with the following stack trace:

Caused by: java.lang.RuntimeException: error on transition to State(de.flapdoodle.embed.mongo.transitions.RunningMongodProcess), rollback
    at de.flapdoodle.reverse.TransitionWalker.initState(TransitionWalker.java:174)
    at de.flapdoodle.reverse.TransitionWalker.initState(TransitionWalker.java:69)
    at de.flapdoodle.embed.mongo.spring.autoconfigure.MongodWrapper.start(MongodWrapper.java:45)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1861)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1818)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1758)
    ... 138 more
Caused by: java.lang.RuntimeException: Could not start process: 
----------------------
Hmm.. no failure message.. 
...the cause must be somewhere in the process output
----------------------

    at de.flapdoodle.embed.mongo.transitions.RunningMongoProcess.lambda$null$1(RunningMongoProcess.java:179)
    at de.flapdoodle.types.ThrowingSupplier.lambda$andFinally$1(ThrowingSupplier.java:47)
    at de.flapdoodle.types.ThrowingSupplier.lambda$andFinally$1(ThrowingSupplier.java:47)
    at de.flapdoodle.embed.mongo.transitions.RunningMongoProcess.lambda$factory$3(RunningMongoProcess.java:185)
    at de.flapdoodle.embed.process.types.RunningProcess.start(RunningProcess.java:78)
    at de.flapdoodle.embed.mongo.transitions.MongoServerStarter.result(MongoServerStarter.java:119)
    at de.flapdoodle.reverse.TransitionWalker.resolve(TransitionWalker.java:62)
    at de.flapdoodle.reverse.TransitionWalker.resolve(TransitionWalker.java:50)
    at de.flapdoodle.reverse.TransitionWalker.initState(TransitionWalker.java:165)

Any ideas?

Thanks in advance

t0ry commented 1 year ago

Scavenging through other issues I found the problem was in de.flapdoodle.mongodb.embedded.version < 6.0.4 so setting de.flapdoodle.mongodb.embedded.version=6.0.4 did the trick.

Details are here https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo/issues/395#issuecomment-1638331115

Closing issue then