warning "cannot remove unknown model from cache" after destroying model

Bug #1805251 reported by Christian Muirhead
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Anastasia
2.4
Fix Released
High
Anastasia

Bug Description

In Juju 2.5-beta2, if I add a model and then destroy it I sometimes see the warning "cannot remove unknown model from cache: model E:admin/m not found"

It seems like a race where the client tries to get info from the controller after the model has gone - sometimes it's still there so the warning doesn't happen.

Debug logging below:
xtian@marathe:~$ juju add-model m
Added 'm' model on localhost/localhost with credential 'localhost' for user 'admin'
xtian@marathe:~$ juju destroy-model m -y --debug
11:16:49 INFO juju.cmd supercommand.go:56 running juju [2.5-beta2 gc go1.11.2]
11:16:49 DEBUG juju.cmd supercommand.go:57 args: []string{"juju", "destroy-model", "m", "-y", "--debug"}
11:16:49 INFO juju.juju api.go:67 connecting to API addresses: [10.62.129.82:17070]
11:16:49 DEBUG juju.api apiclient.go:883 successfully dialed "wss://10.62.129.82:17070/api"
11:16:49 INFO juju.api apiclient.go:603 connection established to "wss://10.62.129.82:17070/api"
11:16:49 INFO juju.juju api.go:67 connecting to API addresses: [10.62.129.82:17070]
11:16:49 DEBUG juju.api apiclient.go:883 successfully dialed "wss://10.62.129.82:17070/model/a6c57475-d552-404d-8727-ea788c805a9e/api"
11:16:49 INFO juju.api apiclient.go:603 connection established to "wss://10.62.129.82:17070/model/a6c57475-d552-404d-8727-ea788c805a9e/api"
11:16:49 INFO cmd destroy.go:277 Destroying model
11:16:50 INFO cmd destroy.go:295 Waiting on model to be removed...
11:16:52 INFO cmd destroy.go:356 Model destroyed.
11:16:52 WARN juju.cmd.modelcmd base.go:174 cannot remove unknown model from cache: model E:admin/m not found
11:16:52 DEBUG juju.api monitor.go:35 RPC connection died
11:16:52 DEBUG juju.api monitor.go:35 RPC connection died
11:16:52 INFO cmd supercommand.go:465 command finished

Ian Booth (wallyworld)
Changed in juju:
assignee: nobody → Anastasia (anastasia-macmood)
status: New → Triaged
importance: Undecided → High
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.5-beta2 → 2.5-beta3
Changed in juju:
milestone: 2.5-beta3 → 2.5-rc1
Revision history for this message
Anastasia (anastasia-macmood) wrote :

I could not reproduce this at all... not on lxd provider not on aws...

However, just by examining the code, it looks like we are indeed throwing a NotFound error when we get a request to remove a model from cache that is not in the cache.

We can treat this situation as a no-op and not throw an error... But at this stage, I ma not too sure what the implications are for other usages of this API.

So the fix is for us to ignore NotFound errors @ https://github.com/juju/juju/blob/2.4/cmd/modelcmd/base.go#L174

Revision history for this message
Anastasia (anastasia-macmood) wrote :
Revision history for this message
Anastasia (anastasia-macmood) wrote :
Changed in juju:
status: Triaged → In Progress
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
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.