mongo_fdw icon indicating copy to clipboard operation
mongo_fdw copied to clipboard

installation problem in centos 7 - postgres 11.10

Open ztiagoxbr opened this issue 4 years ago • 14 comments

upon completing the package installation, and running ''create extension mongo_fdw'' on postgres, the following error occurs:

ERROR: could not load library "/usr/pgsql-11/lib/mongo_fdw.so": /usr/pgsql-11/lib/mongo_fdw.so: undefined symbol: mongoc_collection_find_with_opts SQL state: XX000

ztiagoxbr avatar Jan 15 '21 19:01 ztiagoxbr

Thanks @ztiagoxbr for reporting an issue.

Can you provide operating system and mongo_fdw version details? which will help us to investigate this issue further.

vaibhavdalvi93 avatar Jan 18 '21 03:01 vaibhavdalvi93

@vaibhavdalvi93 for sure, the information is as follows:

CentOS Linux release 7.7.1908 (Core) mongo_fdw is in the latest version, I use it using git clone https://github.com/EnterpriseDB/mongo_fdw.git PostgreSQL 11.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit

ztiagoxbr avatar Jan 18 '21 13:01 ztiagoxbr

Thanks for the information.

Have you did mongo_fdw installation through recently released RPM or downloaded source from HEAD and compiled the source by your own? If you did source compilation then you have used "autogen.sh --with-master" script?

I am asking this because released version has mongo-c-driver(mongo client) version 1.9.5 where HEAD has 1.17.3.

vaibhavdalvi93 avatar Jan 19 '21 04:01 vaibhavdalvi93

that's right, i compiled it using "autogen.sh --with-master"

however the driver was installed, along with the following items: cmake3, gcc, gcc-c++, openssl-devel cyrus-sasl-devel, pkgconfig, mongo-c-driver, mongo-c-driver-devel, mongo-c-driver-libs, libbson, libbson-devel, git, postgresql-common, epel-release-latest-7.noarch.rpm, centos-release-scl, postgresql11-devel, git gcc automake autoconf libtool.

and the command to download the mongo_fdw package: git clone https://github.com/EnterpriseDB/mongo_fdw.git --recursive

ztiagoxbr avatar Jan 19 '21 11:01 ztiagoxbr

Thanks.

I think you are using old version of driver which don't have "mongoc_collection_find_with_opts" defined in it. I mean you are using old shared library available in /usr/local/lib.

What is "LD_LBRARY_PATH" set when you started the postgres server?

The environment variable LD_LIBRARY_PATH should have "/usr/local/lib64" path because this location contains required latest driver library i.e. libmongoc.so. After setting this variable, start the postgres server. With the latest changes, mongoc driver and bson libraries gets stored in "/usr/local/lib64" location.

This may resolve your problem.

vaibhavdalvi93 avatar Jan 19 '21 12:01 vaibhavdalvi93

I managed to solve this problem by declaring this value, but now another one appears to me.

