clair icon indicating copy to clipboard operation
clair copied to clipboard

main: pgsql: no database connection string specified

Open mytunguyen opened this issue 9 years ago • 4 comments

Hi! I'm working with Docker version 1.13.0, quay.io/coreos/clair:v2.0.0-pre.3 (because I want to be able to scan images and Alpine as the base), and postgres:latest. I followed all the instructions and set the clair's database to source: postgresql://postgres:password@postgres:5432?sslmode=disable. When use docker-compose to start postgres and clair, clair won't start up right and the database doesn't have any relations.

clair_clair log: docker logs clair_clair 2017-02-09 21:07:32.638558 C | main: pgsql: no database connection string specified

When I try to list the tables, there's nothing: postgres=# \dt No relations found.

What am I missing? Thanks!

mytunguyen avatar Feb 10 '17 15:02 mytunguyen

Can you try downloading this example config and changing the options to your local database and see if that works?

jzelinskie avatar Feb 12 '17 00:02 jzelinskie

Oh wow, that did work! I changed localhost to postures, password=password, and it worked like a charm. Thanks so much. 2017-02-13 12:51:08.419986 I | updater/fetchers/ubuntu: fetching Ubuntu vulnerabilities 2017-02-13 12:51:08.420449 I | updater/fetchers/debian: fetching Debian vulnerabilities 2017-02-13 12:51:08.420788 I | updater/fetchers/oracle: fetching Oracle Linux vulnerabilities 2017-02-13 12:51:08.421492 I | updater/fetchers/alpine: fetching Alpine vulnerabilities 2017-02-13 12:51:08.423361 I | updater/fetchers/rhel: fetching Red Hat vulnerabilities

mytunguyen avatar Feb 13 '17 12:02 mytunguyen

Glad to help! The key/value pairs are easier to get the connection options correct.

jzelinskie avatar Feb 13 '17 16:02 jzelinskie

@mytunguyen Hello. Can you explain about it? I tried with "host=IP_OF_PSQL port=5432 user=postgres password=**** dbname=clair sslmode=disable", but it didn't run. Thank you.

soncn1 avatar Sep 17 '21 08:09 soncn1