Bug 1729938

Summary: postgresql-setup --upgrade is completely broken
Product: [Fedora] Fedora Reporter: mikey <abc.mikey>
Component: postgresqlAssignee: Patrik Novotný <panovotn>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: anon.amish, devrim, hhorak, jmlich83, jstanek, panovotn, pkajaba, pkubat, praiskup, tgl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-26 16:10:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mikey 2019-07-15 11:23:04 UTC
Description of problem:

The upgrade script appears to not know where to find the PGDATA dir and there appears to be no way of telling it. 

It complains about the /var/lib/psql/data-old directory and the following line was failing:

"/usr/lib64/pgsql/postgresql-10/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/pgsql/data-old" -o "-p 5432 -b  -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/var/lib/pgsql'" start

Changing it to: 


sudo -u postgres "/usr/lib64/pgsql/postgresql-10/bin/pg_ctl" -w -l "/var/lib/pgsql/pg_upgrade_server.log" -D "/var/lib/pgsql/data" -o "-p 5432 -b  -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/var/lib/pgsql'" start

Does work for that step but it fails again later looking for data-old.

Using --datadir with the command is deprecated, instead --unit is recommended. 

Running:

sudo -u postgres postgresql-setup --upgrade --unit /usr/lib/systemd/system/postgresql.service

Fails because PGDATA is not set, but it is in the Environment= in that file.

Comment 1 Pavel Raiskup 2019-07-15 12:13:03 UTC
Per postgresql-setup --help:
....
  --unit=UNIT_NAME           The UNIT_NAME is used to select proper unit
                             configuration (unit == service or initscript name
                             on non-systemd systems).  For example, if you want
                             to work with unit called
                             'postgresql', you should use
                             'postgresql@com_example' (without trailing .service
                             string).  When no UNIT_NAME is explicitly passed,
                             the 'postgresql' string is used by default.
...

Yes, we should support both absolute name of service file, and with/without
the `.service` suffix -- but it is not yet supported.

Comment 2 Ben Cotton 2020-04-30 21:33:33 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Ben Cotton 2020-05-26 16:10:19 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.