Problems upgrading to mongodb 4.0.25


I downloaded the latest tutor and stopped my local instance, then ran the tutor local upgrade command, but it runs into issues with the MongoDB upgrade, I last upgraded Mongo when the previous version of tutor required it so it was at 3.6. I had something similar happen to that upgrade process, but I was able to work around it by connecting to the container and running commands manually but this time the container keeps restarting and I’m unable to get things working. I get the following error when running tutor local upgrade:

You are about to upgrade your Open edX platform. It is strongly recommended to make a backup before upgrading. To do so, run:

tutor local stop

sudo rsync -avr "$(tutor config printroot)"/ /tmp/tutor-backup/

In case of problem, to restore your backup you will then have to run: sudo rsync -avr /tmp/tutor-backup/ "$(tutor config printroot)"/

Are you sure you want to continue? [Y/n]


Upgrading MongoDb to v4.0.25


Environment generated in /home/centos/.local/share/tutor/env

docker-compose -f /home/centos/.local/share/tutor/env/local/docker-compose.yml -f /home/centos/.local/share/tutor/env/local/ --project-name tutor_local build

redis uses an image, skipping

smtp uses an image, skipping

mysql uses an image, skipping

caddy uses an image, skipping

mongodb uses an image, skipping

elasticsearch uses an image, skipping

forum uses an image, skipping

lms uses an image, skipping

lms-worker uses an image, skipping

cms uses an image, skipping

cms-worker uses an image, skipping

nginx uses an image, skipping

docker-compose -f /home/centos/.local/share/tutor/env/local/docker-compose.yml -f /home/centos/.local/share/tutor/env/local/ --project-name tutor_local up --remove-orphans -d mongodb

Creating tutor_local_mongodb_1 ... done

docker-compose -f /home/centos/.local/share/tutor/env/local/docker-compose.yml -f /home/centos/.local/share/tutor/env/local/ --project-name tutor_local exec mongodb mongo --eval db.adminCommand({ setFeatureCompatibilityVersion: "4.0" })

cannot exec in a stopped state: unknown

Error: Command failed with status 126: docker-compose -f /home/centos/.local/share/tutor/env/local/docker-compose.yml -f /home/centos/.local/share/tutor/env/local/ --project-name tutor_local exec mongodb mongo --eval db.adminCommand({ setFeatureCompatibilityVersion: "4.0" })

If I try to run docker-compose -f /home/centos/.local/share/tutor/env/local/docker-compose.yml -f /home/centos/.local/share/tutor/env/local/ --project-name tutor_local up mongodb to get some console feedback about what is happening I see this in the console, but I can’t seem to fix it even if I try to follow the suggested fix due to the container constantly restarting:

mongodb_1 | 2021-09-20T10:12:53.832+0000 F CONTROL [initandlisten] ** IMPORTANT: Collection admin.system.version is missing an UUID. We expect all collections to have UUIDs starting in FCV 3.6. Please make sure the FCV is version 3.6 before attempting an upgrade to 4.0; see for more details. If the FCV is already 3.6, please try --repair with a 3.6 binary or initial sync to fix the data files.

Anyone got any clue how to fix this as currently I can’t get the openedx instance up and running again?

Thank you in advance for any assistance.

Not sure if relevant, but I tried restoring the backup and downgrading to different versions of Tutor, the last version I remember having (10.2.2) didn’t work because it had a similar issue to the described issue, just with the mysql container instead of mongo. I was able to get 11.0.0 up and running though through sheer luck I presume, so for now we’ll stick to that I guess until I have more clarity in what’s going on and what I can do to make sure nothing is lost.

It’s hard to help you, because you did not say from and to which versions of Tutor you are attempting to upgrade. The upgrade should be automatically performed when you run tutor local quickstart the first time. If it fails, you can attempt to force it by running tutor local upgrade --from=ironwood|juniper|koa.

As a side note, it looks like your particular issue should be resolved by the following fix: fix: mongodb upgrade during koa -> lilac migration by regisb · Pull Request #495 · overhangio/tutor · GitHub (which was not yet released but is present in the master branch)

Hey regis,

I believe I must’ve had 10.2.2 (or maybe a couple of minor updates after that), and I tried to upgrade to the latest version. As I mentioned I was able to get version 11 up and running after restoring the backup so at least the platform is running again, but with classes starting soon I’m hesitant to mess more with it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.