charts: XRAY Fails to connect to out of the box Azure Postgresql
Is this a request for help?: yes
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT
Version of Helm and Kubernetes: Helm:
Client: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}
K8s:
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.1", GitCommit:"4485c6f18cee9a5d3c3b4e523bd27972b1b53892", GitTreeState:"clean", BuildDate:"2019-07-18T09:18:22Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.5", GitCommit:"2166946f41b36dea2c4626f90a77706f426cdea2", GitTreeState:"clean", BuildDate:"2019-03-25T15:19:22Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Which chart: xray
What happened:
When using an external postgres instance, I receive role "username@hostname" does not exist in the xray-server startup logs
[16:34:17 UTC 2019/07/22] [EROR] (jfrog.com/xray/internal/startup.InitSystem:57) Failed to ensure db schema for postgres: pq: role "username@hostname" does not exist
What you expected to happen: Expect xray to connect to external database properly
How to reproduce it (as minimally and precisely as possible): WIth a new azure postgresql db, pass the postgres url as https://username@hostname:password@hostname.postgres.database.azure.com:5432/database
Anything else we need to know: I am able to connect through psql cli using username@hostname. I can see a role defined as username in the database, but not username@hostname.
Artifactory chart was able to connect to (a different) Azure postgresql db.
database=> select rolname from pg_roles;
rolname
-------------------
azure_superuser
pg_signal_backend
azure_pg_admin
postgres
username
Running on k8s environment
xray-server service container is starting...
Exec: /opt/jfrog/xray-server/server
Server[16:34:16 UTC 2019/07/22] [INFO] (jfrog.com/xray/internal/startup.InitXrayServer:71) Xray xdistribution: docker
[16:34:16 UTC 2019/07/22] [INFO] (jfrog.com/xray/configs/config/secrets.LoadXraySecretFile:22) Secrets file does not exists
[16:34:16 UTC 2019/07/22] [INFO] (jfrog.com/xray/internal/dbaccess.setPostgresStatementTimeoutFromConfig:83) Setting Postgres statement timeout to 18000000
[16:34:17 UTC 2019/07/22] [INFO] (jfrog.com/xray/internal/migration/helper.ServerMigration.func1:29) Not running Migration server
[16:34:17 UTC 2019/07/22] [INFO] (jfrog.com/xray/internal/jobs.ScheduleJob:103) HeartbeatJob job listener has been triggered
[16:34:17 UTC 2019/07/22] [INFO] (jfrog.com/xray/internal/dbaccess.createTablesIfNotExist:146) Initializing db tables
[16:34:17 UTC 2019/07/22] [INFO] (jfrog.com/xray/internal/dbaccess.createComponentsConcurrentIndex:174) creating components concurrent index
[16:34:17 UTC 2019/07/22] [INFO] (jfrog.com/xray/internal/dbaccess.CreateGetChildrenFuncIfNotExist:199) Initializing get children func
[16:34:17 UTC 2019/07/22] [EROR] (jfrog.com/xray/internal/dbaccess.CreateGetChildrenFuncIfNotExist:203) Failed to create getChildren func: pq: role "username@hostname" does not exist
[16:34:17 UTC 2019/07/22] [EROR] (jfrog.com/xray/internal/startup.InitSystem:57) Failed to ensure db schema for postgres: pq: role "username@hostname" does not exist
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (6 by maintainers)
Seems the first error that you get:
Is a result of line# 2980 in installerCommon.sh:
${productHome}/app/bin/diagnostics/diagnosticsUtil jfrog database-status "{{shared.database.url}}" "{{shared.database.type:${databaseLabel}}}" "{{shared.database.username:${databaseUsername}}}" "{{shared.database.password}}" 2>&1 || trueIt expects the database to be defined in YAML and does not check the
JF_SHARED_DATABASE_*Env Vars.However, even with setting these in the System.yaml, I still get the following error:
2021-03-26T17:31:46.726Z [jfxr ] [ERROR] [ ] [crypto_service:148 ] [main ] No user / password foundSo I think this is still an issue.
The same issue appears to be present for artifactory-ha setup. Any plans on fixing it?
That’s fine I have a release target to wait for now.
Thank you very much for your help, feel free to close the ticket as you see fit.