mongo: Mongo 5.0.0 crashes but 4.4.6 works
EDIT: conclusion here https://github.com/docker-library/mongo/issues/485#issuecomment-891991814
Already tried too many things and 5.0.0 (or latest) won’t work on my Debian distro but it works fine on WSL2 (also Debian) for some reason. If I specify the 4.4.6 version it works great.
The latest version wont go up and will go on a restart loop. Docker logs are empty as well so I couldn’t see what was happening.
My docker-compose.yml:
version: "3.8"
services:
mongodb:
image : mongo:latest
container_name: mongodb
environment:
- PUID=1000
- PGID=1000
volumes:
- /home/roadside/mongodb/database:/data/db
ports:
- 27017:27017
restart: unless-stopped
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 26 (5 by maintainers)
Links to this issue
Commits related to this issue
- :arrow_down: downgrade mongo image from latest to 4.4.6 * https://github.com/docker-library/mongo/issues/485 — committed to Puh00/toru-bot by Puh00 3 years ago
- Changed mongo image version to 4.4.13 due to CPU core issues; cf https://github.com/docker-library/mongo/issues/485 — committed to oth-datapipeline/infrastructure by dnzxy 2 years ago
- mongo 5.0.0 crashes without AVX: https://github.com/docker-library/mongo/issues/485 — committed to naadev/nl-chaos by deleted user 2 years ago
- Role back to Mongo 4.4 for RaspberyPi 4 support Was getting warnings: WARNING: MongoDB 5.0+ requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common featu... — committed to jness/dungeon_brawl by jness a year ago
- chore: get back to mongo 4.4 on docker-compose on mongo 5 I get this error on M1: galoy-mongodb-1 | galoy-mongodb-1 | WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system... — committed to GaloyMoney/blink by deleted user a year ago
- Update docker-compose.yml To use the `4.4.6` of `mongo`. See https://github.com/docker-library/mongo/issues/485. — committed to serlo/api.serlo.org by eliflores 10 months ago
Thanks @martadinata666 for the link.
Summary:
What does this mean for the
mongo
image? We currently consume the apt packages and windows downloads as provided by upstream and have no plans to compile them from source.Can also attest that
mongo:latest
no longer works and had to downgrade to4.4.6
for the image to work on Raspberry Pi 4 (running Ubuntu Server 21.04).@martadinata666 Thanks for this info - verified on my three boxes:
Ubuntu 20.04. on Intel P8600: no avx - mongo:5 is not able to run. Windows 10 with Docker running in HyperV on Intel Core i5-4310M: checked from within a docker-container: avx2 available - mongo:5 is running Debian 10 on AMD Ryzen Threadripper 1920X: avx2 available - mongo:5 is running
Here the complete list of flags supported by my CPUs:
status: mongo:5 not working model name : Intel® Core™2 Duo CPU P8600 @ 2.40GHz flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl cpuid aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm pti tpr_shadow vnmi flexpriority dtherm ida
status: mongo:5 working model name : AMD Ryzen Threadripper 1920X 12-Core Processor flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xsaves clzero arat overflow_recov succor
status: mongo:5 working model name : Intel® Core™ i5-4310M CPU @ 2.70GHz flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single ssbd ibrs ibpb stibp fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt flush_l1d arch_capabilities
seems
avx
cpu feature needed to run mongo5, can somebody can confirm this?cat /proc/cpuinfo | grep --color avx
Set the cpu type to host in the hardware settings of the vm. That gives avx into the processor flags and mongodb will start.
For anyone else trying to get mongodb working on older CPUs, I went down this rabbit hole earlier today.
My approach was to build from source, as mentioned at https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2
I wasn’t sure of creating a clean build environment, so I used the scripts and docker image from https://github.com/meteor/mongodb-builder with two small adjustments:
My test run took about 1h30 on my desktop machine, and I ended up with a .tgz file that looks promising:
Edit: I added the two lines below to my docker-compose.yml file that I use for mongodb, to use my binaries rather than the ones in the docker image, and the image now seems to start up correctly (as far as I can tell):
Hi, I also encounter this error.
I notice it happens after Ubuntu upgrade : containerd.io:amd64 (1.4.6-1, 1.4.8-1). I tried to downgrade to 1.4.6 without success.
Ubuuntu 20.04 (happens on 5.4.0-77-generic) :
Linux ns******.eu 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Packages updated :
I can run bash but cannot exec docker entrypoint :
Added datapoint: this also affects the ARM64 builds.
https://docs.mongodb.com/manual/administration/production-notes/#arm64