Could not access file "pglogical" while trying to install pglogical

2.5k views Asked by At

I'm following instructions from https://github.com/2ndQuadrant/pglogical to install pglogical on postgres 12 on Centos 8. The install seems be successful:

 yum -y install postgresql12-pglogical
Last metadata expiration check: 0:21:30 ago on Wed 30 Sep 2020 09:32:13 PM CDT.
Dependencies resolved.
=====================================================================================================================================================================================================================================================
 Package                                                      Architecture                                 Version                                                   Repository                                                                 Size
=====================================================================================================================================================================================================================================================
Installing:
 postgresql12-pglogical                                       x86_64                                       2.3.2-1.el8                                               2ndquadrant-dl-default-release-pg12                                       145 k
Installing dependencies:
 postgresql12                                                 x86_64                                       12.4-1PGDG.rhel8                                          pgdg12                                                                    1.6 M
 postgresql12-server                                          x86_64                                       12.4-1PGDG.rhel8                                          pgdg12                                                                    5.2 M

Transaction Summary
=====================================================================================================================================================================================================================================================
Install  3 Packages

Total download size: 7.0 M
Installed size: 29 M
Downloading Packages:
(1/3): postgresql12-12.4-1PGDG.rhel8.x86_64.rpm                                                                                                                                                                      1.5 MB/s | 1.6 MB     00:01
(2/3): postgresql12-pglogical-2.3.2-1.el8.x86_64.rpm                                                                                                                                                                 117 kB/s | 145 kB     00:01
(3/3): postgresql12-server-12.4-1PGDG.rhel8.x86_64.rpm                                                                                                                                                               4.0 MB/s | 5.2 MB     00:01
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                5.3 MB/s | 7.0 MB     00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                             1/1
  Installing       : postgresql12-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                        1/3
  Running scriptlet: postgresql12-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                        1/3
failed to link /usr/bin/psql -> /etc/alternatives/pgsql-psql: /usr/bin/psql exists and it is not a symlink
failed to link /usr/bin/clusterdb -> /etc/alternatives/pgsql-clusterdb: /usr/bin/clusterdb exists and it is not a symlink
failed to link /usr/bin/createdb -> /etc/alternatives/pgsql-createdb: /usr/bin/createdb exists and it is not a symlink
failed to link /usr/bin/createuser -> /etc/alternatives/pgsql-createuser: /usr/bin/createuser exists and it is not a symlink
failed to link /usr/bin/dropdb -> /etc/alternatives/pgsql-dropdb: /usr/bin/dropdb exists and it is not a symlink
failed to link /usr/bin/dropuser -> /etc/alternatives/pgsql-dropuser: /usr/bin/dropuser exists and it is not a symlink
failed to link /usr/bin/pg_basebackup -> /etc/alternatives/pgsql-pg_basebackup: /usr/bin/pg_basebackup exists and it is not a symlink
failed to link /usr/bin/pg_dump -> /etc/alternatives/pgsql-pg_dump: /usr/bin/pg_dump exists and it is not a symlink
failed to link /usr/bin/pg_dumpall -> /etc/alternatives/pgsql-pg_dumpall: /usr/bin/pg_dumpall exists and it is not a symlink
failed to link /usr/bin/pg_restore -> /etc/alternatives/pgsql-pg_restore: /usr/bin/pg_restore exists and it is not a symlink
failed to link /usr/bin/reindexdb -> /etc/alternatives/pgsql-reindexdb: /usr/bin/reindexdb exists and it is not a symlink
failed to link /usr/bin/vacuumdb -> /etc/alternatives/pgsql-vacuumdb: /usr/bin/vacuumdb exists and it is not a symlink

  Running scriptlet: postgresql12-server-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                 2/3
  Installing       : postgresql12-server-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                 2/3
  Running scriptlet: postgresql12-server-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                 2/3
  Installing       : postgresql12-pglogical-2.3.2-1.el8.x86_64                                                                                                                                                                                   3/3
  Running scriptlet: postgresql12-pglogical-2.3.2-1.el8.x86_64                                                                                                                                                                                   3/3
  Verifying        : postgresql12-pglogical-2.3.2-1.el8.x86_64                                                                                                                                                                                   1/3
  Verifying        : postgresql12-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                        2/3
  Verifying        : postgresql12-server-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                 3/3

Installed:
  postgresql12-12.4-1PGDG.rhel8.x86_64                                         postgresql12-pglogical-2.3.2-1.el8.x86_64                                         postgresql12-server-12.4-1PGDG.rhel8.x86_64

Complete!

But when I try to restart postgres, I get this error

systemctl restart postgresql
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xe" for details.

Relevant portions of the journalctl -xe

-- Unit postgresql.service has begun starting up.
Sep 30 21:54:59 aba postmaster[305963]: 2020-10-01 02:54:59.825 UTC [305963] FATAL:  could not access file "pglogical": No such file or directory
Sep 30 21:54:59 aba postmaster[305963]: 2020-10-01 02:54:59.825 UTC [305963] LOG:  database system is shut down
Sep 30 21:54:59 aba systemd[1]: postgresql.service: Main process exited, code=exited, status=1/FAILURE
Sep 30 21:54:59 aba systemd[1]: postgresql.service: Failed with result 'exit-code'.
Sep 30 21:54:59 aba systemd[1]: Failed to start PostgreSQL database server.
-- Subject: Unit postgresql.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit postgresql.service has failed.
--
-- The result is failed.

I am lost!

1

There are 1 answers

0
Laurenz Albe On BEST ANSWER

Your session log tells the the server was installed as a prerequisite, but the "link" messages insinuate that there was already an incompatible client version in place. Probably you had installed PostgreSQL from the CentOS packages, but the pglogical RPMs pulled in the PGDG packages.

The error message probably means that shared_preload_libraries contains pglogical, but pglogical.so could not be found in the lib directory.

Presumably the installation process edited the configuration in your old server installation, but installed the shared object in the new one.

Upshot: you cannot use those pglogical binaries with your installation. Either switch to the PGDG RPMs or build pglogical from source.

You see that there is a certain amount of conjecture in my deductions, but that should help you solve the problem.