Incorrect help text for relation-get

Bug #1876789 reported by Kenneth Koski
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

relation-get has this help text:

...
When reading remote relation data, a charm can call relation-get --app - to get
the data for the application data bag that is set by the remote applications
leader.
...

If I'm reading that correctly, I can run `relation-get --app -` to get the application data bag, but I get this error when attempting to run it inside of a hook:

    ERROR no unit or application specified

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

relation-get --app is the correct syntax
I assume it is being run inside a relation hook? Otherwise the -r arg is needed to explicitly specify the relation.

You get that error if the remote application that is at the other end of the relation is not yet available or not found.

You also get the same error without --app (querying unit relation data) if the other side is not available.

Revision history for this message
Pen Gale (pengale) wrote :

@wallyworld: are the caveats you mentioned documented anywhere? If so, I think that we can close this out as working as expected. If not, we probably need to either flesh out the documentation in the command's help, or document the gotchas elsewhere ...

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

It's not a gotcha that you get an error asking for something that's not there yet.
It's more that the error message is unhelpful and doesn't provide enough info to explain what the issue is.

Changed in juju:
milestone: none → 2.8.1
importance: Undecided → Medium
status: New → Triaged
Changed in juju:
assignee: nobody → Heather Lanigan (hmlanigan)
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.8.1 → 2.8.2
Changed in juju:
assignee: Heather Lanigan (hmlanigan) → nobody
Changed in juju:
milestone: 2.8.2 → 2.8.3
Pen Gale (pengale)
Changed in juju:
milestone: 2.8.4 → 2.9-beta1
Changed in juju:
milestone: 2.9-beta1 → 2.9-rc1
Pen Gale (pengale)
tags: added: bitesize charm-debugging docs
Changed in juju:
milestone: 2.9-rc1 → none
Revision history for this message
Jordan Barrett (barrettj12) wrote :

In a debug-hooks session, I can't seem to get this working at all:
--------------------------------------------------
$ relation-get -
ERROR no relation id specified
$ relation-get - ds3/0
ERROR no relation id specified
$ relation-get - MYUNIT
ERROR no relation id specified
$ relation-get --app -
ERROR no relation id specified
$ relation-get --app
ERROR no relation id specified
--------------------------------------------------
Everything suggested in the help text/this bug report just gives me an error

Revision history for this message
Jordan Barrett (barrettj12) wrote :

Maybe we could have examples in the help text? I cannot for the life of me work out how to get useful output out of this command.
------------------------------------------------------
$ relation-get source:1
ERROR no relation id specified
$ relation-get -r 1
ERROR no unit or application specified
$ relation-get -r source:1
ERROR no unit or application specified
$ relation-get -r 1 source
ERROR no unit or application specified
------------------------------------------------------

Revision history for this message
Jordan Barrett (barrettj12) wrote :

Finally got some useful output from:
```
relation-get token -r $(relation-ids source) dummy-source/0
```
i.e.
```
relation-get -r <relation-id> <key> <unit>
```

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This Medium-priority bug has not been updated in 60 days, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Medium → Low
tags: added: expirebugs-bot
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.