juju remove-application --force fails when offers are available
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Tim McNamara | ||
2.6 |
Fix Released
|
High
|
Tim McNamara |
Bug Description
When attempting to remove an application that has a consumer, Juju 2.6.2 generates the following message:
juju remove-application --force -m <saas-model> <app>
removing application <app> failed: cannot destroy application "<app>": state changing too quickly; try again soon
Without the --force option, we present a nicer message:
juju remove-application -m wiki-prod mariadb
removing application mariadb failed: cannot destroy application "mariadb": application is used by 1 offer
Steps to reproduce:
Step 1: set up models
juju add-model wiki-prod localhost
juju deploy mediawiki
juju deploy --to 0 mariadb
juju relate mediawiki:db mariadb:db
juju offer mariadb:db
juju expose mediawiki
juju add-model wiki-staging localhost
juju deploy mediawiki
juju consume wiki-prod.mariadb
juju consume wiki-prod.haproxy
juju relate mediawiki:db mariadb:db
juju expose mediawiki
Step 2: Attempt to remove model
juju remove-application --force -m wiki-prod mariadb
Changed in juju: | |
importance: | High → Medium |
Changed in juju: | |
status: | Fix Committed → Fix Released |
Changed in juju: | |
status: | Fix Committed → Fix Released |
The issue is a business logic error in making the asserts when --force is used.
But --force is not for this use case anyway. Applications with offers need to have the offers removed before the app can be deleted.