vmware-archive / pcf-prometheus-pipeline

Apache License 2.0
20 stars 38 forks source link

Missing variable postgres_grafana_password #11

Closed bhudlemeyer closed 6 years ago

bhudlemeyer commented 6 years ago

Doing fresh run getting deploy error.

`

Task 15309 | 02:23:33 | Preparing package compilation: Finding packages to compile (00:00:00)
19:23:33
Task 15309 | 02:23:33 | Updating instance nginx: nginx/d3b0ee90-17bb-493e-9b4b-8bc97e5062e9 (0) (canary)
19:23:33
Task 15309 | 02:23:33 | Updating instance grafana: grafana/e4b559f0-e853-4ac8-b558-9c65a100362b (0) (canary)
19:23:58
Task 15309 | 02:23:57 | Updating instance nginx: nginx/d3b0ee90-17bb-493e-9b4b-8bc97e5062e9 (0) (canary) (00:00:24)
19:25:43
Task 15309 | 02:25:42 | Updating instance grafana: grafana/e4b559f0-e853-4ac8-b558-9c65a100362b (0) (canary) (00:02:09)
19:25:43
                     L Error: grafana/0 (e4b559f0-e853-4ac8-b558-9c65a100362b) is not running after update. Review logs for failed jobs: grafana
19:25:43
Task 15309 | 02:25:42 | Error: grafana/0 (e4b559f0-e853-4ac8-b558-9c65a100362b) is not running after update. Review logs for failed jobs: grafana
19:25:43
19:25:43
Task 15309 Started  Sat Feb 17 02:23:31 UTC 2018
19:25:43
Task 15309 Finished Sat Feb 17 02:25:42 UTC 2018
19:25:43
Task 15309 Duration 00:02:11
19:25:43
Task 15309 error
19:25:43
Could not deploy: Updating deployment: Expected task 15309 to succeed but state is error
19:25:43`

Checking grafana vm see below in stdout messages

`t=2018-02-17T02:30:27+0000 lvl=eror msg="Fail to initialize orm engine" logger=sqlstore error="Sqlstore::Migration failed err: pq: password authentication failed for user \"grafana\"\n"
t=2018-02-17T02:31:07+0000 lvl=info msg="Starting Grafana" logger=server version=4.6.3 commit=7a06a47 compiled=2017-12-14T08:36:59+0000
t=2018-02-17T02:31:07+0000 lvl=info msg="Config loaded from" logger=settings file=/var/vcap/packages/grafana/conf/defaults.ini
t=2018-02-17T02:31:07+0000 lvl=info msg="Config loaded from" logger=settings file=/var/vcap/jobs/grafana/config/grafana.ini
t=2018-02-17T02:31:07+0000 lvl=info msg="Path Home" logger=settings path=/var/vcap/packages/grafana
t=2018-02-17T02:31:07+0000 lvl=info msg="Path Data" logger=settings path=/var/vcap/store/grafana
t=2018-02-17T02:31:07+0000 lvl=info msg="Path Logs" logger=settings path=/var/vcap/sys/log/grafana
t=2018-02-17T02:31:07+0000 lvl=info msg="Path Plugins" logger=settings path=/var/vcap/packages/grafana_plugins
t=2018-02-17T02:31:07+0000 lvl=info msg="App mode production" logger=settings
t=2018-02-17T02:31:07+0000 lvl=info msg="Writing PID file" logger=server path=/var/vcap/sys/run/grafana/grafana.pid pid=9773
t=2018-02-17T02:31:07+0000 lvl=info msg="Initializing DB" logger=sqlstore dbtype=postgres
t=2018-02-17T02:31:07+0000 lvl=info msg="Starting DB migration" logger=migrator
t=2018-02-17T02:31:07+0000 lvl=eror msg="Fail to initialize orm engine" logger=sqlstore error="Sqlstore::Migration failed err: pq: password authentication failed for user \"grafana\"\n"

` Checking postgres logs see this being entered as password

[2018-02-17 02:16:32+0000] + command='ALTER ROLE "grafana" WITH LOGIN PASSWORD '\''\(\(postgres_grafana_password\)\)'\'''
[2018-02-17 02:16:32+0000] + /var/vcap/packages/postgres-9.6.4/bin/psql -U vcap -p 5432 -d postgres -c 'ALTER ROLE "grafana" WITH LOGIN PASSWORD '\''\(\(postgres_grafana_password\)\)'\'''
bhudlemeyer commented 6 years ago

Adding the variable to the params file and to the pipeline.yml corrected this. Let me know if you would like a pull request for this to be the solution. Unless you have a more preferred way of providing the variable in mind.

Specifically all I did was add the below variable to the Deploy task and to the params file

Deploy task add under vars postgres_grafana_password: ((postgres_grafana_password)) and params file add
postgres_grafana_password: PASSWORD As a note this failed again on me when I used a password with special characters in it. Specifically i used a password with ! .

mkuratczyk commented 6 years ago

Seems like you are deploying to a BOSH director with no config server configured. This password should be generated by BOSH automatically. Your workaround is valid if you have to deploy it to a BOSH director like that but my strong recommendation would be to deploy BOSH with credhub. Since there is no reason for the operator to know this password I'd rather not require it in params.yml.

bhudlemeyer commented 6 years ago

You are correct no credhub as i have a dedicated bosh for nothing but concourse web and Prometheus deploy basically. So have not gone to the extent of putting a credhub on him. Will look into this and see how much work is involved in retrofitting into my monitoring/ci bosh instance.

On Sat, Feb 17, 2018, 14:34 Michal Kuratczyk notifications@github.com wrote:

Closed #11 https://github.com/pivotal-cf/pcf-prometheus-pipeline/issues/11.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pivotal-cf/pcf-prometheus-pipeline/issues/11#event-1479289113, or mute the thread https://github.com/notifications/unsubscribe-auth/ACK4otdQyeF-nEiCdS3SytcnUsT2Jh7rks5tV0XhgaJpZM4SJJ_N .