mongodb-memory-server: GenericMMSError: Instance failed to start within 10000ms

Versions

  • NodeJS: 18.15.0
  • mongodb-memory-server-*: ^8.13.0
  • mongodb: 5.5.0,
  • mongoose: 7.1.1
  • system: Linux container (FROM --platform=linux/amd64 node:18.15.0)
  • process.arch: x64

package: mongo-memory-server

What is your question?

when I write this following code

const mongod = await MongoMemoryServer.create();
const mongoUri = mongod.getUri();

I get the following error

Starting the MongoMemoryServer Instance failed, enable debug log for more information. Error:
     GenericMMSError: Instance failed to start within 10000ms
        at Timeout.<anonymous> (/opt/tbo/node_modules/mongodb-memory-server-core/src/util/MongoInstance.ts:365:21)
        at listOnTimeout (node:internal/timers:569:17)
        at processTimers (node:internal/timers:512:7)

      at MongoMemoryServer.<anonymous> (../node_modules/mongodb-memory-server-core/src/MongoMemoryServer.ts:293:17)
      at ../node_modules/tslib/tslib.js:167:75
      at __awaiter (../node_modules/tslib/tslib.js:163:16)
      at ../node_modules/mongodb-memory-server-core/src/MongoMemoryServer.ts:284:68

Note: I am running docker container over m1 chip(arm64 processor).

how can I overcome these errors ?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15

Most upvoted comments

and as dar as I know, that is Debian 10, and Mongo is not listing any Debian 10 ARM 64 archive

the ubuntu binaries can be used in a debian image from my knowledge

mongodb-linux-aarch64-amazon2-5.0.18.tgz

you should not use amazon2 builds for ubuntu

I mean, the error is different tho, but it still not working.

if you want to post it you can

Is enought what I did or I need to overwrite that too?

Docs:

ARCHIVE_NAME This Option does not have a effect when DOWNLOAD_URL is defined.

I tried it using arm64 in devcontainers also and nope. I mean, the error is different tho, but it still not working.

if the container you are running MMS in is arm64, then i dont know why the mongo container works but this not, maybe post the full debug log of when you are running a arm64 container with MMS and have ARCHIVE_NAME overwritten (or DOWNLOAD_URL)

Note: i dont have a ARM64 system to test this on (and also no mac)

mongodb: 5.5.0,

i am pretty sure the template had some extra notes. assuming from the version 5.5.0 this is the driver not the binary

system: Linux container (FROM --platform=linux/amd64 node:18.15.0)

a note to self: docker image node:18.15.0 is based on debian:11, 11.6, bullseye

Note: I am running docker container over m1 chip(arm64 processor).

docker currently shipped qemu version does not support AVX instructions, which mongodb requires since 5.0 (and mongodb-memory-server’s current default is a 5.x version), see https://github.com/nodkz/mongodb-memory-server/issues/710

 GenericMMSError: Instance failed to start within 10000ms

this error should not happen and throw a actual error, could you post the full log of when this error occurs with debug logs enabled?


assuming you are using a mac with arm and running x86 docker, then your only options are:

  • downgrade to a 4.x mongodb version, see config option: VERSION
  • compile docker yourself (or somehow replace the used qemu version)
  • dont use docker (and either run a manual mongodb instance or run mongodb-memory-server outside of docker)