silaev / mongodb-replica-set

Run MongoDB Atlas locally for testing
Other
45 stars 6 forks source link

Not working with mongo 6 #16

Open vlad-ogol opened 1 year ago

vlad-ogol commented 1 year ago

Upgrading the mongo container from 5.0.6 to 6.0.8 in the following builder causes the problem.

private final MongoDbReplicaSet mongoDbReplicaSet = MongoDbReplicaSet.builder()
        .mongoDockerImageName("mongo:5.0.6")
        .build();

Exception:

2023-08-17 11:11:10.635 |Test worker| ERROR |o.s.boot.SpringApplication| Application run failed
com.github.silaev.mongodb.replicaset.exception.MongoNodeInitializationException: Error occurred while initializing a master node: OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "mongo": executable file not found in $PATH: unknown

    at com.github.silaev.mongodb.replicaset.MongoDbReplicaSet.checkMongoNodeExitCodeAndStatus(MongoDbReplicaSet.java:526) ~[mongodb-replica-set-0.4.3.jar:na]
    at com.github.silaev.mongodb.replicaset.MongoDbReplicaSet.initMasterNode(MongoDbReplicaSet.java:372) ~[mongodb-replica-set-0.4.3.jar:na]
    at com.github.silaev.mongodb.replicaset.MongoDbReplicaSet.startInternal(MongoDbReplicaSet.java:290) ~[mongodb-replica-set-0.4.3.jar:na]
    at com.github.silaev.mongodb.replicaset.MongoDbReplicaSet.start(MongoDbReplicaSet.java:249) ~[mongodb-replica-set-0.4.3.jar:na]
    ... 97 common frames omitted

I believe the high level reason is that Legacy mongo Shell Removed, but perhaps there might be some other things on the lower levels.