juju / charmstore-client

Client for charmstore.
Other
9 stars 22 forks source link

Terms error from charm pull gives misleading information #118

Open johnsca opened 7 years ago

johnsca commented 7 years ago

When trying to pull a charm that requires agreement to a set of terms, the error message indicates that you have to agree to a set of terms with the user namespace included. But when I try to agree to that, as given, it fails. Removing the namespace allows it to succeed.

[johnsca@murdoch:~/juju/envs/rq/xenial] $ charm pull cs:~ibmcharmers/ibm-was-nd
ERROR cannot get archive: cannot get discharge from "https://api.jujucharms.com/terms": third party refused discharge: term agreement required: ibmcharmers/ibm-was-nd/1

[johnsca@murdoch:~/juju/envs/rq/xenial] $ juju agree ibmcharmers/ibm-was-nd/1
Do you agree to the displayed terms? (Y/n): y
Opening an authorization web page in your browser.
If it does not open, please open this URL:
https://api.jujucharms.com/identity/v1/login?waitid=9e4dc33f163b42f39d5e8c32fd9db17f
Created new window in existing browser session.
ERROR failed to save user agreement: cannot get discharge from "https://api.jujucharms.com/identity/v1/discharger": failed to acquire macaroon after waiting: third party refused discharge: user is not a member of required groups

[johnsca@murdoch:~/juju/envs/rq/xenial] $ juju agree ibm-was-nd/1
Agreed to revision 1 of ibm-was-nd for Juju users
johnsca commented 7 years ago

It seems that the charm revision in the store specifies the namespace in the terms ID in its metadata.yaml (the charm layer source doesn't, which confused me; the store needs to be updated), so that's probably where that's coming from. However, I'm still confused by the difference between the set of terms with and without the namespace and why one fails and why they're considered distinct?

jrwren commented 7 years ago

There seems to be docs lacking on terms.

The parameter to juju agree is the name of a terms, not the name of a charm. In this case the name of the terms is very close to or the same as the name of the charm to which those terms are attached.

There are some more details here: https://jujucharms.com/docs/2.1/developer-terms

There needs to be some user-centric documentation written which explains this.