Tutor-based Open edX local deployment failing after git pull — MySQL connection error during migration

After updating my local Open edX environment with the latest code from the git repository my Tutor- ver 20.0.1 based local deployment on Ubuntu started failing during migrations.

When I run:

tutor local launch

or

tutor local run lms ./manage.py migrate

the process stops with this error:

django.db.utils.OperationalError: (2013, 'Lost connection to MySQL server during query')


:gear: Environment Details:

  • OS: Ubuntu (local system)

  • Deployment type: Tutor local (development mode)

  • Tutor version: 20.0.1

  • Database: MySQL (running inside Tutor Docker container)


:puzzle_piece: What I Tried:

  1. Checked container status with:

    docker ps -a
    
    

    → All Tutor containers (mysql, lms, cms, etc.) are created but MySQL stops after a few seconds during migrations.

  2. Verified connection manually inside container:

    tutor local run mysql mysql -u root -p
    
    

    → Connection succeeds, but large migrations cause MySQL to drop.

  3. Error occurs consistently at:

    Applying api_admin.0003_auto_20160404_1618... Lost connection to MySQL server during query
    
    

:toolbox: Possible Cause (Analysis):

  • The MySQL server inside Tutor may have default configuration limits that are too low for heavy Open edX migrations.

  • The max_allowed_packet, wait_timeout, or innodb_log_file_size parameters might need to be increased.

  • Docker resource allocation (CPU/RAM) may also be insufficient for running the full Open edX stack locally.


:wrench: Proposed Fix / Next Steps:

  1. Create or edit a custom MySQL configuration:

    mkdir -p $(tutor config printroot)/mysql
    nano $(tutor config printroot)/mysql/my.cnf
    
    

    Add:

    [mysqld]
    max_allowed_packet=256M
    wait_timeout=28800
    interactive_timeout=28800
    innodb_log_file_size=512M
    
    
  2. Restart Tutor services:

    tutor local stop
    tutor local start -d
    
    
  3. Re-run migrations:

    tutor local run lms ./manage.py migrate
    
    
  4. Increase Docker resources (CPU ≥ 4 cores, RAM ≥ 8 GB).


:pushpin: Expected Behavior:

Open edX migrations should complete successfully and all services (lms, cms, mysql, caddy, etc.) should start without MySQL disconnection errors.

:warning: Actual Behavior:

Migrations fail midway with:

OperationalError: (2013, 'Lost connection to MySQL server during query')


Help me how to resovle it

i want it intergarion my web and mobile app bypass the login and customization so help me how to resovele it

Hi @Suriya_Stark and welcome. It looks like you used an AI chatbot to compose this post. It’s unclear to me which Open edX version you were previously on before you migrated to 20. Also did you follow the AI’s suggestions in the “Proposed Fix / Next Steps:” and “Possible Cause (Analysis):” sections? Those seem like good things to try.

Hi

I recently did a git pull to fix the migration issue. Everything’s working fine now. If I face any other issues, I’ll let you know soon. Thank you!