Skip to content

Postgresql charm does not get out of blocked state after removing relation with s3-integrator #97

@gustavosr98

Description

@gustavosr98

Bug Description

I am trying to use the s3-integrator charm to relate to postgresql charm.
First I didn't have the bucket created because I was assuming the s3-integrator charm was going to create it.

After I got the blocked state in the postgresql charm:
I created an s3 bucket in AWS
Updated the s3-integrator charm to use the new existing bucket
But it was still blocked

A second intent after having the postgresql charm in blocked state was to remove the relation between the charms
Postgresql charm was still in blocked state even after relation was gone
Tried adding the relation back but nothing changed

@marceloneppel mentioned the blocked messaged could be related to permissions or something similar.
So, we could improve that message.

To Reproduce

$ juju deploy postgresql pg-m --channel edge --series jammy
$ juju deploy s3-integrator --channel edge --series jammy

# Wait deployment to settle

# How to configure S3 how to docs from mongodb charm
# https://charmhub.io/mongodb/docs/h-configure-s3?channel=5/edge
$ juju run-action s3-integrator/leader sync-s3-credentials access-key=<access-key-here> secret-key=<secret-key-here> --wait

$ aws s3 ls
# None

$ juju config s3-integrator \
    path="pg-m/0" \
    region="us-east-1" \
    bucket="test-bucket"

$ juju relate s3-integrator pg-m

Now in blocked state. Relevant log output

Try updating config with an existing S3 bucket

# Create S3 bucket
$ aws s3 mb s3://pg-bucket-gustavosr98
$ aws s3 ls                   
2023-03-29 14:38:03 pg-bucket-gustavosr98

$ juju config s3-integrator bucket="pg-bucket-gustavosr98"

# Still blocked

Try removing relation

$ juju remove-relation s3-integrator pg-m

$ juju status --relations | grep pg-m | grep s3-integrator
# None

# Still showing as blocked
# even after relation is gone

Try adding relation back

$ juju add-relation s3-integrator pg-m
# Still showing as blocked

Environment

juju: 2.9.42 (Client and Controller)
juju cloud substrate: LXD

postgresql charm: latest/edge (rev 281)
s3-integrator charm: latest/edge (rev 8)

s3 provider: AWS S3

Relevant log output

$ juju status
[..]
pg-m/0*             blocked   idle   0        10.46.90.187           failed to initialize stanza
s3-integrator/0*    active    idle   2        10.46.90.83

$ juju ssh pg-m/0 "sudo less /var/log/juju/unit-pg-m-0.lg"
2023-03-29 19:17:16 INFO juju.worker.uniter.operation runhook.go:159 ran "s3-parameters-relation-joined" hook (via hook dispatching script: dispatch)
2023-03-29 19:17:16 WARNING unit.pg-m/0.juju-log server.go:316 s3-parameters:4: Some mandatory fields: ['access-key', 'secret-key'] are not present, do not emit credential change event!
2023-03-29 19:17:17 INFO juju.worker.uniter.operation runhook.go:159 ran "s3-parameters-relation-changed" hook (via hook dispatching script: dispatch)
2023-03-29 19:17:17 ERROR unit.pg-m/0.juju-log server.go:316 s3-parameters:4: ERROR: [032]: 'pg-m/0' must begin with / for 'repo1-path' option

2023-03-29 19:17:18 INFO juju.worker.uniter.operation runhook.go:159 ran "s3-parameters-relation-changed" hook (via hook dispatching script: dispatch)
2023-03-29 19:18:31 WARNING unit.pg-m/0.juju-log server.go:316 No relation: certificates
2023-03-29 19:18:31 INFO juju.worker.uniter.operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch)
2023-03-29 19:23:55 WARNING unit.pg-m/0.juju-log server.go:316 No relation: certificates
2023-03-29 19:23:55 INFO juju.worker.uniter.operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch)
2023-03-29 19:29:53 WARNING unit.pg-m/0.juju-log server.go:316 No relation: certificates
2023-03-29 19:29:54 INFO juju.worker.uniter.operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch)
2023-03-29 19:35:04 WARNING unit.pg-m/0.juju-log server.go:316 No relation: certificates
2023-03-29 19:35:04 INFO juju.worker.uniter.operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch)
2023-03-29 19:38:20 WARNING unit.pg-m/0.juju-log server.go:316 s3-parameters:4: couldn't initialize stanza due to a blocked status

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions