disabling and re-enabling observability plugin results in terraform error

Bug #2063183 reported by Samuel Allan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Snap
In Progress
High
Unassigned

Bug Description

On 2023.2/edge, I disabled the observability plugin, then enabled it again:

```
sunbeam disable observability
sunbeam enable observability
```

This resulted in an error from terraform:

```
Error: Client Error

  with juju_integration.grafana-agent-to-receive-remote-write[0],
  on main.tf line 1037, in resource "juju_integration" "grafana-agent-to-receive-remote-write":
1037: resource "juju_integration" "grafana-agent-to-receive-remote-write" {

Unable to consume remote offer, got error: saas application called
"prometheus-receive-remote-write" from a different model already exists

Error: Client Error

  with juju_integration.grafana-agent-to-logging[0],
  on main.tf line 1051, in resource "juju_integration" "grafana-agent-to-logging":
1051: resource "juju_integration" "grafana-agent-to-logging" {

Unable to consume remote offer, got error: saas application called
"loki-logging" from a different model already exists

Error: Client Error

  with juju_integration.grafana-agent-to-cos-grafana[0],
  on main.tf line 1065, in resource "juju_integration" "grafana-agent-to-cos-grafana":
1065: resource "juju_integration" "grafana-agent-to-cos-grafana" {

Unable to consume remote offer, got error: saas application called
"grafana-dashboards" from a different model already exists

Error: Command '['/snap/openstack/479/bin/terraform', 'apply', '-auto-approve', '-no-color']' returned non-zero exit status 1.
```

It seems the consumer side of the cross model relations from observability model aren't cleaned up on disabling the plugin.

Revision history for this message
Samuel Allan (samuelallan) wrote :

A workaround is to manually clean up the offers before re-enabling observability:

```
juju remove-saas -m openstack prometheus-receive-remote-write
juju remove-saas -m openstack grafana-dashboards
juju remove-saas -m openstack loki-logging
juju remove-saas -m admin/controller prometheus-receive-remote-write
juju remove-saas -m admin/controller grafana-dashboards
juju remove-saas -m admin/controller loki-logging
```

Changed in snap-openstack:
importance: Undecided → High
status: New → Confirmed
tags: added: observability
Changed in snap-openstack:
assignee: nobody → Guillaume Boutry (gboutry)
assignee: Guillaume Boutry (gboutry) → nobody
status: Confirmed → In Progress
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.