Project

Profile

Help

Issue #5361

closed

Installer can fail if run a second time on a system due to the installer producing migrations

Added by sajha over 4 years ago. Updated almost 4 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Category:
Installer - Moved to GitHub issues
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Quarter:

Description

Problem

1. Assume a user has a plugin installed that contains migrations up to 10, but there are a few code changes that the developer didn't make another migration for.

2. The user runs the installer which due to the this section will create migration 11 for the user.

3. Then later the developer commits migration 11 and the user who upgrades receives at upgrade time.

4. Pulp will refuse to start saying there are two migrations 11 now (one from the installer, one from the developer post-upgrade).

Solution

The installer should not auto-create migrations. Django expects migrations to be made by developers and not on end-user systems at install time.

plugin specific encounter of this issue

Makemigration step for pulp_ansible plugin failed with the below error:

failed: [ansible-demo] (item=pulp-ansible) => changed=true
  cmd:
  - /usr/local/lib/pulp/bin/django-admin
  - makemigrations
  - ansible
  delta: '0:00:01.427656'
  end: '2019-08-27 16:35:49.892049'
  item: pulp-ansible
  msg: non-zero return code
  rc: 1
  start: '2019-08-27 16:35:48.464393'
  stderr: |-
    CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0011_collectionimport, 0011_auto_20190821_1848 in ansible).
    To fix them run 'python manage.py makemigrations --merge'
  stderr_lines:
  - 'CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0011_collectionimport, 0011_auto_20190821_1848 in ansible).'
  - To fix them run 'python manage.py makemigrations --merge'
  stdout: ''
  stdout_lines: <omitted>
        to retry, use: --limit @/home/sajha/.ansible/retry-files/katello_pulp3.retry

The contents of the 0011_auto_20190821_1848 were:

# Generated by Django 2.2.3 on 2019-08-21 18:48

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('ansible', '0010_ansible_related_names'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='collectionimport',
            options={'ordering': ['_created']},
        ),
    ]

Deleting the autogenerated 011 migration file and re-running the playbook fixes the problem.


Related issues

Is duplicate of Pulp - Issue #5321: Stop having the installer call makemigrations (scheduled to merge Sept 3rd)CLOSED - CURRENTRELEASEdaviddavisActions
Actions #1

Updated by bmbouter over 4 years ago

  • Project changed from Ansible Plugin to Pulp
  • Tags Pulp 3 installer added

Moving to core since this is an installer issue.

Actions #2

Updated by bmbouter over 4 years ago

  • Subject changed from makemigration failed for pulp_ansible to installer can fail if run a second time on a system due to the installer producing migrations

retitling to reflect the root cause.

Actions #3

Updated by bmbouter over 4 years ago

  • Subject changed from installer can fail if run a second time on a system due to the installer producing migrations to Installer can fail if run a second time on a system due to the installer producing migrations
  • Description updated (diff)
Actions #4

Updated by amacdona@redhat.com over 4 years ago

  • Is duplicate of Issue #5321: Stop having the installer call makemigrations (scheduled to merge Sept 3rd) added
Actions #5

Updated by amacdona@redhat.com over 4 years ago

  • Status changed from NEW to CLOSED - DUPLICATE

You are correct that the installer should not make migrations-- this was a step to aid in the early development process, but we have outgrown it. We have another issue that covers this: https://pulp.plan.io/issues/5321 so I am closing as a dupe.

Actions #6

Updated by ggainey almost 4 years ago

  • Tags Katello added
  • Tags deleted (Katello-P2)
Actions #7

Updated by bmbouter almost 4 years ago

  • Category set to Installer - Moved to GitHub issues
  • Tags deleted (Pulp 3 installer)

Also available in: Atom PDF