What could make a relation setting be "forgotten"?

Andreas Hasenack andreas at canonical.com
Thu Jun 6 19:56:11 UTC 2013


The postgresql charm has this snipped:

def db_admin_relation_joined_changed(user, database='all'):
    if not user_exists(user):
        password = create_user(user, admin=True)
        run("relation-set user='%s' password='%s'" % (user, password))

I see it being called:
2013-06-06 18:35:04 INFO juju server.go:105 worker/uniter/jujuc: running
hook tool "relation-set" ["user=db_admin_10_landscape_admin"
"password=33jArfAYrCwQKA4B5QdCj"]

After that, there was a backtrace caused by a bug further down in that
method. But the user was created in the DB (that's create_user() from the
snipped above).

To fix the bug I had to issue a few upgrade-charms and resolved --retry.
The relation-set for user and password was never called again, because the
user exists in the database already.

But once I got all bugs fixed, via upgrade-charms and resolved --retry, the
other end of the relation doesn't see user and password.

So, could that first call to relation-set, that worked and created the
user, somehow have been "forgotten" due to the backtrace in the hook and
sequence of upgrade-charm and resolved calls? I will debug further in the
charm, try to reproduce it, etc., but maybe someone knows this already.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20130606/cb2ffcdc/attachment.html>


More information about the Juju mailing list