shelfio / jest-mongodb

Jest preset for MongoDB in-memory server
MIT License
587 stars 83 forks source link

StdoutInstanceError: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1" #408

Closed MichaelJCole closed 1 year ago

MichaelJCole commented 1 year ago

Hi, cool project. I tried using it, but got an error. I googled for some ways to install libcrypto, but nothing worked. I'm using Ubuntu 22.04

Here's the error:

Determining test suites to run...Starting the MongoMemoryServer Instance failed, enable debug log for more information. Error:
 StdoutInstanceError: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"
    at MongoInstance.checkErrorInLine (/home/michael/casefile/node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:368:62)
    at MongoInstance.stderrHandler (/home/michael/casefile/node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:290:14)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

  ● Test suite failed to run

    Jest: Got error running globalSetup - /home/michael/casefile/node_modules/@shelf/jest-mongodb/lib/setup.js, reason: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"

      at MongoInstance.checkErrorInLine (../node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:368:62)
      at MongoInstance.stderrHandler (../node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:290:14)

This repo is a good reproduction of the libcrypto problem on Ubuntu 22.04. I tried changing the version to 5.0.14 and same-same.

https://github.com/renatops1991/clean-code-api

What am I missing?

I have mongo running in a docker instance - that would be so much easier and more secure to deploy than downloading the images - is that a possibility?

Thank you!

p.s. I cross posted here: https://www.mongodb.com/community/forums/t/jest-mongo-and-ubuntu-22-04/208722

hasezoey commented 1 year ago

this might be a duplicate of #351

MichaelJCole commented 1 year ago

Mongo's support said Mongo 6 already supports Ubuntu, but the docs haven't been updated.

borodedamie commented 1 year ago

hi @MichaelJCole I know this issue is closed, but were you able to resolve the issue and how did you go about it? I am currently experiencing the same error using Ubuntu 22.04 on WSL 2. I have been able to install mongoDB successfully on the machine and libssl1.1 is installed on the machine as well, but I just can't get mongodb-memory-server to work. I am using version 8.12.2.

hasezoey commented 1 year ago

@borodedamie what is you exact error / issue?

borodedamie commented 1 year ago

@hasezoey "library is missing or cannot be opened: "libcrypto.so.1.1", so I downgraded my ubuntu from 22.04 to 18.04 and it works now. Thank you for the prompt response.

MichaelJCole commented 1 year ago

Hi @borodedamie I gave up on this approach and use a mongodb cluster from a docker-compose.yaml file now. I also gave up on WSL2 after a bunch of frustration and went back to using Linux Mint which also saved some frustration. Anyways, hope you figure it out - best of luck to you!