rabbitmq-server package got upgraded after system restart
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack RabbitMQ Server Charm |
Fix Released
|
Medium
|
Mario Splivalo |
Bug Description
[Deployed environment]
Juju: v2.1.2
charm: cs:rabbitmq-
OS: Ubuntu 16.04
[Description]
After system reboot, it looks like that rabbitmq-server package got upgraded during the config-changed hook.
I could see that the upgrade was done in the charm, according to this log from /var/log/
2017-05-11 13:30:12 INFO juju-log Installing ['rabbitmq-server', 'python-amqplib', 'lockfile-progs'] with options: ['--option=
2017-05-11 13:30:12 INFO config-changed Reading package lists...
2017-05-11 13:30:12 INFO config-changed Building dependency tree...
2017-05-11 13:30:12 INFO config-changed Reading state information...
2017-05-11 13:30:12 INFO config-changed lockfile-progs is already the newest version (0.1.17).
2017-05-11 13:30:12 INFO config-changed python-amqplib is already the newest version (1.0.2-1).
2017-05-11 13:30:12 INFO config-changed The following packages will be upgraded:
2017-05-11 13:30:12 INFO config-changed rabbitmq-server
2017-05-11 13:30:13 INFO config-changed 1 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.
According to the hook script[0], it looks like apt_install() function is being called in config-changed hook.
Therefore, by restarting the jujud-unit-
I think this behavior is not necessary, and should not be triggered in config-changed hook.
[Reproduction steps]
I could reproduce this with the following steps.
$ juju deploy rabbitmq-server
$ juju ssh rabbitmq-server/0
$ apt policy rabbitmq-server
rabbitmq-server:
Installed: 3.5.7-1ubuntu0.
Candidate: 3.5.7-1ubuntu0.
Version table:
*** 3.5.7-1ubuntu0.
500 http://
100 /var/lib/
3.5.7-1 500
500 http://
$ sudo apt install rabbitmq-
$ apt policy rabbitmq-server
rabbitmq-server:
Installed: 3.5.7-1
Candidate: 3.5.7-1ubuntu0.
Version table:
3.5.7-1ubuntu0.
500 http://
*** 3.5.7-1 500
500 http://
100 /var/lib/
$ sudo systemctl restart jujud-unit-
$ apt policy rabbitmq-server
rabbitmq-server:
Installed: 3.5.7-1ubuntu0.
Candidate: 3.5.7-1ubuntu0.
Version table:
*** 3.5.7-1ubuntu0.
500 http://
100 /var/lib/
3.5.7-1 500
500 http://
Changed in charm-rabbitmq-server: | |
importance: | Undecided → Medium |
milestone: | none → 17.08 |
Changed in charm-rabbitmq-server: | |
status: | Fix Committed → Fix Released |
This also seems, at least, odd to me. It looks like the rationale was that the rabbitmq-server can be upgraded to version from a different source pocket (like, 'newer' cloud archive repos, or some other ppa) by merely doing 'juju set rabbitmq-server source="cloud:..." - that will change the sources.list and run apt-get update/upgrade mantra.
However, this has a undesired side effect: apt-get update/upgrade is being run each time config-hook is run - when machine gets rebooted, when state server(s) get rebooted, or when some other charm option has been changed and it means that the operator lost control on when the packages are being upgraded.
Usually the operator wants to control when packages are being upgraded; it is highly unusual that one would get packages upgraded after machine gets rebooted.
I've also checked other openstack charms and none of them exhibit this behavior. For all of the other charms setting the 'source' or 'origin' charm option will not auto-trigger apt-get update/upgrade mantra; this seems like the correct behavior. If an operator wishes to change/upgrade his or hers packages a 'juju set' accompanied with 'juju run' or desired action should be executed.
To be consistent with other charms (at least), the commit https:/ /github. com/openstack/ charm-rabbitmq- server/ commit/ 28067861bf8711e c1359a87feebeb5 34a88028a7 (which introduced this change) should be, imho, reverted.