Project

Profile

Help

Issue #3742

Developer ansible installer migrations are not idempotent when used after systemd

Added by amacdona@redhat.com over 1 year ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 3 installer
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

The pulp services need to be shut down before rerunning the migrations.

We should add the equivalent of pstop here:

https://github.com/pulp/devel/blob/master/ansible/roles/django_db/tasks/main.yml
https://github.com/pulp/devel/blob/master/ansible/roles/pulp-user/templates/alias.bashrc#L16

TASK [django_db : Run all migrations] ******************************************
failed: [pulp3_dev] (item=reset_db --noinput) => {"changed": true, "cmd": ["/home/vagrant/.virtualenvs/pulp/bin/pulp-manager", "reset_db", "--noinput"], "delta": "0:00:06.226976", "end": "2018-06-07 13:07:25.449082", "item": "reset_db --noinput", "msg": "non-zero return code", "rc": 1, "start": "2018-06-07 13:07:19.222106", "stderr": "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use \"pip install psycopg2-binary\" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.\n  \"\"\")\nTraceback (most recent call last):\n  File \"/home/vagrant/.virtualenvs/pulp/bin/pulp-manager\", line 11, in <module>\n    load_entry_point('pulpcore', 'console_scripts', 'pulp-manager')()\n  File \"/home/vagrant/devel/pulp/pulpcore/pulpcore/app/entry_points.py\", line 9, in pulp_manager_entry_point\n    execute_from_command_line(sys.argv)\n  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/core/management/__init__.py\", line 371, in execute_from_command_line\n    utility.execute()\n  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/core/management/__init__.py\", line 365, in execute\n    self.fetch_command(subcommand).run_from_argv(self.argv)\n  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/core/management/base.py\", line 288, in run_from_argv\n    self.execute(*args, **cmd_options)\n  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/core/management/base.py\", line 335, in execute\n    output = self.handle(*args, **options)\n  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django_extensions/management/utils.py\", line 59, in inner\n    ret = func(self, *args, **kwargs)\n  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django_extensions/management/commands/reset_db.py\", line 167, in handle\n    cursor.execute(drop_query)\npsycopg2.OperationalError: database \"pulp\" is being accessed by other users\nDETAIL:  There are 3 other sessions using the database.", "stderr_lines": ["/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use \"pip install psycopg2-binary\" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.", "  \"\"\")", "Traceback (most recent call last):", "  File \"/home/vagrant/.virtualenvs/pulp/bin/pulp-manager\", line 11, in <module>", "    load_entry_point('pulpcore', 'console_scripts', 'pulp-manager')()", "  File \"/home/vagrant/devel/pulp/pulpcore/pulpcore/app/entry_points.py\", line 9, in pulp_manager_entry_point", "    execute_from_command_line(sys.argv)", "  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/core/management/__init__.py\", line 371, in execute_from_command_line", "    utility.execute()", "  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/core/management/__init__.py\", line 365, in execute", "    self.fetch_command(subcommand).run_from_argv(self.argv)", "  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/core/management/base.py\", line 288, in run_from_argv", "    self.execute(*args, **cmd_options)", "  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/core/management/base.py\", line 335, in execute", "    output = self.handle(*args, **options)", "  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django_extensions/management/utils.py\", line 59, in inner", "    ret = func(self, *args, **kwargs)", "  File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django_extensions/management/commands/reset_db.py\", line 167, in handle", "    cursor.execute(drop_query)", "psycopg2.OperationalError: database \"pulp\" is being accessed by other users", "DETAIL:  There are 3 other sessions using the database."], "stdout": "", "stdout_lines": []}


Related issues

Related to Pulp - Issue #3739: Migrations failure during vagrant up MODIFIED Actions

Associated revisions

Revision f3259c26 View on GitHub
Added by dalley over 1 year ago

Make ansible migration steps idempotent

Disable tasking services prior to applying migrations, re-enable them
afterwards. This allows the ansible provisioning to be re-run on
an existing box.

closes #3742
https://pulp.plan.io/issues/3742

History

#1 Updated by CodeHeeler over 1 year ago

  • Triaged changed from No to Yes

#2 Updated by CodeHeeler over 1 year ago

  • Related to Issue #3739: Migrations failure during vagrant up added

#3 Updated by dalley over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley

#4 Updated by dalley over 1 year ago

  • Status changed from ASSIGNED to POST

#5 Updated by dalley over 1 year ago

  • Status changed from POST to MODIFIED

#6 Updated by dkliban@redhat.com about 1 year ago

  • Tags Pulp 3 added

#7 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#8 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF