Table already exists Error while installing

I was installing on Ubuntu 20.4 LTS. Installed all the basic packages as per the doc, and finally executed ‘sudo tutor local quickstart’ with proper config settings. It took a long time, by that time, my SSH connection to ubuntu (from my laptop) was lost due to inactivity. I waited for some more time before I could make ssh connection again. Now, I was not able to connect to Tutor DNS name, I executed ‘sudo tutor local quickstart’ again without changing the config. in this run, I’m getting error. This is part of the error:
Can anyone help please?

  File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 71, in execute
    return self.cursor.execute(query, args)
  File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 319, in _query
    db.query(q)
  File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/connections.py", line 259, in query
    _mysql.connection.query(self, query)
django.db.utils.OperationalError: (1050, "Table 'third_party_auth_samlproviderdata' already exists")
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

Your database looks corrupted, almost certainly because the SSH connection broke down. Since this is a new installation, I recommend simply deleting the database and restarting from scratch: Troubleshooting — Tutor documentation

Also, you should execute long-running commands in tmux or screen to prevent this kind of problems. Oh, and add more memory/CPU (Install Tutor — Tutor documentation).

On a side note: you did see the warning about not using “sudo” to run Tutor?

Just chiming in to let you know that your suggestion above was exactly what I needed to troubleshoot my broken local installation on an Apple M1 using Docker for Mac.

It seems that the initial resources configured in Docker on Apple M1 machines is not suitable for bootstrapping a local environment, as Docker halted part-way through the database migration due to the process not having enough resources.

Related Docker for Mac issue: erro[0149] error waiting for container: invalid character 'u' looking for beginning of value · Issue #5139 · docker/for-mac · GitHub

I had to remove the MySQL directory as you noted in your troubleshooting guide, reset Docker for Mac to factory defaults, and then increase the RAM to 6GB to allow for the quickstart command to complete successfully.

Thank you for your recommendation.

1 Like