Django Installed Apps Error after Quickstart on M1

I too ran into this issue with Nutmeg release after trying to volume map directly after a quickstart or launch had provisioned.

tutor_nutmeg_dev-lms-1 | RuntimeError: Model class openedx.core.djangoapps.content_libraries.models.ContentLibrary doesn’t declare an explicit app_label and isn’t in an application in INSTALLED_APPS.

I used the docker cp | Docker Docs command to copy the default LMS Container install of edx-platform to my host machine using this command. Copying the platform directory didn’t take too long (less than a minute).

# Copy files from LMS container to Host machine
docker cp -a tutor_nutmeg_dev-lms-1:/openedx/edx-platform .

Ref: https://stackoverflow.com/questions/54213420/convert-shallow-repo-to-normal-repo 
# Unshallow the git repo (convert the shallow clone to regular one).
cd edx-platform
git fetch --unshallow

# Get access to all the branches on origin.
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin

I’m using Tutor from source, so I created a file at tutor/tutor/templates/dev/docker-compose.override.yml with the following volume mappings and performed a tutor config save to put this file out in the Tutor env before I issued a tutor local restart to make the volume mappings work. I followed instructions here Open edX development — Tutor documentation (overhang.io) for this mapping file.

version: "3.7"
services:
  lms:
    volumes:
      - /path/to/open-edx/tutor.dev.nutmeg/edx-platform:/openedx/edx-platform
  cms:
    volumes:
      - /path/to/open-edx/tutor.dev.nutmeg/edx-platform:/openedx/edx-platform
  lms-worker:
    volumes:
      - /path/to/open-edx/tutor.dev.nutmeg/edx-platform:/openedx/edx-platform
  cms-worker:
    volumes:
      - /path/to/open-edx/tutor.dev.nutmeg/edx-platform:/openedx/edx-platform

After a restart I verified that the RuntimeError: openedx.core.djangoapps.content_libraries went away and that the LMS and CMS pages would load properly. This seemed to work just fine.

Debugging
I set a breakpoint in the LMS Dashboard view function to see that I could breakpoint then also made sure that I was attached to the LMS Container by running the following command.

# If the LMS doesn't reload after inserting the breakpoint and saving the file, then issue the following command as indicated in this guide.
# Ref: https://docs.tutor.overhang.io/local.html#reloading-open-edx-settings
tutor dev exec lms reload-uwsgi

# Attach to the LMS Container for debugging
docker container attach tutor_nutmeg_dev-lms-1

Use a Forked edx-platform
I think from here what I’ll do is make sure that I’ll have a fork that based on this container edx-platform commits and apply our company’s specific changes. If there were any changes to models.py to ensure that migrations get applied.

It looks like I have the openedx-release/nutmeg.2 tag installed along with some patches added by the Dockerfile from openedx image. Patches came from tutor/tutor/templates/build/openedx/Dockerfile at v14.2.3 · overhangio/tutor (github.com)

I created a branch titled open-release/nutmeg.install here.

cc @becdavid @traek728