juju / charmstore-client

Client for charmstore.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Launchpad team membership not picked up by `charm whoami`

sachin-trilio opened this issue · comments

My launchpad team membership "trilio-charmers" is not authenticated when I login using "charm login". I am not able to push a new charm due to this error. I tried login/logout multiple times and clearing ~/.go-cookies, but still same issue.

Details:
Charm version - 2.7.5
Ubuntu version - Bionic
Launchpad team - https://launchpad.net/~trilio-charmers
Username - sachin-trilio

Cmd output:

charm version

charmstore-client 2.4.0+snap-481+git-13-547c6f2
charm-tools 2.7.5

charm login -B

Login to Ubuntu SSO
Press return to select a default value.
E-Mail: sachin.kulkarni@trilio.io
Password:
Two-factor auth (Enter for none):

charm whoami

User: sachin-trilio

charm push . cs:~trilio-charmers/trilio-data-mover --debug

07:58:29 DEBUG juju.charm charmdir.go:389 charm is not in revision control directory
07:58:29 DEBUG httpbakery logger.go:28 client do GET https://api.jujucharms.com/charmstore/v5/delegatable-macaroon {
07:58:29 INFO httpbakery logger.go:33 HTTP response OK (status 200 OK)
07:58:29 DEBUG httpbakery logger.go:28 } -> error
07:58:29 DEBUG httpbakery logger.go:28 client do POST https://api.jujucharms.com/charmstore/v5/~trilio-charmers/trilio-data-mover/archive?hash=700f1aa94fef6975701f4f3014f082f7ef6956b7c307c73f978e763604eaead042df662659d22d7bb1ad54664f57dea9 {
07:58:31 INFO httpbakery logger.go:33 HTTP response OK (status 401 Unauthorized)
07:58:31 DEBUG httpbakery logger.go:28 } -> error
ERROR cannot post archive: access denied for user "sachin-trilio"
07:58:31 DEBUG cmd supercommand.go:475 error stack:
access denied for user "sachin-trilio"
gopkg.in/juju/charmrepo.v4/csclient/csclient.go:864: cannot post archive
github.com/juju/charmstore-client/cmd/charm/charmcmd/push.go:174:

Expected output:

charm whoami

User: sachin-trilio
Group membership: trilio-charmers

It appears that https://launchpad.net/~trilio-charmers is a private team, charmstore has no special access to launchpad and can only see team memberships that are public.

Yes, in fact I am the owner of this team. I am able to access the team on launchpad using my ubuntu SSO. But getting an error while pushing a new charm. What can I check or do to fix the issue? Do I need to check any specific permissions for the launchpad team?

You can make your team public by going to https://launchpad.net/~trilio-charmers clicking on "Change Details" and then setting the "Visibility" drop-down to "Public". Then you should be able to push charms as that team.

Note it can take a bit of time (10 - 20 minutes) for charmstore to flush it's caches to re-collect the list of team memberships.

Thanks @mhilton .

Is it not possible to push charms as a "private" team? I was able to push the charms using same credentials and same team settings until few months back. Is it necessary to make it "public"?

Is it not possible to push charms as a "private" team? I was able to push the charms using same credentials and same team settings until few months back. Is it necessary to make it "public"?

I don't know enough about how launchpad works to know if there is a difference, but the thing that needs to be public is the user's membership of the team. Specifically it needs to show up in a user's super_teams (https://api.launchpad.net/devel/~/super_teams). I don't know if a user can publicly be a member of a private team.

The issue has been fixed. No changes needed for the launchpad team or user account.

charm whoami

User: sachin-trilio
Group membership: trilio-charmers