offer info is missing from juju offers and juju offers <app_name> if no relation exists.

Bug #1723311 reported by Burton Swan
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Ian Booth

Bug Description

Juju version: 2.3-beta2-xenial-amd64

After an existing relation is removed by juju remove-relation <relation_id>, the information of the offer is missing from juju offers and juju offers <app_name>. However the offer exists and its details can be obtained by run juju offers --format yaml or juju offers <app_name> --format yaml

Procedures:

juju bootstrap aws ctrl-1
Wait until bootstrap process is completed.
juju deploy mysql
Wait until mysql app is up and ready - checking via juju status.
juju offer mysql:db

juju bootstrap aws ctrl-2
Wait until bootstrap process is completed.
juju deploy mediawiki
Wait until mysql app is up. Note: because at this stage the app hasn't been related to mysql, its status will show as blocked - checking via juju status.
juju relate mediawiki:db ctrl-1:admin/default.mysql
Wait until mediawiki app is ready, "blocked" status should change to "active" - checking via juju status.

juju switch ctrl-1
juju offers (get relation id)
juju remove-relation <relation_id>
juju offers or juju offers mysql

The output is empty:
Offer User Relation id Status Endpoint Interface Role Ingress subnets

However the offer still exists and its info can be obtained by run:
juju offers --format summary
Offer Application Charm Connected Store URL Endpoint Interface Role
mysql mysql cs:mysql-58 0/0 ctrl-1 admin/default.mysql db mysql provider

juju offers --format yaml
mysql:
  application: mysql
  store: ctrl-1
  charm: cs:mysql-58
  offer-url: admin/default.mysql
  endpoints:
    db:
      interface: mysql
      role: provider
  users:
    admin:
      display-name: admin
      access: admin
    everyone@external:
      access: read

The confusion here is while the offer exists, juju offers doesn't give any info about it if no relation exists, unless using --format flag. In other word, juju offers gives same output in following 2 situations:
1. No offer exists.
2. Offer exists but no relation exists.

This issue can also be reproduced just after the offer is created:

juju bootstrap aws ctrl-1
Wait until bootstrap process is completed.
juju deploy mysql
Wait until mysql app is up and ready - checking via juju status.
juju offer mysql:db
juju offers or juju offers mysql

The output is empty:
Offer User Relation id Status Endpoint Interface Role Ingress subnets

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

The output will be changed to include offers with no connections in tabular format. Plies there will be an option to only show active.

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

https://github.com/juju/juju/pull/7937

All offers are now shown.
Added new --active-only option to only show offers with connections.

Changed in juju:
assignee: nobody → Ian Booth (wallyworld)
importance: Undecided → High
milestone: none → 2.3-beta2
status: New → 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.