Juju controller fails to remove offers from model

Bug #1952795 reported by Steven Parker
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Expired
High
Unassigned

Bug Description

performed service restarts on all juju controllers just in case that worked but it did not help

---

juju offers
Offer User Relation id Status Endpoint Interface Role Ingress subnets
filebeat-maas-infra -
nrpe-maas-infra -
telegraf-maas-infra -

--------------------------------------

juju status --relations

...

Offer Application Charm Rev Connected Endpoint Interface Role
filebeat-maas-infra filebeat-maas-infra filebeat 24 0/0

...

------------------------------------

 juju remove-offer admin/maas-infra.filebeat-maas-infra --debug
01:07:03 INFO juju.cmd supercommand.go:56 running juju [2.9.19 0 bae1644c23fd86e58dbf7249af55a236d0159099 gc go1.14.15]
01:07:03 DEBUG juju.cmd supercommand.go:57 args: []string{"/snap/juju/17725/bin/juju", "remove-offer", "admin/maas-infra.filebeat-maas-infra", "--debug"}
01:07:03 INFO juju.juju api.go:78 connecting to API addresses: [10.145.252.41:17070 10.145.252.40:17070 10.145.252.42:17070]
01:07:03 DEBUG juju.api apiclient.go:1149 successfully dialed "wss://10.145.252.40:17070/api"
01:07:03 INFO juju.api apiclient.go:680 connection established to "wss://10.145.252.40:17070/api"
01:07:04 DEBUG juju.api monitor.go:35 RPC connection died
ERROR cannot delete application offer "filebeat-maas-infra": state changing too quickly; try again soon
01:07:04 DEBUG cmd supercommand.go:537 error stack:
/build/snapcraft-juju-35d6cf/parts/juju/src/apiserver/params/params.go:103: cannot delete application offer "filebeat-maas-infra": state changing too quickly; try again soon

----------------------------

Tailing the logsink.log on one of the controllers did not show any logs for this issue

Tags: cross-model
Steven Parker (sbparke)
description: updated
Revision history for this message
Steven Parker (sbparke) wrote (last edit ):
Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.9.22
status: New → Triaged
importance: Undecided → High
tags: added: cross-model
Revision history for this message
Ian Booth (wallyworld) wrote :

It would be good to understand how we got to this state. Regardless, there should not be errors like "state changing too quickly; try again soon" - that indicates slightly broken logic. So there's 2 parts here - how did the model end up in an inconsistent state; and juju should be able to deal with broken data better.
For now, we may need a little db surgery to fix it.

Revision history for this message
Ian Booth (wallyworld) wrote :

The error message 'cannot delete application offer "blah"' is printed when remove-offer is used without '--force'.

The use of '--force' might unblock the removal as it tries to avoid errors related bad data etc. What happens if you try this?

Revision history for this message
Ian Booth (wallyworld) wrote :

Looking at the db dump, it seems that:

relation count on the filebeat-maas-infra app is 0
yet there's a relation in the model between filebeat-maas-infra and infra-node
(this has id 4)

And I think this consistency check is what might be stopping the offer deletion.

You could try to fix it

db.applications.update(
{"_id": "d06afd52-89a7-41bb-8441-81a80782bf48:filebeat-maas-infra"},
{$set: {"relationcount": 1}}
)

Revision history for this message
Steven Parker (sbparke) wrote :

Thanks Ian,

We ended up redeploying. But I will put this in our notes if it happens again.

Changed in juju:
milestone: 2.9.22 → 2.9.23
Changed in juju:
milestone: 2.9.23 → 2.9.24
Changed in juju:
milestone: 2.9.24 → 2.9.25
Changed in juju:
milestone: 2.9.25 → 2.9.26
Changed in juju:
milestone: 2.9.26 → 2.9.27
Changed in juju:
milestone: 2.9.27 → 2.9.28
Changed in juju:
milestone: 2.9.28 → 2.9.29
Changed in juju:
milestone: 2.9.29 → 2.9.30
Ian Booth (wallyworld)
Changed in juju:
status: Triaged → Incomplete
milestone: 2.9.30 → 2.9-next
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.9-next → none
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Canonical 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.