Actions
Issue #5147
closedPostgresql version on centos 7 is outdated
Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
Installer - Moved to GitHub issues
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Sprint 56
Quarter:
Description
ansible-pulp is installing postgresql 9.2 on centos 7 but django 2.1+ requires postgresql 9.4+:
https://docs.djangoproject.com/en/2.1/releases/2.1/#dropped-support-for-postgresql-9-3
We need to install a newer postgresql version via SCL.
If you try to use the pulp_ansible plugin on CentOS 7, you'll hit this error:
fatal: [pulp3-devel]: FAILED! => changed=true
cmd:
- /usr/local/lib/pulp/bin/django-admin
- migrate
- --no-input
delta: '0:00:02.118012'
end: '2019-07-16 18:05:26.170082'
msg: non-zero return code
rc: 1
start: '2019-07-16 18:05:24.052070'
stderr: |-
Traceback (most recent call last):
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.SyntaxError: syntax error at or near "WITH ORDINALITY"
LINE 6: FROM unnest(c.conkey) WITH ORDINALITY co...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/pulp/bin/django-admin", line 11, in <module>
sys.exit(execute_from_command_line())
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/management/commands/migrate.py", line 234, in handle
fake_initial=fake_initial,
File "/usr/local/lib/pulp/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 "/usr/local/lib/pulp/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 "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 245, in apply_migration
state = migration.apply(state, schema_editor)
File "/usr/local/lib/pulp/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 "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/migrations/operations/models.py", line 372, in database_forwards
to_field,
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 535, in alter_field
old_db_params, new_db_params, strict)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/backends/postgresql/schema.py", line 124, in _alter_field
new_db_params, strict,
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 543, in _alter_field
fk_names = self._constraint_names(model, [old_field.column], foreign_key=True)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 1115, in _constraint_names
constraints = self.connection.introspection.get_constraints(cursor, model._meta.db_table)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/backends/postgresql/introspection.py", line 175, in get_constraints
""", ["public", table_name])
File "/usr/local/lib/pulp/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 "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: syntax error at or near "WITH ORDINALITY"
LINE 6: FROM unnest(c.conkey) WITH ORDINALITY co...
^
stderr_lines: <omitted>
stdout: |-
Operations to perform:
Apply all migrations: admin, ansible, auth, contenttypes, core, docker, file, sessions
Running migrations:
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying admin.0003_logentry_add_action_flag_choices... OK
Applying core.0001_initial... OK
Applying ansible.0001_initial... OK
Applying ansible.0002_advanced_collections...
stdout_lines: <omitted>
Actions
Add PostgreSQL 9.6 for CentOS7
Pulp is requiring PostgreSQL 9.6 with Django 2.2 (LTS). This upgrades the version of PostgreSQL on CentOS 7 to 9.6 via software collections.
The systemd files can no longer depend on the postgresql service name to restart them when postgresql restarts. Foremost because we can't be guaranteed postgresql is a systemd unit on this system. Secondly due to this PR that name is now changing on centos7.
This PR removes the systemd dependency on postgresql service units and instead configures all Pulp services to automatically always restart when it exits. Stopping the unit with systemctl still stops it.
https://pulp.plan.io/issues/5147 closes #5147