Project

Profile

Help

Issue #3742

closed

Developer ansible installer migrations are not idempotent when used after systemd

Added by amacdona@redhat.com over 6 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
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:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

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 upCLOSED - CURRENTRELEASEdalleyActions
Actions #1

Updated by CodeHeeler over 6 years ago

  • Triaged changed from No to Yes
Actions #2

Updated by CodeHeeler over 6 years ago

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

Updated by dalley over 6 years ago

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

Added by dalley over 6 years ago

Revision f3259c26 | View on GitHub

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

Actions #4

Updated by dalley over 6 years ago

  • Status changed from ASSIGNED to POST
Actions #5

Updated by dalley over 6 years ago

  • Status changed from POST to MODIFIED
Actions #6

Updated by dkliban@redhat.com over 6 years ago

  • Tags Pulp 3 added
Actions #7

Updated by daviddavis over 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #8

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)
Actions #9

Updated by bmbouter about 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #10

Updated by bmbouter over 4 years ago

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

Also available in: Atom PDF