That said, in trying to create a clean reproducer, it seems that the issue is just one about logging, not one about actually changing the password. These are the steps I tried:
juju bootstrap lxd lxd --debug
juju add-model test
juju deploy jameinel-ubuntu-lite
juju debug-log -m controller # in one window
root@juju-6e4447-0:/var/lib/juju/agents/unit-ubuntu-lite-0# juju_stop_unit ubuntu-lite/0
ubuntu-lite/0: stopped
root@juju-6e4447-0:/var/lib/juju/agents/unit-ubuntu-lite-0# juju_start_unit ubuntu-lite/0
ubuntu-lite/0: started
In the other window I can see the log lines for:
machine-0: 11:19:09 INFO juju.apiserver.connection agent login: unit-ubuntu-lite-0 for 714a0816-ce6b-4be4-8c7c-e838126e4447
machine-0: 11:19:09 INFO juju.apiserver.common setting password for "unit-ubuntu-lite-0"
It didn't actually change the passwords. We should also confirm that inside of Mongo it also has the same password hash for the unit. (I did this multiple times and can see that it continually has the same password as before, but every juju_stop_unit+juju_start_unit triggers the same 'setting password' log entry)
But the fix for this is to fix the log messages to only log when we *actually* change the password for the unit.
That said, in trying to create a clean reproducer, it seems that the issue is just one about logging, not one about actually changing the password. These are the steps I tried:
juju bootstrap lxd lxd --debug ubuntu- lite
juju add-model test
juju deploy jameinel-
juju debug-log -m controller # in one window
juju ssh ubuntu-lite/0 juju/agents/ unit-ubuntu- lite-0 6e4447- 0:/var/ lib/juju/ agents/ unit-ubuntu- lite-0# grep password agent.conf uBrC/nv5T d6ZYlSK/ t
sudo -i
cd /var/log/
root@juju-
apipassword: Auub3/pAtxaQKSR
oldpassword: AvdsckVEF8hj06Y
root@juju- 6e4447- 0:/var/ lib/juju/ agents/ unit-ubuntu- lite-0# juju_stop_unit ubuntu-lite/0 6e4447- 0:/var/ lib/juju/ agents/ unit-ubuntu- lite-0# juju_start_unit ubuntu-lite/0
ubuntu-lite/0: stopped
root@juju-
ubuntu-lite/0: started
In the other window I can see the log lines for: connection agent login: unit-ubuntu-lite-0 for 714a0816- ce6b-4be4- 8c7c-e838126e44 47 common setting password for "unit-ubuntu- lite-0"
machine-0: 11:19:09 INFO juju.apiserver.
machine-0: 11:19:09 INFO juju.apiserver.
However: 6e4447- 0:/var/ lib/juju/ agents/ unit-ubuntu- lite-0# grep password agent.conf uBrC/nv5T d6ZYlSK/ t
root@juju-
apipassword: Auub3/pAtxaQKSR
oldpassword: AvdsckVEF8hj06Y
It didn't actually change the passwords. We should also confirm that inside of Mongo it also has the same password hash for the unit. (I did this multiple times and can see that it continually has the same password as before, but every juju_stop_ unit+juju_ start_unit triggers the same 'setting password' log entry)
But the fix for this is to fix the log messages to only log when we *actually* change the password for the unit.