cannot sequentially create multiple cross model relations from the same app

Bug #2048870 reported by Pietro Pasotti
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
High
Nicolas Vinuesa

Bug Description

when you have multiple cross-model relations you need to first create all offers (and consume them), and only then create the relations with `juju relate`.

Creating an offer, relating it, and then creating another offer gives an error such as:
ERROR cannot update application offer "gagent": application endpoint "logging-consumer" has active consumers

Remark from Joe Phillips:
> The bug comes from [here](https://github.com/juju/juju/blob/fc069f19f894c4f7c777ed9a290cd64a706c24dd/state/applicationoffers.go#L679). I don't think the determination by set difference is correct.

Steps to reproduce:

deploy cos-lite in a kubernetes model

deploy in a different (machine?) controller any charm supporting a cos-agent subordinate such as https://github.com/canonical/intro-to-charming-mc/tree/part-3-observability

deploy grafana-agent and attach it to the charm
follow the steps in https://discourse.charmhub.io/t/using-the-grafana-agent-machine-charm/8896#step-4-relate-grafana-agent-to-cos-lite-prometheus-loki-and-grafana to create one of the CMRs and then another

--> bug.

Reproducible in a setup with:

juju snap version 3.1.7
juju machine model agent version 3.2.3
juju kubernetes model agent version 3.1.6

Ian Booth (wallyworld)
Changed in juju:
milestone: none → 3.3.2
importance: Undecided → High
status: New → Triaged
Changed in juju:
milestone: 3.3.2 → 3.3.4
Changed in juju:
assignee: nobody → Nicolas Vinuesa (nvinuesa)
Ian Booth (wallyworld)
Changed in juju:
milestone: 3.3.4 → 3.3.5
Harry Pidcock (hpidcock)
Changed in juju:
milestone: 3.3.5 → 3.3.6
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.