config-changed does not regenerate config file

Bug #1805101 reported by Alvaro Uria
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Thruk Master Charm
Fix Released
Medium
Alok G Singh

Bug Description

* metadata.yaml only supports trusty and xenial
* new v2.24 packages have been added to Thruk ppa.
* Bionic support needs to be tested and charm updated.

Related branches

Revision history for this message
Alvaro Uria (aluria) wrote :

Tested to add bionic "series" in metadata.yaml.

"""
cd thruk-master-charm
juju deploy . thruk-master --series bionic
cd ../thruk-external-agent-charm
juju deploy . thruk-test-external-agent --series bionic
juju add-relation thruk-master thruk-test-external-agent
"""

thruk-test-external-agent uses "url=http://127.0.0.1/" by default, and following "juju config ..." to update "url" value doesn't work as expected:

In thruk-master unit, /var/log/thruk/thruk.log shows:
"""
[2018/11/26 14:54:11][juju-92b911-11][ERROR][Thruk] No Backend available
[2018/11/26 14:54:11][juju-92b911-11][ERROR][Thruk] juju: remote site returned rc: 1 - "authorization failed, no auth key specified for http://127.0.0.1/thruk/cgi-bin/remote.cgi\n" (http://127.0.0.1)
[2018/11/26 14:54:11][juju-92b911-11][ERROR][Thruk] on page: http://10.205.6.183/thruk/cgi-bin/tac.cgi?_=1543244051029
[2018/11/26 14:54:11][juju-92b911-11][ERROR][Thruk] User: thrukadmin
"""

/var/cache/thruk/lmd/lmd.ini had to be manually updated:
"""
[[Connections]]
name = 'juju'
id = '5a105e8b9d40e1329780d62ea2265d8a'
source = ['http://127.0.0.1/']
auth = '' ## <-- needed to be manually updated
"""

Then, "service thruk restart", and lmd.ini got automatically updated to the new data shared via juju relation with thruk-external-agent-charm:
"""
[[Connections]]
name = 'test1'
id = '5a105e8b9d40e1329780d62ea2265d8a'
source = ['http://10.205.6.227/']
auth = '0b0d118151ab45cbefd167d4f0a36b21'
"""

TL;DR: thruk-master-charm may need to be rewritten to reactive charm (now uses the Service framework) to better manage config changes (even coming from relations).

Revision history for this message
Alok G Singh (alephnull-b) wrote :

So it turns out that this is not related to bionic support at all.

The root cause for this problem is that the charm thinks that the thruk service service is called thruk-master. It should be called thruk. The charm correctly populates /etc/thruk/thruk_local.conf but since the thruk service is not restarted /var/cache/thruk/lmd/lmd.ini is not updated.

This bug has probably existed since trusty since the playbook for thruk mentions that apache should be reloaded. This in turn reloads thruk and the config is generated correctly.

Andrea Ieri (aieri)
Changed in thruk-master-charm:
status: New → Confirmed
importance: Undecided → Medium
assignee: Alvaro Uría (aluria) → Alok G Singh (alephnull-b)
status: Confirmed → In Progress
summary: - Add bionic support
+ config-changed does not regenerate config file
Changed in thruk-master-charm:
status: In Progress → Fix Committed
Changed in thruk-master-charm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.