eulerto / wal2json

JSON output plugin for changeset extraction
BSD 3-Clause "New" or "Revised" License
1.33k stars 161 forks source link

ERROR: could not load library "/usr/lib/postgresql/11/lib/wal2json.so" #151

Closed aldouselpizochari closed 4 years ago

aldouselpizochari commented 4 years ago

Hi,

I am installing wal2json on postgres version 11, everything went smoothly until we run the create slot command here is the complete error

command:

pg_recvlogical -d campaign-management --slot striim_slot --create-slot -P wal2json
pg_recvlogical: could not send replication command "CREATE_REPLICATION_SLOT "striim_slot" LOGICAL "wal2json" NOEXPORT_SNAPSHOT": ERROR:  could not load library "/usr/lib/postgresql/11/lib/wal2json.so": /usr/lib/postgresql/11/lib/wal2json.so: undefined symbol: getmissingattr

do you know what might be causing this?

Thanks

eulerto commented 4 years ago

How did you install postgres (source code, package)? How did you install wal2json (source code, package)? What is your OS?

The symbol getmissingattr isn't used by wal2json. It seems a modified version.

aldouselpizochari commented 4 years ago

postgres is installed through package, and for wal2json i've tried both the source code and package(postgres-11-wal2json) OS is ubuntu 16.04

eulerto commented 4 years ago

It seems your postgres installation has some problem. It works fine while testing in the same OS.

postgres@ubuntu1604:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:    16.04
Codename:   xenial
postgres@ubuntu1604:~$ dpkg -l | grep postgres
ii  pgdg-keyring                          2018.2                                     all          keyring for apt.postgresql.org
ii  postgresql-11                         11.7-2.pgdg16.04+1                         amd64        object-relational SQL database, version 11 server
ii  postgresql-11-wal2json                2.2-1.pgdg16.04+1                          amd64        PostgreSQL logical decoding JSON output plugin
ii  postgresql-client-11                  11.7-2.pgdg16.04+1                         amd64        front-end programs for PostgreSQL 11
ii  postgresql-client-common              213.pgdg16.04+1                            all          manager for multiple PostgreSQL client versions
ii  postgresql-common                     213.pgdg16.04+1                            all          PostgreSQL database-cluster manager

Could you confirm what are your exact installed packages?

What is the following command output?

ldd /usr/lib/postgresql/11/bin/postgres

enggarranu commented 4 years ago

hi @eulerto i have same problem

postgres@postgres:~$ pg_recvlogical -d postgres --slot striim_slot --create-slot -P wal2json`
pg_recvlogical: could not send replication command "CREATE_REPLICATION_SLOT "striim_slot" LOGICAL "wal2json" NOEXPORT_SNAPSHOT": ERROR:  could not load library "/usr/lib/postgresql/11/lib/wal2json.so": /usr/lib/postgresql/11/lib/wal2json.so: undefined symbol: getmissingattr
You have new mail in /var/mail/postgres
postgres@postgres:~$ lsb_release -a
LSB Version:    core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial
You have new mail in /var/mail/postgres
postgres@postgres:~$ dpkg -l | grep postgres
ii  pgdg-keyring                          2018.2                                          all          keyring for apt.postgresql.org
ii  postgresql-11                         11.1-1.pgdg16.04+1                              amd64        object-relational SQL database, version 11 server
ii  postgresql-11-pglogical               2.2.0-6.pgdg16.04+1                             amd64        Logical Replication Extension for PostgreSQL
ii  postgresql-11-pgq3                    3.2.6-34-g50068b2-2.pgdg16.04+1                 amd64        Generic queue for PostgreSQL
ii  postgresql-11-repmgr                  4.2.0-2.pgdg16.04+1                             amd64        replication manager for PostgreSQL 11
ii  postgresql-11-wal2json                2.2-1.pgdg16.04+1                               amd64        PostgreSQL logical decoding JSON output plugin
ii  postgresql-client-10                  10.12-1.pgdg16.04+1                             amd64        front-end programs for PostgreSQL 10
ii  postgresql-client-11                  11.7-1.pgdg16.04+1                              amd64        front-end programs for PostgreSQL 11
ii  postgresql-client-12                  12.2-1.pgdg16.04+1                              amd64        front-end programs for PostgreSQL 12
ii  postgresql-client-common              195.pgdg16.04+1                                 all          manager for multiple PostgreSQL client versions
ii  postgresql-common                     195.pgdg16.04+1                                 all          PostgreSQL database-cluster manager
ii  postgresql-server-dev-10              10.12-1.pgdg16.04+1                             amd64        development files for PostgreSQL 10 server-side programming
ii  postgresql-server-dev-11              11.7-1.pgdg16.04+1                              amd64        development files for PostgreSQL 11 server-side programming
postgres@postgres:~$ ldd /usr/lib/postgresql/11/bin/postgres
        linux-vdso.so.1 =>  (0x00007ffdb31c9000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5334612000)
        libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f5334257000)
        libpam.so.0 => /lib/x86_64-linux-gnu/libpam.so.0 (0x00007f5334049000)
        libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f5333de0000)
        libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f533399b000)
        libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f5333751000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5333549000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5333345000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f533303c000)
        libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f5332deb000)
        libicui18n.so.55 => /usr/lib/x86_64-linux-gnu/libicui18n.so.55 (0x00007f5332989000)
        libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f53325f5000)
        libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f5335388000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f533222b000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f53351f6000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f5332011000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f5331def000)
        libaudit.so.1 => /lib/x86_64-linux-gnu/libaudit.so.1 (0x00007f5331bc8000)
        libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f53318f6000)
        libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f53316c7000)
        libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f53314c3000)
        libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f53312b8000)
        liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f53310a9000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f5330e8e000)
        libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f5330c73000)
        libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007f5330a32000)
        libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f5330702000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5330380000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f533016a000)
        libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f532e6b3000)
        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f532e491000)
        libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f532e1b0000)
        libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f532dfac000)
        libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007f532dda3000)
        libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007f532db19000)
        libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8 (0x00007f532d877000)
        libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007f532d644000)
        libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18 (0x00007f532d42e000)
        libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f532d1ca000)
        libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f532cf97000)
        libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f532cd84000)
        libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007f532cb4e000)
        libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007f532c91b000)
        libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f532c69b000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f532c42b000)
        libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f532c217000)
        libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0 (0x00007f532bfee000)
        libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007f532bddf000)
        libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5 (0x00007f532bb94000)
        libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f532b8bf000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f532b687000)
        libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f532b47f000)
You have new mail in /var/mail/postgres
postgres@postgres:~$ 

please kindly to help us thanks in advance

enggarranu commented 4 years ago

solved, I do this step

sudo apt-get update

and then

sudo apt-get install pgdg-keyring postgresql-11 postgresql-11-pglogical postgresql-11-pgq3 postgresql-11-repmgr postgresql-11-wal2json postgresql-client-11 postgresql-client-common postgresql-common postgresql-server-dev-11

add wal2json on shared_preload_libraries and then restart the postgres service now works fine. thx all.