Concourse 5.1 Teams don't seem to work with bitbucket

#1
$ fly --version
5.1.0
$ fly -t dev userinfo
username  team/role 
mclemay   main/owner
$ fly -t dev teams -d
name/role   users                    groups
main/owner  bitbucket-cloud:mclemay  none  
rnd/member  bitbucket-cloud:mclemay  none  
rnd/owner   bitbucket-cloud:mclemay  none  
rnd/viewer  bitbucket-cloud:mclemay  none  
$ fly -t dev login -n rnd
logging in to team 'rnd'

navigate to the following URL in your browser:

  http://concourse.etc.hosts/login?fly_port=61983

or enter token manually: 
error: user [mclemay] is not in team [rnd]

For good measure:

roles:
- name: owner
  bitbucket-cloud:
    users: ["mclemay"]
- name: member
  bitbucket-cloud:
    users: ["mclemay"]
- name: viewer
  bitbucket-cloud:
    users: ["mclemay"]

That’s the file I use to configure the team. Obviously, this isn’t what I want, I’ve just wasted the latest couple concourse-related hours trying to sort this and have tried every permutation of bitbucket team/user of which I can think. I’ve tried the command line method for configuring the team. I’ve logged in to postgres to ensure my team “looks” right in the postgres table… I’ve tried setting the “teams” field under the owner role in the team configuration file, too, to no avail. I know the team is correct as I’d previously been using both team and user for configuring the main team in command line arguments in my web pod.

I can’t tell from the documentation if teams and users are meant to be two separate things, as in “user is in this team or has this user name” or “user is in this team and has this user name.”

Thanks.

#2

Interesting, I did a similar test and ran into the same error. However, I was able to work around it by first logging out of Concourse from the UI (I was initially logged into the main team), and then running the same commands again. Strangely, I can’t seem to reproduce the error any more after logging out and back into the main team.

roles.yml:

roles:
- name: member
  bitbucket-cloud:
    users: ["techorrect_etan"]
$ fly -t dev userinfo
could not find a valid token.
logging in to team 'main'

navigate to the following URL in your browser:

  http://localhost:8080/login?fly_port=33537

target saved
username         team/role 
techorrect_etan  main/owner

$ fly -t dev teams -d
name/role   users       groups                    
main/owner  local:test  bitbucket-cloud:techorrect

$ fly -t dev set-team -n bb  -c roles.yml
setting team: bb

role member:
  users:
  - bitbucket-cloud:techorrect_etan

  groups:
    none

apply team configuration? [yN]: y
team created

$ fly -t dev teams -d
name/role   users                            groups                    
bb/member   bitbucket-cloud:techorrect_etan  none                      
main/owner  local:test                       bitbucket-cloud:techorrect

$ fly -t dev login -n bb
logging in to team 'bb'

navigate to the following URL in your browser:

  http://localhost:8080/login?fly_port=42211

or enter token manually: 
error: user [techorrect_etan] is not in team [bb]

# At this point, I logged out of Concourse from the web UI.

$ fly -t dev login -n bb
logging in to team 'bb'

navigate to the following URL in your browser:

  http://localhost:8080/login?fly_port=38399

or enter token manually: 
target saved

$ fly -t dev userinfo
username         team/role           
techorrect_etan  bb/member,main/owner
#3

After some more experimenting, it seems like this is related to issue 2441, since the team info is baked into the token. I was able to reproduce the behavior above by deleting the team, logging out of the Concourse UI, and then doing a fly -t dev logout. At this point, running the commands in my previous post resulted in the same behavior.