Mohammadreza Khedri
Mohammadreza Khedri

Reputation: 2711

Error when running mongo image - docker-entrypoint.sh: line 381

After installing Ubuntu v20 and then installing docker:

$ docker network create test-network

$ docker pull mongo:latest

$ docker run --network test-network --name mongodb \
    -e MONGO_INITDB_ROOT_USERNAME=admin \
    -e MONGO_INITDB_ROOT_PASSWORD=pawwrord \
    mongo

I got an error like this:

/usr/local/bin/docker-entrypoint.sh: line 381:    25 Illegal instruction     (core dumped) "${mongodHackedArgs[@]}" --fork

Do you know what the problem is? I need some guidance to investigate the issue.

UPDATE

I don't have any problem with other tags.

Specifically, only when I want to run Mongo with the latest tag, I got this error.

Upvotes: 13

Views: 13010

Answers (3)

moodboom
moodboom

Reputation: 6912

It's a shortcoming in the available instructions of your CPU. Mongo 5.0 requires CPU instructions only available in Sandy Bridge era or more recent.

I had this problem using a Proxmox VM, which defaults to a simpler virtual CPU. Simply changing the virtual CPU to type "host" fixed the problem, by allowing the VM CPU to include all the instructions of the host CPU.

If you are running directly on metal, you'll need a newer CPU. Good luck!

Upvotes: 5

D. SM
D. SM

Reputation: 14520

MongoDB 5.0 requires a Sandy Bridge or newer CPU. Get a newer processor or use an older version of MongoDB.

https://jira.mongodb.org/browse/SERVER-54407

Upvotes: 16

adam syarif
adam syarif

Reputation: 119

I have exactly same problem with yours, i try to run on my local computer work but not in VM.

thanks to this I simply changed mongo's version to 4.4 from latest which is 5.0 and running well. Maybe need newer CPU

Upvotes: 11

Related Questions