flapdoodle-oss / de.flapdoodle.embed.mongo

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

More than one match: [Ubuntu, Amazon] - libcrypto.so.1.1: cannot open shared object file #521

Closed brunopereira7 closed 4 months ago

brunopereira7 commented 4 months ago

Hi, first of all, thanks for all the work done here :)

I'm using it for the first time, and even if it's working well on my machine: operatingSystem=OS_X, architecture=X86_64, MAC M1

Versions: SpringBoot: 3.2.5 Java 21

When I execute the same unit tests on Github/GithubActions, they fail. I've tried different combinations of the Flapdoodle and Mongodb (5.0.5, 6.0.4, 7.X) versions without success. Do you have any clues/insights?

pom.xml

<embed.mongo.version>4.13.0</embed.mongo.version>
<dependency>
      <groupId>de.flapdoodle.embed</groupId>
      <artifactId>de.flapdoodle.embed.mongo.spring3x</artifactId>
      <version>${embed.mongo.version}</version>
      <scope>test</scope>
</dependency>

application-ut.yml

de:
  flapdoodle:
    mongodb:
      embedded:
        version: 5.0.5

Execution Logs:

2024-05-24T14:32:51.165Z  WARN 458 --- [dms-plus] [           main] d.f.os.common.PeculiarityInspector       : more than one match: [Ubuntu, Amazon]
2024-05-24T14:32:51.304Z  WARN 458 --- [dms-plus] [           main] d.f.e.m.p.linux.LinuxPackageFinder       : because there is no package for GenericFeatureAwareVersion{6.0.4}:Platform{operatingSystem=Linux, architecture=X86_64} we fall back to GenericFeatureAwareVersion{6.0.4}:Platform{operatingSystem=Linux, architecture=X86_64, version=Ubuntu_20_04}
2024-05-24T14:32:52.089Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : starting...
2024-05-24T14:32:52.095Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : 0 %
2024-05-24T14:32:52.290Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : 10 %
2024-05-24T14:32:52.432Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : 20 %
2024-05-24T14:32:52.569Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : 30 %
2024-05-24T14:32:52.711Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : 40 %
2024-05-24T14:32:52.761Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : 50 %
2024-05-24T14:32:52.790Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : 60 %
2024-05-24T14:32:52.819Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : 70 %
2024-05-24T14:32:52.848Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : 80 %
2024-05-24T14:32:52.876Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : 90 %
2024-05-24T14:32:52.906Z  INFO 458 --- [dms-plus] [           main] d.f.e.m.s.autoconfigure.EmbeddedMongo    : download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz : finished
2024-05-24T14:32:54.201Z ERROR 458 --- [dms-plus] [       Thread-9] d.f.e.m.s.autoconfigure.EmbeddedMongo    : /home/runner/.embedmongo/fileSets/7390def0fbf2d121b269efb4567036d824923c16f5cfc4f87a3db439debd74f7/mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
michaelmosmann commented 4 months ago

@brunopereira7 .. the os detection can not decide which version the the right one.. (more than one match: [Ubuntu, Amazon]) .. so he use a fallback to an ubuntu version, which does not work on this linux version because libcrypto.so.1.1 is missing. If you know which linux distribution is used, you can override the os detection part (see https://github.com/flapdoodle-oss/de.flapdoodle.os?tab=readme-ov-file#run) .. if you then still get a "libcrypto.so.1.1" error message, use a newer mongodb (7.x.x)

brunopereira7 commented 4 months ago

@michaelmosmann Thanks for your comment. I will then override the os detection.

michaelmosmann commented 4 months ago

@brunopereira7 do you know which linux distribution is used? maybe there is a bug..

ygoumaz commented 2 months ago

I believe this is a bug. We were using flapdoodle version 3.5.0 before and even though two distributions were detected [Ubuntu, Amazon], it was able to fallback to one of them arbitrarely, namely Linux X86_64 Ubuntu 22.04.

Now it seems that the LinuxPackageFinder only detects the common parameters (not sure about this?), i.e. OS and architecture: V7_0:Platform{operatingSystem=Linux, architecture=X86_64} and therefore fallbacks to Ubuntu 20.04 in the end.

In our case we could override the platform to use 22.04, but we unfortunately use multiple environments (one Ubuntu 22.04 and another 20.04). Do you have any advice on how to handle this situation? Would it be possible to choose one of the distributions available detected by PeculiarityInspector?

michaelmosmann commented 2 months ago

@ygoumaz i think this is a bug, the override should happen before any detection .. do you have any logging?

michaelmosmann commented 2 months ago

@ygoumaz there is a new release.. now the best match is used, so in this case ubuntu.. maybe this solves your issue..