-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
Quay Enterprise
Azure PostgreSQL database contains special characters in both the username and password. Because connection strings, as the operator creates them, are not parsed as string literals, deployment will fail because Clair will not be able to connect to the database. The following will be seen in the logs:
{"Event":"pgsql: database connection string is not a valid URL","Level":"fatal","Location":"main.go:97","Time":"2020-04-22 12:42:51.035650"} 2020-04-22 12:42:51,036 INFO exited: clair (exit status 1; not expected) 2020-04-22 12:42:53,039 INFO spawned: 'clair' with pid 44 {"Event":"pgsql: database connection string is not a valid URL","Level":"fatal","Location":"main.go:97","Time":"2020-04-22 12:42:53.046673"} 2020-04-22 12:42:53,047 INFO exited: clair (exit status 1; not expected) 2020-04-22 12:42:56,051 INFO spawned: 'clair' with pid 52 {"Event":"pgsql: database connection string is not a valid URL","Level":"fatal","Location":"main.go:97","Time":"2020-04-22 12:42:56.058815"} 2020-04-22 12:42:56,060 INFO exited: clair (exit status 1; not expected) 2020-04-22 12:42:56,060 INFO gave up: clair entered FATAL state, too many start retries too quickly
This is the offending Postgres connection string:
apiVersion: v1 data: config.yaml: | clair: database: type: pgsql options: cachesize: 16384 source: postgres://clair:clair[@quay-clair-postgresql/clair?sslmode=disable
The resolution would be to wrap the entire connection string inside double quotation marks or to use a different connection string format. This also works:
source: host=clair-database.postgres.database.azure.com dbname=clair user=ibazulic@clair-database password=password_here