typegoose / mongodb-memory-server

Manage & spin up mongodb server binaries with zero(or slight) configuration for tests.
https://typegoose.github.io/mongodb-memory-server/
MIT License
2.56k stars 185 forks source link

9.1.8 not working out of the box for node:20 docker (LTS images) #861

Closed darkalor closed 5 months ago

darkalor commented 5 months ago

Versions

package: mongo-memory-server

What is the Problem?

On current node LTS (20) docker image (https://hub.docker.com/_/node), which is Debian 12 based 9.1.8 is no longer starting up correctly.

9.1.7 worked fine, although it needed the old libcrypto.

9.1.8 fails with

     Error: Requested Version "6.0.9" is not available for "Debian 12"! Available Versions: ">=7.0.3"
Mongodb does not provide binaries for versions before 7.0.3 for Debian 12+ and also cannot be mapped to a previous Debian release

I.e. with the default config it tries to use an invalid mongo version (which isn't that invalid since it worked in 8.1.7).

Code Example

  mongod = await MongoMemoryServer.create();

Note: no custom config or anything else set for versions

Debug Output

N/A

Do you know why it happenes?

🤷

darkalor commented 5 months ago

9.1.7 worked fine, although it needed the old libcrypto.

To elaborate, I was using this, which isn't the cleanest option but it worked for test CI jobs

- wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
- dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
hasezoey commented 5 months ago

version 9.1.8 added support for debian 12 without having to use workarounds, which results in this error as there are no "native" binaries for debian 12 for the requested version.

possible fixes (from most to least recommended):

PS: this change was seen as a "patch" as the previous way would require the user to use a workaround (installing a 3rd party package not in the distros repo)

darkalor commented 5 months ago

Would it make sense to at least adjust the default version that mongo-memory-server is trying to set up on Debian 12? Currently that defaults to 6.something, which isn't supported on that platform, so it's kind of pointless that it gets downloaded and then just throws an error.

hasezoey commented 5 months ago

we currently dont to distro-specific versions, otherwise see When a (mongodb) Version gets upgraded

darkalor commented 5 months ago

Got it, thank you for the clarification. 👍