Core dump on MongoDB 5.0 on RPi 4

Hi all,

I’m currently attempting to install a local MongoDB deployment with version 5.0, but am getting the following error when attempting to start the service:

“mongod.service: Main process exited, code=dumped, status=4/ILL”

Trying to just run “mongo” gives the error “Illegal instruction (core dumped)”.

I’ve attached a picture of the fuller status when I take a peek at the service after attempting to start it. Currently I’m attempting to install this on a 64-bit installation of Ubuntu 20.04 on a raspberry pi 4. I’m able to successfully install 4.4.6 without issue, but 5.0 gives me the following:

It looks like it’s trying to point me to status code 4 here:

However, trying to look around a bit more for this error code online doesn’t lead me to much. I get this error even when attempting a totally fresh install of 5.0 with no preexisting databases. I also have not changed the config file away from default.

Thanks very much in advance! And apologies if this is in the wrong section of the forum. This is my first time posting here and I’ve tried to put it in the section that I thought was most relevant to the question.

1 Like

Welcome to the MongoDB Community Forums @Heiaha !

Can you check your MongoDB log file for more context leading up to the shutdown message (and share the relevant log lines)?

Also, which Raspberry Pi 4 model do you have: 2, 4, or 8 GB RAM?

Thanks,
Stennie

@Heiaha Do you get any solution fot this issue? I also have this issue… i can’t get any solution yet…

Hi @ajay_ps,

Are you also using MongoDB 5.0 on a Raspberry Pi 4? If not, please start a new topic with more details about your environment including specific your specific versions of MongoDB, O/S, and hardware architecture (eg arm64, x64, …). It would also be helpful to include any relevant log messages prior to the mongod process shutting down.

If you definitely have a similar environment and might be encountering the same issue (for example, identical exit code), you could post a log snippet here to help correlate the issues.

However, generally it is best to start a separate topic so we can focus on your issue rather than combining discussions that may be addressing different issues.

Thanks,
Stennie

I’m having the same issue
Raspberry Pi 4, 4GB RAM, 256GB SD card with Ubuntu 20.04

1 Like

Hi @Stennie_X. Sorry for the late response. While I have the log file set to the default value in the config file (/var/log/mongodb/mongod.log), that file appears to not exist. It may perhaps be the case that mongo crashes before creating a log during its first startup? The relevant directory (/var/log/mongodb/) appears to exist but is empty.

Also, I am running on a Raspberry Pi 4 Model B with 4 GB RAM.

Thanks!

@Stennie_X I am using Mongo DB 5.0.0_amd64.deb
On ubuntu 20.04.2 LTS, OS type 64-bit , GNOME version 3.36.8, windowing system ×11 , processor -
Intel pentium (R) CPU G2010 @2.80GHZ×2,
4 GB ram.

Just to be thorough, even though I don’t think it should matter much: I’ve replaced the Raspberry Pi stock micro SD with a larger Samsung EVO microSD and am running Ubuntu 20.04 instead of the stock Pi distribution.

That’s exactly what’s happening to me as well, that’s why I included the ls commands on my screenshot
This is a fresh, first time install, and it still doesn’t work…

Same here:

  • Raspberry Pi 4B, 8G RAM, 64GB SD
  • Ubuntu 20.04.2 LTS

Same here:

  • Raspberry Pi 4B, 8GB RAM, 32GB SD
  • Ubuntu 20.04.2 LTS Server

Hi Folks,

I’ve tracked down this issue to a change in the arm64 microarchitecture requirements for MongoDB 5.0 packages. MongoDB 5.0 requires ARM v8.2-A or later and the Raspberry Pi 4 uses an ARM Cortex-A72 which is ARM v8-A.

Unfortunately this means the pre-built packages for MongoDB 5.0 will not support Raspberry Pi 4.

However, you should be able to build from source by adding CCFLAGS-march=armv8 to the SCons invocation. See Building MongoDB for full instructions.

If building from source is a daunting prospect, an alternative would be to install the latest ARM 64 package of MongoDB 4.4.

Regards,
Stennie

2 Likes

Hi @Stennie_X,

Ahh, that’s understandable. I think most RPi4 folks probably will have a hard time doing that if I’m reading the build guide correctly and 600 GB is required. Thanks very much for looking into this!

Hi @Heiaha,

The large sizes are for debug builds. Stripped binaries (as shipped in the install packages) are much smaller. The strip utility can be used to remove debug info, but you will need some working space to compile. I would choose the most minimal SCons target you need, for example install-mongod.

If you have access to a better resourced desktop machine you can cross-compile for RPi4. Instructions should be similar to cross-compiling MongoDB v4.4 but I don’t have an Rpi4 handy to test the build process or outcomes.

Assuming your requirement isn’t to try out some of the new 5.0 features, the most straightforward path would be to install the pre-built MongoDB 4.4 packages :wink:

Regards,
Stennie

2 Likes

Please note that the native and cross-compilation instructions that @Stennie_X linked to already include the --separate-debug flag, which will already split out the debug symbols into separate files. So you will get reasonably sized binaries from those processes. You can shrink those binaries a little further yet with strip, but I don’t necessarily recommend this, as it will strip out symbol table information that will result in uninterpretable backtraces should the process crash, and the savings aren’t that big. You do still need a lot of storage space to actually build (and a lot of cores if you want reasonable build throughput), which is why I really commend going the cross-compile path if you can. The RPi just isn’t suited to building software of this size from source. The cross-compilation instructions aren’t particularly challenging, and you just need access to a reasonably performant x86_64 machine running Ubuntu to do it.

2 Likes

I have the same situation here, RPi 4 with ubuntu and the exact error code. After installing MongoDB 4.4.8, works perfectly for me.

Thank you, guys!

1 Like