Cannot find a migration matching

Hi,

Got a cron error last night, i am guessing this is related to the last update as the system seems to be at 3.8.16-0.
Running the mentioned script results in an import error for django.db

Is there anyway to run these scripts manually to figure out what is causing the issue?

Rene

LOG:

/etc/cron.daily/0yum-daily.cron:

CommandError: Cannot find a migration matching '0001_initial' from app 'storageadmin'.
CommandError: Cannot find a migration matching '0001_initial' from app 'smart_manager'.
Operations to perform:
  Apply all migrations: (none)
Running migrations:
  No migrations to apply.
Operations to perform:
  Apply all migrations: (none)
Running migrations:
  No migrations to apply.
Operations to perform:
  Apply all migrations: auth
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial...Traceback (most recent call last):
  File "/opt/rockstor/bin/django", line 44, in <module>
    sys.exit(djangorecipe.manage.main('rockstor.settings'))
  File "/opt/rockstor/eggs/djangorecipe-1.9-py2.7.egg/djangorecipe/manage.py", line 9, in main
    management.execute_from_command_line(sys.argv)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/core/management/commands/migrate.py", line 222, in handle
    executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/migrations/executor.py", line 110, in migrate
    self.apply_migration(states[migration], migration, fake=fake, fake_initial=fake_initial)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/migrations/executor.py", line 148, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/migrations/migration.py", line 115, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/migrations/operations/models.py", line 59, in database_forwards
    schema_editor.create_model(model)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/backends/base/schema.py", line 286, in create_model
    self.execute(sql, params or None)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/backends/base/schema.py", line 111, in execute
    cursor.execute(sql, params)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "django_content_type" already exists

Operations to perform:
  Apply all migrations: (none)
Running migrations:
  No migrations to apply.
systemctl daemon-reload done
The following updates will be applied on midgard:
================================================================================
 Package            Arch      Version                  Repository          Size
================================================================================
Installing:
 kernel-ml          x86_64    4.8.7-1.el7.elrepo       rockstor            40 M
 kernel-ml-devel    x86_64    4.8.7-1.el7.elrepo       rockstor            11 M
Updating:
 btrfs-progs        x86_64    4.8.3-0.rockstor         rockstor           677 k
 rockstor           x86_64    3.8.16-0                 Rockstor-Stable     15 M

Transaction Summary
================================================================================
Install  2 Packages
Upgrade  2 Packages
The updates were successfully applied

Hi @Rene_Castberg,
are you on stable branch?? If yes, reading @suman blog post about 3.8.16 upgrade, you should have received a mail with some special notes about this update

M.

Thanks for the reply,

Yes i am on the stable branch and yes i am on the stable branch, and yes i was running 3.8.15 before the update, and have been for a quite a while.

Hi @Rene_Castberg,
here we come with the solution:

Feel free to ask if you need help :wink:

Mirko

1 Like

Same issue. Downgraded to 14 and back to 16 and getting the same error messages.

You have to downgrade, manually update to 3.8.15, reboot then update to 3.8.16

M.

Sorry, possibly wasn’t clear.
What I have done :
Downgraded to 14
Rebooted
Upgraded to 15
Rebooted
Upgraded to 16

Hi @Rene_Castberg, so doing generates same error or another one?

M.

Hi Rene, sorry I should’ve replied sooner. Going back to your original post, it seems your system updated from 3.8.15 to 3.8.16 which is the smoothest route requiring no intervention. So I suspect the errors you saw were probably due to an unknown cause.

Ignoring the error for a second, What is the status of your system now? Are you able to access the UI? And can you list the contents of /opt/rockstor/src/rockstor/storageadmin/migrations/ directory?

Well i can now access the gui.

I was unable to access gui so i was forced to downgrade one more time to 15. After a reboot it automatically updated to 16. And even though i only have stable i seem to be at 16-1

So unfortunately i am unsure of what happened.

