Enterprise Migrations Failing After Customizing Pages on Tutor Edly Deployment

Hi community,

I’ve been working on customizing some pages on my Open edX platform using Tutor Edly. The customization was done successfully, but when I attempt to deploy the platform, the process fails at the database migration step specifically during the enterprise app migrations.

I haven’t modified anything directly in the enterprise plugin. The failure seems to originate during the initialization/migration phase after running tutor local launch.

Here are the key details:

  • I’m using Tutor Edly with some UI-level customizations (no changes to backend plugins).
  • The deployment fails during the tutor local launch step.
  • The error stack trace points to the enterprise app.
  • This issue started after the recent customization and rebuild.

Has anyone else faced similar issues after UI-level customizations? Is there a recommended way to bypass or resolve enterprise migration issues without breaking the deployment flow?

Appreciate any help or guidance you can offer. Let me know if you need error logs or version details.

Thanks!

Hi @anas_shah and welcome!

Could you please provide your Tutor version and stack traces in code blocks (not screenshots)?

tutor --version
tutor, version 18.2.2


ImportError: cannot import name 'SYSTEM_ENTERPRISE_PROVISIONING_ADMIN_ROLE' from 'enterprise.constants' (/openedx/venv/lib/python3.11/site-packages/enterprise/constants.py)
Error: Command failed with status 1: docker compose -f /root/.local/share/tutor/env/local/docker-compose.yml -f 

/root/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local -f /root/.local/share/tutor/env/local/docker-compose.jobs.yml run --rm lms-job sh -e -c dockerize -wait tcp://mysql:3306 -timeout 20s
dockerize -wait tcp://mongodb:27017 -timeout 20s

echo "Loading settings $DJANGO_SETTINGS_MODULE"

./manage.py lms migrate

# Create oauth2 apps for CMS SSO
# https://github.com/openedx/edx-platform/blob/master/docs/guides/studio_oauth.rst
./manage.py lms manage_user cms cms@openedx --unusable-password
./manage.py lms create_dot_application \
  --grant-type authorization-code \
  --redirect-uris "https://studio-lms.spectreco.com/complete/edx-oauth2/" \
  --client-id cms-sso \
  --client-secret V77eKyHEJuZDSZWsqZlX9vUL \
  --scopes user_id \
  --skip-authorization \
  --update cms-sso cms
./manage.py lms create_dot_application \
  --grant-type authorization-code \
  --redirect-uris "http://studio-lms.spectreco.com:8001/complete/edx-oauth2/" \
  --client-id cms-sso-dev \
  --client-secret V77eKyHEJuZDSZWsqZlX9vUL \
  --scopes user_id \
  --skip-authorization \
  --update cms-sso-dev cms


# Fix incorrect uploaded file path
if [ -d /openedx/data/uploads/ ]; then
  if [ -n "$(ls -A /openedx/data/uploads/)" ]; then
    echo "Migrating LMS uploaded files to shared directory"
    mv /openedx/data/uploads/* /openedx/media/
    rm -rf /openedx/data/uploads/
  fi
fi

# Create waffle switches to enable some features, if they have not been explicitly defined before
# Completion tracking: add green ticks to every completed unit
(./manage.py lms waffle_switch --list | grep completion.enable_completion_tracking) || ./manage.py lms waffle_switch --create completion.enable_completion_tracking on