Open ztiagoxbr opened 3 years ago
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 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
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.
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
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.
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)
Could you provide some more information so we can debug it more.
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
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.
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
Looks like cmake3 is not installed on your machine. Please install it to make this work.
but cmake3 is installed
The cmake3-3.17.5-1.el7.x86_64 package is already installed in its latest version
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 notifications@github.com 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
Hi @ztiagoxbr ,
Could you please check if you're still facing reported issue?
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