Skip to content

Instantly share code, notes, and snippets.

@alikins
Last active August 11, 2020 14:36
Show Gist options
  • Save alikins/15a9627857c5050be892b236e9e7785b to your computer and use it in GitHub Desktop.
Save alikins/15a9627857c5050be892b236e9e7785b to your computer and use it in GitHub Desktop.
pulpcore/galaxy_ng 'migrate' error post RBAC landing (3.6.x, 3adeff2cd62c057f1da19c455377089154606bc6)
(galaxy_ng_2) [newswoop:F31:pulpcore (master % u=)]$ diff -u ~/0040_accesspolicy.py pulpcore/app/migrations/0041_accesspolicy.py
--- /home/adrian/0040_accesspolicy.py 2020-08-11 10:34:53.699259324 -0400
+++ pulpcore/app/migrations/0041_accesspolicy.py 2020-08-11 10:34:59.459240934 -0400
@@ -8,7 +8,7 @@
class Migration(migrations.Migration):
dependencies = [
- ('core', '0039_set_admin_is_staff'),
+ ('core', '0040_set_admin_is_staff'),
]
operations = [
@@ -19,7 +19,7 @@
('pulp_created', models.DateTimeField(auto_now_add=True)),
('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)),
('statements', django.contrib.postgres.fields.jsonb.JSONField()),
- ('viewset_classpath', models.CharField(max_length=256, unique=True)),
+ ('viewset_name', models.CharField(max_length=128, unique=True)),
('permissions_assignment', django.contrib.postgres.fields.jsonb.JSONField()),
],
options={
(galaxy_ng_py36) [newswoop:F31:galaxy_ng (master % u=)]$ time ./compose run --rm api manage migrate
INFO: Using compose profile alikins
INFO: $ANSIBLE_HUB_UI_PATH is unset.
If you want to run the UI inside compose please set $ANSIBLE_HUB_UI_PATH
to the location of your local copy of https://github.com/ansible/ansible-hub-ui.
Starting galaxy_ng_redis_1 ... done
Starting galaxy_ng__base_1 ... done
Starting galaxy_ng_postgres_1 ... done
Installing path alogging in editable mode.
WARNING: You are using pip version 20.2.1; however, version 20.2.2 is available.
You should consider upgrading via the '/venv/bin/python3 -m pip install --upgrade pip' command.
Installing path django-extensions in editable mode.
WARNING: You are using pip version 20.2.1; however, version 20.2.2 is available.
You should consider upgrading via the '/venv/bin/python3 -m pip install --upgrade pip' command.
Installing path pulpcore in editable mode.
WARNING: You are using pip version 20.2.1; however, version 20.2.2 is available.
You should consider upgrading via the '/venv/bin/python3 -m pip install --upgrade pip' command.
Installing path pulp_ansible in editable mode.
WARNING: You are using pip version 20.2.1; however, version 20.2.2 is available.
You should consider upgrading via the '/venv/bin/python3 -m pip install --upgrade pip' command.
Installing path galaxy_ng in editable mode.
WARNING: You are using pip version 20.2.1; however, version 20.2.2 is available.
You should consider upgrading via the '/venv/bin/python3 -m pip install --upgrade pip' command.
Operations to perform:
Apply all migrations: admin, ansible, auth, authtoken, container, contenttypes, core, galaxy, guardian, sessions
Running migrations:
Applying core.0040_set_admin_is_staff... OK
Applying core.0041_accesspolicy...Traceback (most recent call last):
File "/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 82, in _execute
return self.cursor.execute(sql)
psycopg2.errors.DuplicateTable: relation "core_accesspolicy" already exists
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/venv/bin/django-admin", line 8, in <module>
sys.exit(execute_from_command_line())
File "/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "/venv/lib64/python3.6/site-packages/django/core/management/commands/migrate.py", line 234, in handle
fake_initial=fake_initial,
File "/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/venv/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 245, in apply_migration
state = migration.apply(state, schema_editor)
File "/venv/lib64/python3.6/site-packages/django/db/migrations/migration.py", line 124, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/venv/lib64/python3.6/site-packages/django/db/migrations/operations/models.py", line 92, in database_forwards
schema_editor.create_model(model)
File "/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 307, in create_model
self.execute(sql, params or None)
File "/venv/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 137, in execute
cursor.execute(sql, params)
File "/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 99, in execute
return super().execute(sql, params)
File "/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/venv/lib64/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/venv/lib64/python3.6/site-packages/django/db/backends/utils.py", line 82, in _execute
return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "core_accesspolicy" already exists
real 0m34.834s
user 0m0.966s
sys 0m0.167s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment