Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,334
Community Members
 
Community Events
184
Community Groups

Can't figure out an auth issue for runner autoscaler

Edited

I was following this guide:
https://bitbucket.org/bitbucketpipelines/runners-autoscaler/src/master/

 

I have things in a state where, when the runner controller pod spins up, it gives me 401 errors:
DEBUG: Starting new HTTPS connection (1): api.bitbucket.org:443
DEBUG: https://api.bitbucket.org:443 "GET /2.0/workspaces/myworkspace HTTP/1.1" 401 380
DEBUG: GET request to https://api.bitbucket.org/2.0/workspaces/myworkspace
DEBUG: Got 401 Client Error: Unauthorized for url: https://api.bitbucket.org/2.0/workspaces/myworkspace. Status: 401
✖ Unauthorized. Check your bitbucket credentials. Status code: 401. Login failed due to incorrect login credentials or method.
For information on authentication methods for Bitbucket Cloud APIs, visit:
https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication
If you are unsure of which login details or login method to use, visit:
https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cloud/

If I exec into the pod, the username and password variables are correct, and I have tried to use them manually via curl to connect to the https://api.bitbucket.org/2.0/workspaces/myworkspace and that does work successfully.

However if I purposely use the wrong password via curl, it spits out the same error. 

I'm a little stumped as this case isn't covered by the documentation. Any help would be appreciated.

1 answer

1 accepted

1 vote
Answer accepted

Well... weirdly enough I got it working and I'm not exactly sure why it wasn't to begin with. 
If you're here with the same problem, regenerate the b64 encoding for the app password. That's really the only thing I changed even though I verified it was right.

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 28, 2023

@Mike Stanley  hi. Happy to know you solved this issue for yourself.
There are possible 3 reasons where this could happen:

  1. Check correct permissions for the app password
  2. Ensure you correctly encode with base64 the app password (linux and mac have different shell commands), copy/paste to k8s manifest without trailed characters
  3. Apply secrets manifest to k8s
    kubectl apply -f config/runners-autoscaler-secret.yaml

Regards, Igor

I think the encoding was the issue.

I usually use:
"echo 'password' | base64 -w0"

Typically, this works fine for my purposes. But in this case it wouldn't. It really did need to be:
"echo -n 'password' | base64"

Like Igor Stoyanov likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events