[Python-modules-team] Bug#863267: Miscalculates MigrationHistory dependencies between multiple django apps - regression from 1.8

Neil Williams codehelp at debian.org
Fri May 26 03:54:11 UTC 2017


reopen 863267
retitle 863267 Miscalculates MigrationHistory dependencies between multiple django apps - regression from 1.8
block 847277 by 863267
thanks

Snippets from the attached logs.

Jessie system:

Setting up python-django-common (1.7.11-1+deb8u2) ...
Setting up python-django (1.7.11-1+deb8u2) ...
Setting up lava-server (2014.09.1-1) ...
Operations to perform:
  Synchronize unmigrated apps: linaro_django_xmlrpc, django_openid_auth, lava_projects, lava_scheduler_daemon, django_tables2, lava_markitup
  Apply all migrations: sessions, admin, dashboard_app, auth, sites, contenttypes, lava_scheduler_app, google_analytics
Synchronizing apps without migrations:
  Creating tables...
    Creating table django_openid_auth_nonce
    Creating table django_openid_auth_association
    Creating table django_openid_auth_useropenid
    Creating table linaro_django_xmlrpc_authtoken
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying dashboard_app.0001_initial... OK
  Applying dashboard_app.0002_auto_20140917_1935... OK
  Applying dashboard_app.0003_auto_20140926_1208... OK
  Applying sites.0001_initial... OK
  Applying google_analytics.0001_initial... OK
  Applying lava_scheduler_app.0001_initial... OK
  Applying lava_scheduler_app.0002_add_lava-health_user... OK
  Applying lava_scheduler_app.0003_populate_master_node... OK

Upgrading directly to Stretch:

Setting up python-django-common (1:1.10.7-1) ...
Removing obsolete conffile /etc/bash_completion.d/django_bash_completion ...
Setting up python-django (1:1.10.7-1) ...
Setting up lava-server (2016.12-1) ...
Installing new version of config file /etc/apache2/sites-available/lava-server.conf ...
Installing new version of config file /etc/init.d/lava-server ...
Installing new version of config file /etc/lava-server/settings.conf ...
 lavaserver
 lavaserver
 devel
 devel
System check identified some issues:

WARNINGS:
lava_scheduler_app.Notification.job_status_trigger: (fields.W901) CommaSeparatedIntegerField has been deprecated. Support for it (except in historical migrations) will be removed in Django 2.0.
	HINT: Use CharField(validators=[validate_comma_separated_integer_list]) instead.
Traceback (most recent call last):
  File "/usr/bin/lava-server", line 78, in <module>
    main()
  File "/usr/bin/lava-server", line 74, in main
    execute_from_command_line(django_options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 86, in handle
    executor.loader.check_consistent_history(connection)
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 292, in check_consistent_history
    connection.alias,
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration lava_scheduler_app.0001_initial is applied before its dependency linaro_django_xmlrpc.0001_initial on database 'default'.
dpkg: error processing package lava-server (--configure):
 subprocess installed post-installation script returned error exit status 1

Upgrading via 1.8:

Setting up python-django-common (1.8.16-1~bpo8+1) ...
Setting up python-django (1.8.16-1~bpo8+1) ...
Setting up python-django-tables2 (1.2.0-1~bpo8+1) ...
Setting up lava-server (2016.12-1) ...
 lavaserver
 lavaserver
 devel
 devel
Operations to perform:
  Synchronize unmigrated apps: staticfiles, lava_scheduler_daemon, humanize, django_tables2
  Apply all migrations: linaro_django_xmlrpc, sessions, admin, dashboard_app, auth, sites, contenttypes, lava_results_app, lava_scheduler_app, google_analytics
Synchronizing apps without migrations:
  Creating tables...
    Running deferred SQL...
  Installing custom SQL...
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying dashboard_app.0004_imagereportchart_is_delta... OK
  Applying dashboard_app.0005_imagereportchart_chart_height... OK
  Applying dashboard_app.0006_auto_20141028_1146... OK
  Applying dashboard_app.0007_imagereportchart_chart_visibility... OK
  Applying dashboard_app.0008_imagechartfilter_is_all_tests_included... OK
  Applying dashboard_app.0009_auto_20150108_0711... OK
  Applying dashboard_app.0010_auto_20150116_1533... OK
  Applying dashboard_app.0011_imagereportchart_is_aggregate_results... OK
  Applying dashboard_app.0012_auto_20150126_1644... OK
  Applying dashboard_app.0013_auto_20150127_1341... OK
  Applying dashboard_app.0014_auto_20150212_0604... OK
  Applying dashboard_app.0015_remove_stale_content_types... OK
  Applying dashboard_app.0016_auto_20150325_1235... OK
  Applying dashboard_app.0017_namedattribute_is_manual... OK
  Applying dashboard_app.0018_imagereport_group... OK
  Applying dashboard_app.0019_auto_20150702_1529... OK
  Applying dashboard_app.0020_auto_20151124_1419... OK
  Applying dashboard_app.0021_auto_20151207_0921... OK
  Applying dashboard_app.0022_alter_imagechartfilter... OK
  Applying google_analytics.0002_auto_20151121_0724... OK
  Applying linaro_django_xmlrpc.0001_initial... FAKED
  Applying lava_scheduler_app.0004_add_pipeline_marks... OK
  Applying lava_scheduler_app.0005_auto_devicedictionarytable_pipelinestore... OK
  Applying lava_results_app.0001_initial... OK
  Applying lava_results_app.0002_auto_20150825_1926... OK
  Applying lava_results_app.0003_auto_20150908_1522... OK
  Applying lava_results_app.0004_auto_20150925_0002... OK
  Applying lava_results_app.0005_auto_20151124_1419... OK
  Applying lava_results_app.0006_auto_20160111_1318... OK
  Applying lava_results_app.0007_auto_20160225_1256... OK
  Applying lava_results_app.0008_auto_20160405_1543... OK
  Applying lava_results_app.0009_query_limit... OK
  Applying lava_results_app.0010_auto_20160504_0814... OK
  Applying lava_results_app.0011_namedtestattribute... OK
  Applying lava_results_app.0012_namedtestattribute_metadata... OK
  Applying lava_results_app.0013_buglinks... OK
  Applying lava_scheduler_app.0006_auto_20150619_1035... OK
  Applying lava_scheduler_app.0007_devicetype_description... OK
  Applying lava_scheduler_app.0008_auto_20151014_1044... OK
  Applying lava_scheduler_app.0009_testjob_pipeline_compatibility... OK
  Applying lava_scheduler_app.0010_auto_20151103_1136... OK
  Applying lava_scheduler_app.0011_remove_testjob_log_file... OK
  Applying lava_scheduler_app.0012_auto_20160208_1600... OK
  Applying lava_scheduler_app.0013_auto_20160302_0404... OK
  Applying lava_scheduler_app.0014_add_testjob_index... OK
  Applying lava_scheduler_app.0015_drop_heartbeat... OK
  Applying lava_scheduler_app.0016_index_testjob_submit_time... OK
  Applying lava_scheduler_app.0017_custompermissions... OK
  Applying lava_scheduler_app.0018_notifications... OK
  Applying lava_scheduler_app.0019_extendeduser... OK
  Applying lava_scheduler_app.0020_notificationrecipient_uniquetogether... OK
  Applying lava_scheduler_app.0021_blacklist_to_array... OK
  Applying lava_scheduler_app.0022_create_devicetype_alias... OK
  Applying lava_scheduler_app.0023_update_aliases... OK

Re-applying 1.10 after completing install with 1.8:

Setting up python-django-common (1:1.10.7-1) ...
Setting up python-django (1:1.10.7-1) ...
Setting up python-django-tables2 (1.2.0-1) ...
root at jessie:~# lava-server manage migrate
System check identified some issues:

WARNINGS:
lava_scheduler_app.Notification.job_status_trigger: (fields.W901) CommaSeparatedIntegerField has been deprecated. Support for it (except in historical migrations) will be removed in Django 2.0.
	HINT: Use CharField(validators=[validate_comma_separated_integer_list]) instead.
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, dashboard_app, google_analytics, lava_results_app, lava_scheduler_app, linaro_django_xmlrpc, sessions, sites
Running migrations:
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying sites.0002_alter_domain_unique... OK
root at jessie:~# 

Once the lava-server package is unpacked on Stretch, django 1.10
becomes completely unable to calculate the migration path correctly
when 1.8 completes this reliably and successfully. Once 1.8 has done
this work, 1.10 is suddenly happy with the MigrationHistory when the
package itself has not changed at all between installing 1.8 and
reinstalling 1.10.

Any attempt to run lava-server manage migrate with any of the options
has so far failed to get passed the same exception. The only path
through to Stretch is to install 1.8 and then reinstall 1.10.

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0-jessie-install.txt
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20170526/096e16a7/attachment-0006.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 1-stretch-upgrade.txt
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20170526/096e16a7/attachment-0007.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 2-stretch-dist-upgrade.txt
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20170526/096e16a7/attachment-0008.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 3-migrate-exception.txt
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20170526/096e16a7/attachment-0009.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4-downgrading-to-backports.txt
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20170526/096e16a7/attachment-0010.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 5-upgrading-stretch.txt
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20170526/096e16a7/attachment-0011.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20170526/096e16a7/attachment-0001.sig>


More information about the Python-modules-team mailing list