After update:

recast@ ~ [0] $ ls /opt/rockstor/src/rockstor/storageadmin/migrations/
0001_initial.py
0001_initial.pyc
0002_auto_20161125_0051.py
0002_auto_20161125_0051.pyc
0002_auto__del_poolstatistic__del_sharestatistic__chg_field_disk_size__chg_.pyc
0003_auto__add_field_nfsexportgroup_admin_host.pyc
0004_auto__add_advancednfsexport.pyc
0005_auto__add_field_networkinterface_gateway__add_field_networkinterface_d.pyc
0006_auto__add_oauthapp.pyc
0007_auto__add_field_appliance_client_id__add_field_appliance_client_secret.pyc
0008_auto__add_field_user_public_key.pyc
0009_auto__del_field_sambashare_admin_users.pyc
0010_auto__add_field_disk_btrfs_uuid.pyc
0011_auto__add_netatalkshare.pyc
0012_auto__add_field_disk_model__add_field_disk_serial__add_field_disk_tran.pyc
0013_auto__add_field_user_shell__add_field_user_homedir__add_field_user_ema.pyc
0014_auto__add_group.pyc
0015_auto__add_field_user_group.pyc
0016_auto__del_field_poolscrub_errors__add_field_poolscrub_data_extents_scr.pyc
0017_auto__add_field_pool_compression__add_field_pool_mnt_options.pyc
0018_auto__add_field_share_compression_algo.pyc
0019_auto__add_poolbalance.pyc
0020_auto__add_sambacustomconfig.pyc
0021_auto__del_field_sambashare_create_mask.pyc
0022_auto__add_dvolume__add_unique_dvolume_container_dest_dir__add_containe.pyc
0023_auto__add_tlscertificate.pyc
0024_auto__add_smarttestlogdetail__add_smartinfo__add_smarttestlog__add_sma.pyc
0025_auto__add_field_dport_uiport.pyc
0026_auto__chg_field_rockon_state__chg_field_rockon_version.pyc
0027_auto__chg_field_rockon_status.pyc
0028_auto__add_field_snapshot_rusage__add_field_snapshot_eusage__add_field_.pyc
0029_auto__add_dcontainerlink__add_unique_dcontainerlink_destination_name__.pyc
0030_auto__add_field_share_pqgroup.pyc
0031_auto__add_configbackup.pyc
0032_auto__add_emailclient__chg_field_snapshot_toc__chg_field_configbackup_.pyc
0033_auto__del_field_poolbalance_pid__add_field_poolbalance_tid__add_field_.pyc
0034_auto__chg_field_tlscertificate_name.pyc
0035_auto__del_field_networkinterface_domain__del_field_networkinterface_bo.pyc
0036_auto__add_field_sambashare_shadow_copy__add_field_sambashare_snapshot_.pyc
0037_auto__chg_field_networkinterface_autoconnect__chg_field_networkinterfa.pyc
0038_auto__add_updatesubscription.pyc
0039_auto__chg_field_tlscertificate_certificate__chg_field_tlscertificate_k.pyc
0040_auto__add_dcontainerenv__add_unique_dcontainerenv_container_key__add_f.pyc
0041_auto__add_field_pool_role.pyc
0042_auto__add_field_disk_smart_options__add_field_disk_role.pyc
0043_auto__add_field_emailclient_port.pyc
0044_add_field_EmailClient_username.pyc
0045_auto__del_networkinterface__add_networkdevice__add_ethernetconnection_.pyc
0046_auto__add_pincard__add_unique_pincard_user_pin_number.pyc
0047_auto__chg_field_disk_name.pyc
init.py
init.pyc

Hi Rene, I rolled out a 16-1 hotfix on the stable channel to deprecate net-tools from Rockstor. This became a showstopper after upstream(CentOS) release of 7.3 that coincided with ours. Hope everything is back to normal for you. Please do report any issues.