Learn about Centmin Mod LEMP Stack today
Register Now

PostgreSQL won't install

Discussion in 'Bug Reports' started by mrkip, Oct 25, 2021.

  1. mrkip

    mrkip New Member

    17
    14
    3
    Jan 29, 2019
    Ratings:
    +19
    Local Time:
    6:19 PM
    Think I've found an issue with PostgreSQL installation process.


    My custom.conf is the following:
    Code:
    POSTGRESQL='y'
    LETSENCRYPT_DETECT='y'
    And I've then proceeded to recompile PHP.

    The process seems to halt when the script tries to import the GPG keys. So I think it's a repo issue.

    Here's some further info:
    Code:
    warning: /svr-setup/pgdg-redhat-repo-latest.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
    Preparing...                          ########################################
    Updating / installing...
    pgdg-redhat-repo-42.0-20              ########################################
    ls: cannot access /etc/yum.repos.d/pgdg-13-redhat.repo: No such file or directory
    cat: /etc/yum.repos.d/pgdg-13-redhat.repo: No such file or directory
    
    Loaded plugins: fastestmirror, versionlock
    Loading mirror speeds from cached hostfile
     * base: mirror.netsite.dk
     * centos-sclo-rh: mirrors.xtom.de
     * centos-sclo-sclo: mirror.netsite.dk
     * epel: mirrors.coreix.net
     * extras: mirror.netsite.dk
     * updates: mirror.23m.com
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    Importing GPG key 0x442DF0F8:
     Userid     : "PostgreSQL RPM Building Project <pgsql-pkg-yum@postgresql.org>"
     Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
     Package    : pgdg-redhat-repo-42.0-20.noarch (installed)
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-7-x86_64/repodata/repomd.xml: [Errno -1] Gpg Keys not imported, cannot verify repomd.xml for repo pgdg-common
    Trying other mirror.
    
    
     One of the configured repositories failed (PostgreSQL common RPMs for RHEL/CentOS 7 - x86_64),
     and yum doesn't have enough cached data to continue. At this point the only
     safe thing yum can do is fail. There are a few ways to work "fix" this:
    
         1. Contact the upstream for the repository and get them to fix the problem.
    
         2. Reconfigure the baseurl/etc. for the repository, to point to a working
            upstream. This is most often useful if you are using a newer
            distribution release than is supported by the repository (and the
            packages for the previous distribution release still work).
    
         3. Run the command with the repository temporarily disabled
                yum --disablerepo=pgdg-common ...
    
         4. Disable the repository permanently, so yum won't use it by default. Yum
            will then just ignore the repository until you permanently enable it
            again or use --enablerepo for temporary usage:
    
                yum-config-manager --disable pgdg-common
            or
                subscription-manager repos --disable=pgdg-common
    
         5. Configure the failing repository to be skipped, if it is unavailable.
            Note that yum will try to contact the repo. when it runs most commands,
            so will have to try and fail each time (and thus. yum will be be much
            slower). If it is a very temporary problem though, this is often a nice
            compromise:
    
                yum-config-manager --save --setopt=pgdg-common.skip_if_unavailable=true
    
    failure: repodata/repomd.xml from pgdg-common: [Errno 256] No more mirrors to try.
    https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-7-x86_64/repodata/repomd.xml: [Errno -1] Gpg Keys not imported, cannot verify repomd.xml for repo pgdg-common
    Is this ok [y/N]:
    real    8m22.416s
    user    0m0.366s
    sys     0m0.109s
    I'm currently playing about with this on a test VPS. So if you want me to try anything out feel free to make suggestions. I'm not too fussed about borking my server and having to reinstall it again.
     
  2. eva2000

    eva2000 Administrator Staff Member

    52,232
    12,000
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,503
    Local Time:
    3:19 AM
    Nginx 1.25.x
    MariaDB 10.x
  3. mrkip

    mrkip New Member

    17
    14
    3
    Jan 29, 2019
    Ratings:
    +19
    Local Time:
    6:19 PM
    No worries mate:) I understand you've got a lot on your plate ATM, and I'm happy to wait for a fix.

    PS: I wish your mum a speedy recovery.

    Best,
     
  4. MaximilianKohler

    MaximilianKohler Member

    157
    3
    18
    Jun 23, 2023
    Ratings:
    +18
    Local Time:
    10:19 AM
    Hmm, this was back in 2021. I just tried to upgrade php from 8.1.27 to 8.2.15 since Xenforo just updated their recommendation to php 8.2 and it froze on me in the same spot. But I didn't get the extra info that the OP did. It's just frozen on "Importing GPG key".

    "Command+C" doesn't exit. The only way to exit seems to be closing the Putty window.

    My php_upgrade.log doesn't have anything more than what was shown on the screen, which wasn't much since it freezes up early on.

    Custom config settings:
    Code:
    MARCH_TARGETNATIVE='n'        # Off for compatibility, on for speed.
    LETSENCRYPT_DETECT='y'        #
    VHOSTCTRL_CLOUDFLAREINC='y'   #
    NGINX_ZERODT='y'              # Zero downtime upgrades
    PHP_PGO='y'                   # Speed up php
    PHP_ARGON='y'                 # Enable more secure Argon2 password hash algorithm. Recompile php after enabling.
    
    SET_DEFAULT_MYSQLCHARSET='utf8mb4'  # For Xenforo
    ENABLE_MARIADBTENTWOUPGRADE='y'     #
    ENABLE_MARIADBTENTHREEUPGRADE='y'   #
    ENABLE_MARIADBTENFOURUPGRADE='y'    #
    
    POSTGRESQL='y'          # Install PostgreSQL with PHP recompile
    NEEDRESTART_CHECK='y'   # Check if system needs to be rebooted after system updates
    
     
  5. eva2000

    eva2000 Administrator Staff Member

    52,232
    12,000
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,503
    Local Time:
    3:19 AM
    Nginx 1.25.x
    MariaDB 10.x
    Well I'd still need the php upgrade log https://community.centminmod.com/threads/how-to-troubleshoot-php-installs-upgrades.17857/
     
  6. MaximilianKohler

    MaximilianKohler Member

    157
    3
    18
    Jun 23, 2023
    Ratings:
    +18
    Local Time:
    10:19 AM
    php upgrade log - Pastebin.com

    Code:
    CentOS Version: CentOS 7 64bit
    Centmin Mod Version Installed: 123.09beta01
    Nginx Version Installed: nginx/1.25.3 (241023-215906-centos7-kvm-545176e)
    PHP Version Installed: 8.1.27
    MariaDB MySQL Version Installed: 10.4.32-MariaDB MariaDB Server
    When was last time updated Centmin Mod code base ? : It's up to date.
     
  7. MaximilianKohler

    MaximilianKohler Member

    157
    3
    18
    Jun 23, 2023
    Ratings:
    +18
    Local Time:
    10:19 AM
    I noticed that php_upgrade.inc was updated. Should I be trying this again or waiting for you to say something here?
     
  8. eva2000

    eva2000 Administrator Staff Member

    52,232
    12,000
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,503
    Local Time:
    3:19 AM
    Nginx 1.25.x
    MariaDB 10.x
    Haven't done anything related to PostgreSQL yet. Been busy with work, but thanks for the reminder to look at this again.
     
  9. MaximilianKohler

    MaximilianKohler Member

    157
    3
    18
    Jun 23, 2023
    Ratings:
    +18
    Local Time:
    10:19 AM
  10. eva2000

    eva2000 Administrator Staff Member

    52,232
    12,000
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,503
    Local Time:
    3:19 AM
    Nginx 1.25.x
    MariaDB 10.x
    Yeah I don't have time to look at it right now. For now you can disable PostgreSQL YUM repo as outlined in the error message
    Code (Text):
     3. Run the command with the repository temporarily disabled
                yum --disablerepo=pgdg-common ...
     
         4. Disable the repository permanently, so yum won't use it by default. Yum
            will then just ignore the repository until you permanently enable it
            again or use --enablerepo for temporary usage:
     
                yum-config-manager --disable pgdg-common

    Disable the PostgreSQL YUM repo
    Code (Text):
    yum-config-manager --disable pgdg-common pgdg11 pgdg12 pgdg13 pgdg14 pgdg15
    

    Then install docker as usual
    Can later re-enable when fixed
    Code (Text):
    yum-config-manager --enable pgdg-common pgdg11 pgdg12 pgdg13 pgdg14 pgdg15
    
     
  11. eva2000

    eva2000 Administrator Staff Member

    52,232
    12,000
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,503
    Local Time:
    3:19 AM
    Nginx 1.25.x
    MariaDB 10.x
    You can also try these manual commands to see if PostgreSQL YUM repos still complain
    Code (Text):
    rpm --import https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-16
    rpm --import https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG
    yum makecache
    yum-config-manager --enable pgdg-common pgdg11 pgdg12 pgdg13 pgdg14 pgdg15
    yum repolist all
    

    If they still complain, disable them again
    Code (Text):
    yum-config-manager --disable pgdg-common pgdg11 pgdg12 pgdg13 pgdg14 pgdg15
    
     
  12. MaximilianKohler

    MaximilianKohler Member

    157
    3
    18
    Jun 23, 2023
    Ratings:
    +18
    Local Time:
    10:19 AM
    I did that and it happened again, but with pgdg11 pgdg11 error - Pastebin.com

    And then pgdg12, pgdg13, pgdg14, pgdg15. After disabling them all it worked. Thanks!

    Since I already disabled them and installed Docker, it's too late to try that?

    EDIT:
    Code:
    rpm --import https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-16
    curl: (22) The requested URL returned error: 404 Not Found
    error: https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-16: import read failed(2).
    
     
  13. eva2000

    eva2000 Administrator Staff Member

    52,232
    12,000
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,503
    Local Time:
    3:19 AM
    Nginx 1.25.x
    MariaDB 10.x
    looks like they moved the GPG key URLs PostgreSQL RPM repository GPG key update - 3 January 2024 - PostgreSQL YUM Repository!

    try

    Code (Text):
    rpm --import https://download.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL7
    yum makecache
    yum-config-manager --enable pgdg-common pgdg11 pgdg12 pgdg13 pgdg14 pgdg15
    yum repolist all
    

    If they still complain, disable them again
    Code (Text):
    yum-config-manager --disable pgdg-common pgdg11 pgdg12 pgdg13 pgdg14 pgdg15
     
  14. eva2000

    eva2000 Administrator Staff Member

    52,232
    12,000
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,503
    Local Time:
    3:19 AM
    Nginx 1.25.x
    MariaDB 10.x
    updated the GPG Key to
    try

    Code (Text):
    rpm --import https://download.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL7
    yum makecache
    yum-config-manager --enable pgdg-common pgdg11 pgdg12 pgdg13 pgdg14 pgdg15
    yum repolist all
    

    If they still complain, disable them again
    Code (Text):
    yum-config-manager --disable pgdg-common pgdg11 pgdg12 pgdg13 pgdg14 pgdg15
     
  15. MaximilianKohler

    MaximilianKohler Member

    157
    3
    18
    Jun 23, 2023
    Ratings:
    +18
    Local Time:
    10:19 AM
    Thanks! That seemed to work.
     
  16. MaximilianKohler

    MaximilianKohler Member

    157
    3
    18
    Jun 23, 2023
    Ratings:
    +18
    Local Time:
    10:19 AM
    I tried to upgrade from 8.1.27 to 8.1.28 today and got the same issue with it freezing: https://community.centminmod.com/threads/postgresql-wont-install.22086/#post-98504

    New log: php upgrade fail - Pastebin.com

    I ran
    Code:
    yum repolist all
    And I get a bunch of "not found" errors:
    Code:
    pgdg-common/7/x86_64/signature                                                                                                           |  665 B  00:00:00
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    Importing GPG key 0x442DF0F8:
     Userid     : "PostgreSQL RPM Building Project <pgsql-pkg-yum@postgresql.org>"
     Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
     Package    : pgdg-redhat-repo-42.0-35PGDG.noarch (@pgdg-common)
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    Is this ok [y/N]: y
    pgdg-common/7/x86_64/signature                                                                                                           | 2.9 kB  00:00:17 !!!
    https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-7-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for pgdg-common
    Trying other mirror.
    https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    Trying other mirror.
    To address this issue please refer to the below wiki article
    
    https://wiki.centos.org/yum-errors
    
    If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
    
    pgdg12/7/x86_64/signature                                                                                                                |  665 B  00:00:00
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    Importing GPG key 0x442DF0F8:
     Userid     : "PostgreSQL RPM Building Project <pgsql-pkg-yum@postgresql.org>"
     Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
     Package    : pgdg-redhat-repo-42.0-35PGDG.noarch (@pgdg-common)
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    Is this ok [y/N]: y
    pgdg12/7/x86_64/signature                                                                                                                | 3.6 kB  00:01:01 !!!
    https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-7-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for pgdg12
    Trying other mirror.
    pgdg13/7/x86_64/signature                                                                                                                |  665 B  00:00:00
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    Importing GPG key 0x442DF0F8:
     Userid     : "PostgreSQL RPM Building Project <pgsql-pkg-yum@postgresql.org>"
     Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
     Package    : pgdg-redhat-repo-42.0-35PGDG.noarch (@pgdg-common)
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    Is this ok [y/N]:
    
    I ran
    Code:
    yum --disablerepo=* -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
    and that seemed to fix it.
     
    Last edited: Apr 22, 2024
  17. eva2000

    eva2000 Administrator Staff Member

    52,232
    12,000
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,503
    Local Time:
    3:19 AM
    Nginx 1.25.x
    MariaDB 10.x
    cheers strange as that is what initial install does install
    Code (Text):
    https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
    
     
  18. MaximilianKohler

    MaximilianKohler Member

    157
    3
    18
    Jun 23, 2023
    Ratings:
    +18
    Local Time:
    10:19 AM
    My understanding from your #13 post, is that these commands are temporary/incomplete to some extent:
    Code:
    rpm --import https://download.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL7
    yum makecache
    yum-config-manager --enable pgdg-common pgdg11 pgdg12 pgdg13 pgdg14 pgdg15
    yum repolist all
    So they worked temporarily for me before, but the "--disablerepo=* -y install" should be longer lasting.
     
  19. eva2000

    eva2000 Administrator Staff Member

    52,232
    12,000
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,503
    Local Time:
    3:19 AM
    Nginx 1.25.x
    MariaDB 10.x
    What I mean is that https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm is installed by Centmin Mod when setting up and installing PostgreSQL.