Project

Profile

Help

Issue #5147

closed

Postgresql version on centos 7 is outdated

Added by daviddavis almost 3 years ago. Updated about 2 years ago.

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 #1

Updated by daviddavis almost 3 years ago

  • Description updated (diff)
  • Sprint set to Sprint 56
Actions #2

Updated by daviddavis almost 3 years ago

  • Subject changed from Error when migrating pulp_ansible plugin on centos 7 to Postgresql version on centos 7 is outdated
Actions #3

Updated by daviddavis almost 3 years ago

Whatever version of postgresql we go with, we should just notify or confirm with Katello since they are on 9.2.

Actions #4

Updated by ipanova@redhat.com almost 3 years ago

  • Triaged changed from No to Yes
Actions #5

Updated by ttereshc almost 3 years ago

As of now (July 2019), Katello thinks that they'll use PostgreSQL 10.x - whichever has the longest support and whichever is available in SCLs.

Actions #7

Updated by ttereshc almost 3 years ago

+1 for Django 2.2 (LTS) and at least Postgresql 9.6

ignore_conflicts option is very convenient for bulk_create and the migration tool would like to use it:
https://docs.djangoproject.com/en/2.2/ref/models/querysets/#django.db.models.query.QuerySet.bulk_create

Actions #8

Updated by bmbouter almost 3 years ago

ttereshc wrote:

+1 for Django 2.2 (LTS) and at least Postgresql 9.6

+1 I agree

Actions #9

Updated by bmbouter almost 3 years ago

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

I think I can fix this. I'm going to test the fix and post it.

Actions #10

Updated by bmbouter almost 3 years ago

  • Status changed from ASSIGNED to POST

Added by bmbouter almost 3 years ago

Revision 60d4d86c

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

Added by Brian Bouterse almost 3 years ago

Revision 60d4d86c

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

Actions #11

Updated by bmbouter almost 3 years ago

  • Status changed from POST to MODIFIED

Added by bmbouter almost 3 years ago

Revision 89975aeb

Update to Installer that has PostgreSQL 9.6

This includes the update to the installer so that on centos7 PostgreSQL 9.6 is installer via software collections.

https://pulp.plan.io/issues/5147 re #5147

Actions #12

Updated by bmbouter over 2 years ago

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

Updated by ggainey about 2 years ago

  • Tags Katello added
  • Tags deleted (Katello-P1)
Actions #14

Updated by bmbouter about 2 years ago

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

Also available in: Atom PDF