tutor icon indicating copy to clipboard operation
tutor copied to clipboard

MongoDB repetitive restarting on raspberry pi

Open NandishRana opened this issue 2 years ago • 2 comments

Bug description The error I am encountering is related to a failed connection to the MongoDB service. Specifically, it seems that the service responsible for initializing the LMS (Learning Management System) couldn't establish a connection to MongoDB, even after multiple attempts. As quite evident in the docker logs below, I think the issue is to do with the version compatibility (Hoping for a plausible solution or workaround)

How to reproduce Flashed the mentioned Ubuntu OS on the SD Card, booted up the and updated the system sudo apt update Installed using pipx install "tutor[full]==16.0.5" (globally) Solved issue with docker mentioned below in additional context Used tutor local launch command, Installation went on smoothly until error as mentioned below in the logging section No manual changes done to any of the files.

Environment Ubuntu Desktop 23.04 (64bit) Tutor v16.0.5 SD Card Sandisk Ultra 64 GB (micro SD XC 1, A1) Raspberry pi 4 Model B (2018) 8 GB RAM variant, ( Tutor's OpenEdX post v16 support ARM based systems) For the sake of ease, the following is the specsheet for it

  • Processor: Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1.8GHz
  • Memory: 8GB LPDDR4-3200 SDRAM
  • Connectivity: 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE, Gigabit Ethernet
  • USB: 2 USB 3.0 ports; 2 USB 2.0 ports
  • GPIO: Standard 40-pin GPIO header (fully backwards compatible with previous boards)
  • Video & sound: 2 × micro-HDMI ports (up to 4kp60 supported), 4-pole stereo audio and composite video port
  • Multimedia: H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode), OpenGL ES 3.1, Vulkan 1.0
  • Storage: Micro-SD card slot for loading operating system and data storage
  • Power: 5V DC via USB-C connector (minimum 3A), 5V DC via GPIO header (minimum 3A), Power over Ethernet (PoE) enabled (requires separate PoE HAT)
  • Operating temperature: 0 – 50 degrees C ambient

Additional context There were some hiccups like the issue with docker compose https://github.com/overhangio/tutor/pull/868, which was easily overcome by updating docker using this guide Docker Upgrade Guide for Ubuntu, mentioned the appropriate aarch as required in step 6, the adding the user to group sudo usermod -aG docker $USER.

Just to prevent miscommunication, I would require a bit elaboration if I need to tinker with Docker as 'am not well versed in it

Logs Error log: Installation and Error Log (As you know the entire log is way too big, there were no errors before this, not even warnings. Issues began as soon as interaction with mongodb began

The relevant line in the log is probably: 2023/08/16 10:16:19 Failed to wait: timed out: tcp://mongodb:27017. Used docker ps -a | grep mongodb 4-6 times.

nas@nas-desktop:~$ docker ps -a | grep mongodb
5608efbaba7b   mongo:4.4.22                            "docker-entrypoint.s…"   20 minutes ago   Restarting (132) 28 seconds ago                                                                                                                               tutor_local-mongodb-1
nas@nas-desktop:~$ docker ps -a | grep mongodb
5608efbaba7b   mongo:4.4.22                            "docker-entrypoint.s…"   21 minutes ago   Restarting (132) 9 seconds ago                                                                                                                               tutor_local-mongodb-1
nas@nas-desktop:~$ docker ps -a | grep mongodb
5608efbaba7b   mongo:4.4.22                            "docker-entrypoint.s…"   21 minutes ago   Restarting (132) 13 seconds ago                                                                                                                               tutor_local-mongodb-1
nas@nas-desktop:~$ docker ps -a | grep mongodb
5608efbaba7b   mongo:4.4.22                            "docker-entrypoint.s…"   21 minutes ago   Restarting (132) 14 seconds ago                                                                                                                               tutor_local-mongodb-1

Confirmed aarch using uname -m Got back aarch 64

Further inspected the docker logs 5608efbaba7b

WARNING: MongoDB requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common features for that!
  applies to all versions ≥5.0, any of 4.4 ≥4.4.19
  see https://jira.mongodb.org/browse/SERVER-71772
  see https://jira.mongodb.org/browse/SERVER-55178
  see also https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features
  see also https://github.com/docker-library/mongo/issues/485#issuecomment-970864306

Feel free to ask for other logs or info as required!

Update 1: Ready with a clean installation of Tutor, up until just before launching it using tutor local launch. Update 2: I am guessing this is sort of a bypass? building from source, Is it possible to do something with this, and/or jerry-rigging by downgrading the version

NandishRana avatar Aug 16 '23 11:08 NandishRana

WARNING: MongoDB requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common features for that!
  applies to all versions ≥5.0, any of 4.4 ≥4.4.19

Please try the following:

tutor config save --set DOCKER_IMAGE_MONGODB=docker.io/mongo:4.4.18

Then tutor local launch.

regisb avatar Sep 05 '23 14:09 regisb

@NandishRana Hi, did the above comment resolve the issue for you? Thanks

DawoudSheraz avatar Apr 25 '24 11:04 DawoudSheraz

There have been no updates on the issue, closing this. Feel free to comment/open if there are any questions. Thanks

DawoudSheraz avatar Aug 05 '24 11:08 DawoudSheraz