IITDBGroup / gprom

GProM is a middleware that adds support for provenance to database backends.
http://www.cs.iit.edu/%7edbgroup/research/gprom.php
Apache License 2.0
8 stars 5 forks source link

Problem with Postgres backend connection #103

Closed niceIrene closed 9 months ago

niceIrene commented 9 months ago

I fixed my previous problem about configure and please see the following comments.

niceIrene commented 9 months ago

Hi, I am currently trying to install GProM for the Postgres backend. I have installed all dependencies needed for Postgres and aim to work on the TPC-H database.

I used the docker image iitdbgroup/gprom-ubuntu-all-backends (There is an error in the documentation about this image name). However, I am still wondering how can I connect it to my own Postgres server?

My current command line is: docker run -ti --name mygprom iitdbgroup/gprom-ubuntu-all-backends -backend postgres -db tpch -port 5432 -host localhost -user postgres

It gave an error as: ERROR (exception.c:145) exception was thrown (RECOVERABLE) metadata_lookup_postgres.c - 327 - <unable to connect to postgres database host=localhost dbname=tpch user=postgres password= port=5432 failed because of: x����>

I can't read the error message and not sure how to fix this. Could you please help to resolve this issue? Thanks in advance!

lordpretzel commented 9 months ago

Hi,

please use -host 127.0.0.1 instead of -host localhost. Also I'm currently updating the gprom docker images (long overdue). I'll let you know once this done as this may contain bug fixes for some other problems you may encounter).

regarding the connection error, this may be unrelated to GProM. With docker there are basically three ways how to set this up. Please have a look at the following and see which this works for your setup:

Depending how you you running postgres ...

The solution would be to ...

niceIrene commented 9 months ago

Thank you for your kind reply!

After reading your instructions for running Postgres (iii) locally on your machine (not in docker), I decided to use the host network for the connection setup. I updated my command as sudo docker run -it --net=host --name mygprom iitdbgroup/gprom:latest -backend postgres -db tpch -port 5432 -host 127.0.0.1 -user postgres However, after starting the docker, when I tried to send a query it still gave the following error. It looks like the connection is still not established.

Oracle SQL - Postgres:postgres@127.0.0.1:tpch$\h GPROM CLI COMMANDS \q(uit) exit CLI \h(elp) show this helptext \I(nput language) show help for currently selected parser \o(ptions) show current parameter settings \s(et) PAR VAL set parameter PAR to value VAL \b(ackend) QUERY send QUERY directly to the backend \i(nput file) FILE read & execute commands from FILE \m(ultiline) toggle multiline editing mode, if on, then semicolon ends a query Oracle SQL - Postgres:postgres@127.0.0.1:tpch$\b select * from customer;
ERROR (metadata_lookup_postgres.c:358) unable to connect to postgres database host=127.0.0.1 dbname=tpch user=postgres password= port=5432

failed because of: P�?0�U ERROR (exception.c:145) exception was thrown (RECOVERABLE) metadata_lookup.c - 221 - <failed assertion: activePlugin && activePlugin->isInitialized()

Error occured (metadata_lookup.c:221) failed assertion: activePlugin && activePlugin->isInitialized()

lordpretzel commented 9 months ago

Hi,

note that you have to specify a password with -passwd in GProM. Also make sure that your postgres allows connections from ips other than 127.0.0.1

Irene Lin @.***> writes:

Thank you for your kind reply!

After reading your instructions for running Postgres (iii) locally on your machine (not in docker), I decided to use the host network for the connection setup. I updated my command as sudo docker run -it --net=host --name mygprom iitdbgroup/gprom:latest -backend postgres -db tpch -port 5432 -host 127.0.0.1 -user postgres However, after starting the docker, when I tried to send a query it still gave the following error. It looks like the connection is still not established.

Oracle SQL - @.:tpch$\h GPROM CLI COMMANDS \q(uit) exit CLI \h(elp) show this helptext \I(nput language) show help for currently selected parser \o(ptions) show current parameter settings \s(et) PAR VAL set parameter PAR to value VAL \b(ackend) QUERY send QUERY directly to the backend \i(nput file) FILE read & execute commands from FILE \m(ultiline) toggle multiline editing mode, if on, then semicolon ends a query Oracle SQL - @.:tpch$\b select * from customer; ERROR (metadata_lookup_postgres.c:358) unable to connect to postgres database host=127.0.0.1 dbname=tpch user=postgres password= port=5432

failed because of: P�?0�U ERROR (exception.c:145) exception was thrown (RECOVERABLE) metadata_lookup.c - 221 - <failed assertion: activePlugin && activePlugin->isInitialized()

Error occured (metadata_lookup.c:221) failed assertion: activePlugin && activePlugin->isInitialized()

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

--

Boris Glavic Associate Professor Computer Science Illinois Institute of Technology

Stuart Building, Room 206 B 10 W 31st Street Chicago, IL 60616

Email: @.*** Phone: +1 312 567 5205 Web: http://www.cs.iit.edu/~glavic DBGroup: http://www.cs.iit.edu/~dbgroup

niceIrene commented 9 months ago

Thank you so much! After specifying the password, the connection works!