canonical / wordpress-k8s-operator

wordpress-k8s-operator - charm repository.
Apache License 2.0
13 stars 7 forks source link

No more relational databag usage #163

Closed juditnovak closed 12 months ago

juditnovak commented 1 year ago

Bug Description

Currently the wordpress(-k8s) charm is reading information from the databag. This results in the charm hanging in the _test_database_connectivity() function at reconciliation, when the service would start up.

https://github.com/canonical/wordpress-k8s-operator/blob/main/src/charm.py#L612-L613

This and similar references direct references to the databag must be changed to use the fetch_relation_data() (or the new, more convenient fetch_relation_field() interface function call.

Please feel free to reach out if more info or help may be needed.

To Reproduce

juju deploy wordpress-k8s --channel latest/edge

juju deploy mysql-router-k8s --trust --channel 8.0/edge juju deploy mysql-k8s --trust --channel 8.0/edge

juju relate mysql-router-k8s mysql-k8s juju relate mysql-router-k8s wordpress-k8s

Environment

Juju 3.1

Relevant log output

Typically the "last words" wordpress may say before hanging:

unit-wordpress-k8s-0: 23:29:56 INFO unit.wordpress-k8s/0.juju-log database:7: Ensure WordPress (apache) server is down
unit-wordpress-k8s-0: 23:30:05 INFO unit.wordpress-k8s/0.juju-log database:7: Update wp-config.php content in container
unit-wordpress-k8s-0: 23:30:17 INFO unit.wordpress-k8s/0.juju-log database:7: Ensure WordPress server is up

Additional context

No response

juditnovak commented 12 months ago

The issue was resolved in https://github.com/canonical/wordpress-k8s-operator/pull/166