Migration error
See original GitHub issueActual behavior
throwing error on ./manage.py migrate
Applying zinnia.0001_initial... OK
Applying zinnia.0002_lead_paragraph_and_image_caption... OK
Applying zinnia.0003_publication_date...Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 29, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 62, in handle
failures = test_runner.run_tests(test_labels)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django_nose/runner.py", line 303, in run_tests
result = self.run_suite(nose_argv)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django_nose/runner.py", line 241, in run_suite
addplugins=plugins_to_add)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/nose/core.py", line 121, in __init__
**extra_args)
File "/usr/lib/python2.7/unittest/main.py", line 95, in __init__
self.runTests()
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/nose/core.py", line 207, in runTests
result = self.testRunner.run(self.test)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/nose/core.py", line 50, in run
wrapper = self.config.plugins.prepareTest(test)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in __call__
return self.call(*arg, **kw)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/nose/plugins/manager.py", line 167, in simple
result = meth(*arg, **kw)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django_nose/plugin.py", line 82, in prepareTest
return super(NoseTestSuiteRunner, self).setup_databases()
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/test/runner.py", line 546, in setup_databases
self.old_names = self.runner.setup_databases()
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django_nose/runner.py", line 490, in setup_databases
self.parallel, **kwargs
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/test/utils.py", line 187, in setup_databases
serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/db/backends/base/creation.py", line 69, in create_test_db
run_syncdb=True,
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 130, in call_command
return command.execute(*args, **defaults)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 204, in handle
fake_initial=fake_initial,
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-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 "/home/runner/aktienregister/.ve/local/lib/python2.7/site-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 "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/db/migrations/migration.py", line 129, in apply
getattr(new_model._meta, self.option_name, set()),
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 364, in alter_index_together
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/db/migrations/operations/models.py", line 590, in database_forwards
self._delete_composed_index(model, fields, {'index': True}, self.sql_delete_index)
File "/home/runner/aktienregister/.ve/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 377, in _delete_composed_index
", ".join(columns),
ValueError: Found wrong number (0) of constraints for zinnia_entry(status, creation_date, start_publication, end_publication)
Expected behavior
no exception 😃
This is happening on my CI only, on dev servers/ local instances I cannot reproduce it.
I fully understand that there are good chances that it’s caused by some env setup. But I have no clue how to debug that. Hence this ticket with the question if there is anything known like that… just close and ignore if there is nothing you can help with…
Steps to reproduce the issue
it’s happening on my CI env after installing all required dependencies
Specifications
- Zinnia version: 0.18.1
- Django version: 1.11
- Python version: 2.7.3
- Operating system: Ubuntu 16.04
Disclaimer
Please read these questions carefully and answer honestly with an x
into all the boxes [ ]
:
- I have read the guidelines for contributing linked to above.
- I have checked for duplicate issues.
- This is not a support request.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Data migration service error codes - Google Support
Data migration service error codes ; 11018, The Exchange server reports one of the folders in the mailbox is corrupt and cannot be...
Read more >Typical Data Migration Errors You Must Know - Artha Solutions
Human and coordination error ... Data migration is an arduous process that involves multiple people, multiple systems, multiple sources, and multiple phases.
Read more >Troubleshooting Failed Migrations - Microsoft Community Hub
A 'failed migration' is when the status of the move request shows as 'failed', and we have one or more failures logged in...
Read more >Migration error messages - IBM
You can take corrective actions in response to error messages that occur while you use the Migration Manager application.
Read more >Migration troubleshooting in production - Prisma
Failed migration · You modify a migration before running it and introduce a syntax error · You add a mandatory ( NOT NULL...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have submitted a bug-report and also a patch to the django team. https://code.djangoproject.com/ticket/28197 https://github.com/django/django/pull/8495
We’ll see if the django team likes my solution or if they prefer to solve it differently.
Just a quick note: I could reproduce this issue on Django 1.10.8 and 1.10.7 using Postgres 9.5.
If others run into this issue, a quick fix is to patch up
0003_publication_date.py
, removing this part: