Controller upgrade only sends a change notification for the controller model

Bug #1789545 reported by Stuart Bishop
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Expired
High
Unassigned

Bug Description

Using the Controller/WatchAllModels call, when we upgrade the controller model with 'juju upgrade-juju --agent-version 2.4.2' my watcher gets a model change notification with the updated version details. However, I don't seem to be getting notifications from upgrades of the other models when 'juju upgrade-juju' is run on them.

Revision history for this message
Stuart Bishop (stub) wrote :

I'm not seeing controller model upgrade notifications either. I will open a fresh bug if I can determine the problem is not at my end.

Changed in juju:
status: New → Invalid
Revision history for this message
Tim Penhey (thumper) wrote :

No new bug forthcoming, so we need to figure out why the all watcher isn't passing on version information as it updates.

Changed in juju:
status: Invalid → Triaged
importance: Undecided → High
milestone: none → 2.6.4
Revision history for this message
Tim Penhey (thumper) wrote :

The agent version is injected into the agent status reporting in the allwatcher code. It is most likely that the documents that hold the agent's versions are not being watched, so this doesn't initiate a change in the allwatcher.

This should be relatively easy to fix.

tags: added: allwatcher bitesize mongodb
Changed in juju:
milestone: 2.6.4 → 2.6.5
Changed in juju:
milestone: 2.6.5 → 2.6.6
Changed in juju:
milestone: 2.6.6 → 2.6.7
Changed in juju:
milestone: 2.6.7 → 2.7-beta1
Changed in juju:
milestone: 2.7-beta1 → 2.7-rc1
Changed in juju:
milestone: 2.7-rc1 → none
Nam Nguyen (nammn)
Changed in juju:
assignee: nobody → Nam Nguyen (nammn)
Tim Penhey (thumper)
Changed in juju:
assignee: Nam Nguyen (nammn) → Tim Penhey (thumper)
status: Triaged → In Progress
Haw Loeung (hloeung)
Changed in juju:
assignee: Tim Penhey (thumper) → nobody
status: In Progress → Triaged
Revision history for this message
Ian Booth (wallyworld) wrote :

I tested this on 2.9 and it *seems* to be doing the right thing.
Making the WatchAllModels call, I got a watcher delta whenever any model config attribute was changed, including the "agent-version" attribute which is incremented when a model is upgraded.

I whipped up a small libjuju script to test with. Note, there appears to be a bug in libjuju where the watcher id is not being properly set for the AllModelWatcherFacade facade, so the Next() call fails, so I had to monkey patch that (in juju/client/overrides.y). But nonetheless, the script showed that things were doing the right thing on the controller, ie

juju model-config foo-bar

on any model would fire the watcher. As would juju upgrade-model

I'll mark as Incomplete - if it's still an issue on juju 2.9, we can reopen.

#!/usr/bin/python3

import asyncio
import logging

from juju.client import client
from juju.model import Controller

async def watch():
    controller = Controller()
    await controller.connect()

    api = client.ControllerFacade.from_connection(controller.connection())
    watcher = client.AllModelWatcherFacade.from_connection(
        controller.connection())
    result = await api.WatchAllModels()
    watcher.Id = result.watcher_id

    while True:
        change = await watcher.Next()
        for delta in change.deltas:
            print("-- change --\n{}\n".format(delta))

if __name__ == '__main__':
    logging.basicConfig(level=logging.INFO)
    ws_logger = logging.getLogger('websockets.protocol')
    ws_logger.setLevel(logging.INFO)
    asyncio.run(watch())

Changed in juju:
status: Triaged → Incomplete
Revision history for this message
Ian Booth (wallyworld) wrote :

Here's some truncated output using the above script. I upgraded a non-controller model from 2.9.20.3 to 2.9.20.4. Note the "agent-version" change.

-- change --
<class 'juju.client.overrides.Delta'>({'deltas': ['model', 'change', {'model-uuid': '53815d9f-3b59-4483-85b8-d9bded547206', 'name': 'controller', 'life': 'alive', 'owner': 'admin', 'controller-uuid': 'dc13fa65-e759-4be8-8011-b7aa0ef10930', 'is-controller': True, 'config': {'agent-metadata-url': '', 'agent-version': '2.9.20.3',
-- change --
<class 'juju.client.overrides.Delta'>({'deltas': ['model', 'change', {'model-uuid': '53815d9f-3b59-4483-85b8-d9bded547206', 'name': 'controller', 'life': 'alive', 'owner': 'admin', 'controller-uuid': 'dc13fa65-e759-4be8-8011-b7aa0ef10930', 'is-controller': True, 'config': {'agent-metadata-url': '', 'agent-version': '2.9.20.4',

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for juju because there has been no activity for 60 days.]

Changed in juju:
status: Incomplete → Expired
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.