could not load library "/usr/pgsql-11/lib/mongo_fdw.so": /usr/local/lib64/libmongoc-1.0.so.0: version `LIBMONGOC_1.0' not found (required by /usr/pgsql-11/lib/mongo_fdw.so)

ztiagoxbr avatar Jan 19 '21 19:01 ztiagoxbr

Could you provide some more information so we can debug it more.

  1. can you confirm if you installed postgresql11 using yum packages.
  2. did you get any error while compiling mongo_fdw sources.
  3. current libmongo-c driver version (cat mongo_fdw/mongo-c-driver/VERSION_CURRENT).
  4. output of ldd /usr/pgsql-11/lib/mongo_fdw.so

rajkumarraghuwanshi avatar Jan 20 '21 10:01 rajkumarraghuwanshi

1 - yes, the installation was done through the yum repository

2 - from what I saw, then do a compilation it returns this following error:

src/mongoc/mongoc-read-prefs.c: In function 'mongoc_read_prefs_set_mode': src/mongoc/mongoc-read-prefs.c:49:4: warning: implicit declaration of function 'bson_return_if_fail' [-Wimplicit-function-declaration] bson_return_if_fail(read_prefs); ^ CC src/mongoc/libmongoc_1_0_la-mongoc-write-command.lo CC src/mongoc/libmongoc_1_0_la-mongoc-rand.lo CC src/mongoc/libmongoc_1_0_la-mongoc-scram.lo CC src/mongoc/libmongoc_1_0_la-mongoc-stream-tls.lo src/mongoc/mongoc-stream-tls.c: In function '_mongoc_stream_tls_check_closed': src/mongoc/mongoc-stream-tls.c:830:4: warning: implicit declaration of function 'bson_return_val_if_fail' [-Wimplicit-function-declaration] bson_return_val_if_fail(stream, -1); ^ CC src/mongoc/libmongoc_1_0_la-mongoc-ssl.lo CC src/mongoc/libmongoc_1_0_la-mongoc-sasl.lo CCLD libmongoc-1.0.la CC tests/test_load-test-load.o CCLD test-load ./.libs/libmongoc-priv.so: undefined reference to bson_return_if_fail' ./.libs/libmongoc-priv.so: undefined reference to bson_return_val_if_fail' collect2: error: ld returned 1 exit status make[1]: ** [test-load] Erro 1

3- 1.17.3

  1. result below: linux-vdso.so.1 => (0x00007ffcc4bf8000) libmongoc-1.0.so.0 => /lib64/libmongoc-1.0.so.0 (0x00007f5bfc7a8000) libbson-1.0.so.0 => /lib64/libbson-1.0.so.0 (0x00007f5bfc574000) libc.so.6 => /lib64/libc.so.6 (0x00007f5bfc1a6000) /lib64/ld-linux-x86-64.so.2 (0x00007f5bfcc11000) librt.so.1 => /lib64/librt.so.1 (0x00007f5bfbf9e000) libssl.so.10 => /lib64/libssl.so.10 (0x00007f5bfbd2c000) libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f5bfb8c9000) libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007f5bfb6ac000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5bfb490000) libm.so.6 => /lib64/libm.so.6 (0x00007f5bfb18e000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f5bfaf41000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f5bfac58000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f5bfaa54000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f5bfa821000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f5bfa61d000) libz.so.1 => /lib64/libz.so.1 (0x00007f5bfa407000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f5bfa1ed000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f5bf9fb6000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f5bf9da6000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f5bf9ba2000) libfreebl3.so => /lib64/libfreebl3.so (0x00007f5bf999f000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f5bf9778000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f5bf9516000)

ztiagoxbr avatar Jan 20 '21 20:01 ztiagoxbr

Thanks for more information.

Looks like you have installed mongoc-driver separately.

Please note that you don't need to install mongoc driver separately. The script "autogen.sh --with-master" do take care of building and installing driver as well.

Please follow below steps: Download source code, run autogen.sh script(--with-master), Set LD_LIBRAY_PATH to '/usr/local/lib64' and then compile and install mongo_fdw code.

Before all this please remove all older mongoc driver libraries from your machine.

Hope, this helps.

vaibhavdalvi93 avatar Jan 21 '21 10:01 vaibhavdalvi93

I removed all installations of the mongoc driver but now I get this error when running ./autogen.sh --with-master

2021-01-21 09:14:40 (609 KB/s) - “json-c-0.15-20200726.tar.gz” salvo [348261]

/home/user/mongo_fdw ./autogen.sh: line 80: cmake3: comando não encontrado make: *** Sem regra para processar o alvo install'. Pare. ./autogen.sh: line 69: cmake3: comando não encontrado make: *** Sem regra para processar o alvo install'. Pare. Done

ztiagoxbr avatar Jan 21 '21 12:01 ztiagoxbr

Looks like cmake3 is not installed on your machine. Please install it to make this work.

vaibhavdalvi93 avatar Jan 24 '21 03:01 vaibhavdalvi93

but cmake3 is installed

The cmake3-3.17.5-1.el7.x86_64 package is already installed in its latest version

ztiagoxbr avatar Jan 25 '21 11:01 ztiagoxbr

May be it’s picking default cmake instead of cmake3 while installing. Check with cmake —version. You can create symbolic link with cmake3 to cmake and then try.

On Mon, 25 Jan 2021 at 5:26 PM, ztiagoxbr [email protected] wrote:

but cmake3 is installed

The cmake3-3.17.5-1.el7.x86_64 package is already installed in its latest version

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EnterpriseDB/mongo_fdw/issues/140#issuecomment-766765433, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR3NDTNCLIZZT5P6YJC2DJ3S3VMAHANCNFSM4WEQ3AIQ .

-- Thanks & Regards, Rajkumar Raghuwanshi

rajkumarraghuwanshi avatar Jan 25 '21 12:01 rajkumarraghuwanshi

Hi @ztiagoxbr ,

Could you please check if you're still facing reported issue?

vaibhavdalvi93 avatar Jun 10 '22 10:06 vaibhavdalvi93