Project

Profile

Help

Issue #3742

closed

Developer ansible installer migrations are not idempotent when used after systemd

Added by amacdona@redhat.com almost 6 years ago. Updated almost 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

Also available in: Atom PDF