openfun/openedx-docker

wiki.0005_remove_attachments_and_images fails

Closed this issue · 2 comments

Expected Behavior

Start the container using make bootstrap.

Actual Behavior

The starting process is failing with the following error:

Running migrations:
  Applying wiki.0005_remove_attachments_and_images...Traceback (most recent call last):
  File "manage.py", line 121, in <module>
    execute_from_command_line([sys.argv[0]] + django_args)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 204, in handle
    fake_initial=fake_initial,
  File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 115, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 244, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/migration.py", line 129, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/operations/fields.py", line 156, in database_forwards
    schema_editor.remove_field(from_model, from_model._meta.get_field(self.name))
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 487, in remove_field
    self.execute(sql)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 136, in execute
    cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 101, in execute
    return self.cursor.execute(query, args)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue

django.db.utils.OperationalError: (1091, "Can't DROP 'current_revision_id'; check that column/key exists")
Makefile:80: recipe for target 'migrate' failed
make: *** [migrate] Error 1

Steps to Reproduce

Just starting the project with:

  1. Clone the repo.
  2. Run sudo make bootstrap

Specifications

  • Version: Commit 6feedeb
  • Platform: Ubuntu 18.04 LTS Server (2GB RAM, 1 CPU Unit)

Did you start from scratch, just ran make bootstrap and straightaway get this error? The error suggests that your db was not new.

Can you try deleting the database container and trying again?

$ docker-compose kill mysql
$ docker-compose rm mysql
$ make bootstrap

Closing this. Do not hesitate to ping us if you are still stucked @ErickAgrazal!