canonical / postgresql-k8s-bundle

Canonical Distribution of PostgreSQL + PgBouncer
https://charmhub.io/postgresql-k8s-bundle
Apache License 2.0
5 stars 1 forks source link

Data-integrator blocked asking for a relation that seem to have #244

Closed gustavosr98 closed 2 weeks ago

gustavosr98 commented 2 weeks ago

Steps to reproduce

Just deploy the bundle

juju deploy postgresql-k8s-bundle --channel 14/edge --trust

Expected behavior

data-integrator not to be in blocked state

Actual behavior

# ubuntu@microk8s:~$ juju status
Model  Controller       Cloud/Region     Version  SLA          Timestamp
pg     micro-localhost  micro/localhost  3.5.4    unsupported  18:28:22Z

App                       Version  Status   Scale  Charm                     Channel      Rev  Address         Exposed  Message
data-integrator                    blocked      1  data-integrator           latest/edge   72  10.152.183.60   no       Please relate the data-integrator with the desired product
grafana-agent-k8s         0.40.4   blocked      1  grafana-agent-k8s         latest/edge   95  10.152.183.241  no       Missing ['grafana-cloud-config']|['grafana-dashboards-provider'] for grafana-dashboards-consumer; ['grafana-cloud-con...
pgbouncer-k8s             1.21.0   waiting      1  pgbouncer-k8s             1/edge       329  10.152.183.98   no       installing agent
postgresql-k8s            14.13    waiting      2  postgresql-k8s            14/edge      431  10.152.183.72   no       installing agent
postgresql-test-app                active       1  postgresql-test-app       latest/edge  273  10.152.183.182  no       received database credentials of the first database
s3-integrator                      blocked      1  s3-integrator             latest/edge   73  10.152.183.164  no       Missing parameters: ['access-key', 'secret-key']
self-signed-certificates           active       1  self-signed-certificates  latest/edge  202  10.152.183.38   no
sysbench                           waiting      1  sysbench                  latest/edge   91  10.152.183.200  no       installing agent

Unit                         Workload  Agent  Address       Ports  Message
data-integrator/0*           blocked   idle   10.1.128.200         Please relate the data-integrator with the desired product
grafana-agent-k8s/0*         blocked   idle   10.1.128.203         Missing ['grafana-cloud-config']|['grafana-dashboards-provider'] for grafana-dashboards-consumer; ['grafana-cloud-con...
pgbouncer-k8s/0*             waiting   idle   10.1.128.202         waiting for backend-database relation to connect
postgresql-k8s/0             waiting   idle   10.1.128.208         awaiting for member to start
postgresql-k8s/1*            active    idle   10.1.128.209         Primary
postgresql-test-app/0*       active    idle   10.1.128.204         received database credentials of the first database
s3-integrator/0*             blocked   idle   10.1.128.207         Missing parameters: ['access-key', 'secret-key']
self-signed-certificates/0*  active    idle   10.1.128.210
sysbench/0*                  waiting   idle   10.1.128.211         Waiting on data from relation
ubuntu@microk8s:~$ juju relate data-integrator pgbouncer-k8s
ERROR cannot add relation "data-integrator:postgresql pgbouncer-k8s:database"
relation data-integrator:postgresql pgbouncer-k8s:database (already exists):

Use 'juju status --relations' to view the current relations.
# ubuntu@microk8s:~$ juju status --relations | grep data-integrator
data-integrator                    blocked      1  data-integrator           latest/edge   72  10.152.183.60   no       Please relate the data-integrator with the desired product
data-integrator/0*           blocked   idle   10.1.128.200         Please relate the data-integrator with the desired product
data-integrator:data-integrator-peers      data-integrator:data-integrator-peers          data-integrator-peers  peer
pgbouncer-k8s:database                     data-integrator:postgresql                     postgresql_client      regular

Versions

Juju: 3.5/stable Bundle version: 14/edge rev161 microk8s: 1.30/stable

Log output

# ubuntu@microk8s:~$ juju debug-log --include data-integrator --replay
unit-data-integrator-0: 18:16:24 INFO juju.cmd running containerAgent [3.5.4 31b4b0914740b84ad8166993635ac797a44276de gc go1.23.1]
unit-data-integrator-0: 18:16:24 INFO juju.cmd.containeragent.unit start "unit"
unit-data-integrator-0: 18:16:24 INFO juju.worker.upgradesteps upgrade steps for 3.5.4 have already been run.
unit-data-integrator-0: 18:16:24 INFO juju.worker.probehttpserver starting http server on 127.0.0.1:65301
unit-data-integrator-0: 18:16:24 INFO juju.api cannot resolve "controller-service.controller-micro-localhost.svc.cluster.local": lookup controller-service.controller-micro-localhost.svc.cluster.local: operation was canceled
unit-data-integrator-0: 18:16:24 INFO juju.api connection established to "wss://10.152.183.147:17070/model/372067a8-ada2-439a-8eaf-8ab2ade9e4d4/api"
unit-data-integrator-0: 18:16:24 INFO juju.worker.apicaller [372067] "unit-data-integrator-0" successfully connected to "10.152.183.147:17070"
unit-data-integrator-0: 18:16:24 INFO juju.worker.migrationminion migration migration phase is now: NONE
unit-data-integrator-0: 18:16:24 INFO juju.worker.logger logger worker started
unit-data-integrator-0: 18:16:24 WARNING juju.worker.proxyupdater unable to set snap core settings [proxy.http= proxy.https= proxy.store=]: exec: "snap": executable file not found in $PATH, output: ""
unit-data-integrator-0: 18:16:24 INFO juju.worker.leadership data-integrator/0 promoted to leadership of data-integrator
unit-data-integrator-0: 18:16:24 INFO juju.worker.caasupgrader abort check blocked until version event received
unit-data-integrator-0: 18:16:24 INFO juju.worker.caasupgrader unblocking abort check
unit-data-integrator-0: 18:16:24 INFO juju.agent.tools ensure jujuc symlinks in /var/lib/juju/tools/unit-data-integrator-0
unit-data-integrator-0: 18:16:24 INFO juju.worker.uniter unit "data-integrator/0" started
unit-data-integrator-0: 18:16:24 INFO juju.worker.uniter resuming charm install
unit-data-integrator-0: 18:16:24 INFO juju.worker.uniter.charm downloading ch:amd64/data-integrator-72 from API server
unit-data-integrator-0: 18:16:24 INFO juju.downloader downloading from ch:amd64/data-integrator-72
unit-data-integrator-0: 18:16:24 INFO juju.downloader download complete ("ch:amd64/data-integrator-72")
unit-data-integrator-0: 18:16:24 INFO juju.downloader download verified ("ch:amd64/data-integrator-72")
unit-data-integrator-0: 18:16:26 INFO juju.worker.uniter hooks are retried true
unit-data-integrator-0: 18:16:26 INFO juju.worker.uniter found queued "install" hook
unit-data-integrator-0: 18:16:26 WARNING unit.data-integrator/0.install /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:16:26 WARNING unit.data-integrator/0.install   main(IntegratorCharm)
unit-data-integrator-0: 18:16:26 INFO unit.data-integrator/0.juju-log Running legacy hooks/install.
unit-data-integrator-0: 18:16:26 WARNING unit.data-integrator/0.install /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:16:26 WARNING unit.data-integrator/0.install   main(IntegratorCharm)
unit-data-integrator-0: 18:16:26 INFO juju.worker.uniter.operation ran "install" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:16:27 WARNING unit.data-integrator/0.data-integrator-peers-relation-created /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:16:27 WARNING unit.data-integrator/0.data-integrator-peers-relation-created   main(IntegratorCharm)
unit-data-integrator-0: 18:16:27 INFO juju.worker.uniter.operation ran "data-integrator-peers-relation-created" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:16:27 INFO juju.worker.uniter found queued "leader-elected" hook
unit-data-integrator-0: 18:16:27 WARNING unit.data-integrator/0.leader-elected /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:16:27 WARNING unit.data-integrator/0.leader-elected   main(IntegratorCharm)
unit-data-integrator-0: 18:16:27 INFO juju.worker.uniter.operation ran "leader-elected" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:16:27 WARNING unit.data-integrator/0.config-changed /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:16:27 WARNING unit.data-integrator/0.config-changed   main(IntegratorCharm)
unit-data-integrator-0: 18:16:28 INFO juju.worker.uniter.operation ran "config-changed" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:16:28 INFO juju.worker.uniter found queued "start" hook
unit-data-integrator-0: 18:16:28 WARNING unit.data-integrator/0.start /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:16:28 WARNING unit.data-integrator/0.start   main(IntegratorCharm)
unit-data-integrator-0: 18:16:28 INFO unit.data-integrator/0.juju-log Running legacy hooks/start.
unit-data-integrator-0: 18:16:28 WARNING unit.data-integrator/0.start /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:16:28 WARNING unit.data-integrator/0.start   main(IntegratorCharm)
unit-data-integrator-0: 18:16:28 INFO juju.worker.uniter.operation ran "start" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:16:35 WARNING unit.data-integrator/0.postgresql-relation-created /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:16:35 WARNING unit.data-integrator/0.postgresql-relation-created   main(IntegratorCharm)
unit-data-integrator-0: 18:16:35 INFO juju.worker.uniter.operation ran "postgresql-relation-created" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:16:55 WARNING unit.data-integrator/0.postgresql-relation-joined /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:16:55 WARNING unit.data-integrator/0.postgresql-relation-joined   main(IntegratorCharm)
unit-data-integrator-0: 18:16:55 INFO juju.worker.uniter.operation ran "postgresql-relation-joined" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:16:55 WARNING unit.data-integrator/0.postgresql-relation-changed /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:16:55 WARNING unit.data-integrator/0.postgresql-relation-changed   main(IntegratorCharm)
unit-data-integrator-0: 18:16:55 INFO juju.worker.uniter.operation ran "postgresql-relation-changed" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:17:12 WARNING unit.data-integrator/0.postgresql-relation-changed /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:17:12 WARNING unit.data-integrator/0.postgresql-relation-changed   main(IntegratorCharm)
unit-data-integrator-0: 18:17:12 INFO juju.worker.uniter.operation ran "postgresql-relation-changed" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:20:29 WARNING unit.data-integrator/0.update-status /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:20:29 WARNING unit.data-integrator/0.update-status   main(IntegratorCharm)
unit-data-integrator-0: 18:20:29 INFO juju.worker.uniter.operation ran "update-status" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:25:45 WARNING unit.data-integrator/0.update-status /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:25:45 WARNING unit.data-integrator/0.update-status   main(IntegratorCharm)
unit-data-integrator-0: 18:25:45 INFO juju.worker.uniter.operation ran "update-status" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:26:06 WARNING unit.data-integrator/0.config-changed /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:26:06 WARNING unit.data-integrator/0.config-changed   main(IntegratorCharm)
unit-data-integrator-0: 18:26:07 INFO juju.worker.uniter.operation ran "config-changed" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:26:08 WARNING unit.data-integrator/0.postgresql-relation-changed /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:26:08 WARNING unit.data-integrator/0.postgresql-relation-changed   main(IntegratorCharm)
unit-data-integrator-0: 18:26:09 INFO juju.worker.uniter.operation ran "postgresql-relation-changed" hook (via hook dispatching script: dispatch)
unit-data-integrator-0: 18:31:27 WARNING unit.data-integrator/0.update-status /var/lib/juju/agents/unit-data-integrator-0/charm/./src/charm.py:402: DeprecationWarning: Calling `ops.main.main()` is deprecated, call `ops.main()` instead
unit-data-integrator-0: 18:31:27 WARNING unit.data-integrator/0.update-status   main(IntegratorCharm)
unit-data-integrator-0: 18:31:27 INFO juju.worker.uniter.operation ran "update-status" hook (via hook dispatching script: dispatch)

Additional context

grafana-agent is expected. I did not added a relation to COS.

s3-integrator is expected. I did not provide S3 credentials.

data-integrator is missing database-name config so manually added it. juju config data-integrator database-name=testdb

syncronize-issues-to-jira[bot] commented 2 weeks ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/DPE-5716.

This message was autogenerated

gustavosr98 commented 2 weeks ago

It actually looks like after sometime the blocked status gets solved

# ubuntu@microk8s:~$ juju status
Model  Controller       Cloud/Region     Version  SLA          Timestamp
pg     micro-localhost  micro/localhost  3.5.4    unsupported  19:43:48Z

App                       Version  Status   Scale  Charm                     Channel      Rev  Address         Exposed  Message
data-integrator                    active       1  data-integrator           latest/edge   72  10.152.183.60   no
grafana-agent-k8s         0.40.4   blocked      1  grafana-agent-k8s         latest/edge   95  10.152.183.241  no       Missing ['grafana-cloud-config']|['grafana-dashboards-provider'] for grafana-dashboards-consumer; ['grafana-cloud-con...
pgbouncer-k8s             1.21.0   active       1  pgbouncer-k8s             1/edge       329  10.152.183.98   no
postgresql-k8s            14.13    active       2  postgresql-k8s            14/edge      431  10.152.183.72   no
postgresql-test-app                active       1  postgresql-test-app       latest/edge  273  10.152.183.182  no       received database credentials of the first database
s3-integrator                      blocked      1  s3-integrator             latest/edge   73  10.152.183.164  no       Missing parameters: ['access-key', 'secret-key']
self-signed-certificates           active       1  self-signed-certificates  latest/edge  202  10.152.183.38   no
sysbench                           waiting      1  sysbench                  latest/edge   91  10.152.183.200  no       installing agent

Unit                         Workload  Agent  Address       Ports  Message
data-integrator/0*           active    idle   10.1.128.200
grafana-agent-k8s/0*         blocked   idle   10.1.128.203         Missing ['grafana-cloud-config']|['grafana-dashboards-provider'] for grafana-dashboards-consumer; ['grafana-cloud-con...
pgbouncer-k8s/0*             active    idle   10.1.128.202
postgresql-k8s/0             active    idle   10.1.128.208
postgresql-k8s/1*            active    idle   10.1.128.209         Primary
postgresql-test-app/0*       active    idle   10.1.128.204         received database credentials of the first database
s3-integrator/0*             blocked   idle   10.1.128.207         Missing parameters: ['access-key', 'secret-key']
self-signed-certificates/0*  active    idle   10.1.128.210
sysbench/0*                  waiting   idle   10.1.128.211         Waiting on data from relation
dragomirp commented 2 weeks ago

Hi, to provide some context, before the data-integrator to Pgbouncer relation can be established, the backend Pgbouncer to Postgresql relation must be ready.