ashu6397 / OpenDataCube-Product-Loader

A QGIS plugin that visualizes opendatacube's ingested product information, plots and loads data in Qgis Interface.
Other
3 stars 0 forks source link

Connect Database Server is trying to connect to Unix domain socket #1

Open tjbh opened 6 years ago

tjbh commented 6 years ago

Host: datacube.local (also tried by ip) Port: 5432 (have verified remote connection with psql)

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? (Background on this error at: http://sqlalche.me/e/e3q8)

Should the connection be made to a Unix domain socket when there's a network address in the connection settings?

OS: Linux ubuntu 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

ashu6397 commented 6 years ago

Have you tried starting Postgres server before connecting to database in the plugin? If it is then have a look here https://stackoverflow.com/questions/5500332/cant-connect-the-postgresql-with-psycopg2

tjbh commented 6 years ago

From client machine: tyler@ubuntu:~$ psql -h datacube datacube Password: psql (10.4 (Ubuntu 10.4-0ubuntu0.18.04), server 9.6.9)

conn = psycopg2.connect(dbname="datacube", user="tyler", password=password, host="datacube", port="5432") cursor = conn.cursor() cursor.execute("select relname from pgclass where relkind='r' and relname !~ '^(pg|sql_)';") print(cursor.fetchall()) [('product_ranges',), ('sub_product_ranges',), ('dataset_location',), ('metadata_type',), ('dataset_type',), ('dataset',), ('dataset_source',)]

ashu6397 commented 6 years ago

Try running same psycopg2 commands in qgis python console

tjbh commented 6 years ago

console