As the topic says, I'm getting the following OAuth error when deploying the runner-controller:
```
self._client.parse_request_body_response(r.text, scope=self.scope) File "/usr/local/lib/python3.10/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 427, in parse_request_body_response self.token = parse_token_response(body, scope=scope) File "/usr/local/lib/python3.10/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in parse_token_response validate_token_parameters(params) File "/usr/local/lib/python3.10/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 448, in validate_token_parameters raise_from_error(params.get('error'), params) File "/usr/local/lib/python3.10/site-packages/oauthlib/oauth2/rfc6749/errors.py", line 399, in raise_from_error raise cls(**kwargs) oauthlib.oauth2.rfc6749.errors.UnauthorizedClientError: (unauthorized_client) Invalid OAuth client credentials
```
What I've done so far:
1. Created OAuth Consumer for my workspace.
2. Gave the Consumer account:read, runner:write, repository:read permissions.
3. Gave the Consumer a dummy callback URL e.g. `http://localhost:8080`
4. Made the Consumer private
5. Copied the Client ID and Secret from the newly created consumer
6. Ran `echo <CLIENT_ID> | base64` and `echo <SECRET> | base64`
7. Copied the resulting encrypted strings and put them in the kustomization.yaml file, replacing the "" under bitbucketOauthClientId and bitbucketOauthClientSecret so that the file now reads e.g. `value: <MY_BASE64_STRING>`
8. Uncommented Option 1 for both the secret and deployment
9. Ran `kubectl apply -k values`
10. No errors during deployment, but the runner-controller pod is stuck in crash loop with the error from above.
I ended up dropping the values directly into the base/secret.yaml file instead of in kustomize and then remove the patches from kustomize.yaml. So now my setup looks like:
-
secret.yaml
---
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your advice @Alec Applegate , but I still get same error.
I want to confirm, to generate bitbucketOauthClientId and bitbucketOauthClientSecret from this page /workspace/settings/pipelines/account-runners right? And for workspace on runner_config.yaml using UUID workspace or the name of workspace?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Alec Applegate ,
and welcome to the Community!
The reported error is usually related with the OAuth Consumer ID/Secret not being configured correctly or lacking the required level of permissions.
I would suggest, for testing porpoises, creating a new OAuth consumer with full permissions set, and ensure to look for any leading/trailing space when converting those to base64.
Then, you can configure your kustomization.yaml file again with these new values and try a new deployment.
Would you be able to run that test and let us know how it goes?
Thank you, @Alec Applegate !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Patrik S
can you give me step by step to creating a new OAuth with full permissions?
Because I got same issue.
Thank You
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Adilla Rhiskani S ,
Welcome to the Community!
You can find instructions on how to create an OAuth consumer in your workspace in the following article:
If you run into any issues following those steps, please let us know.
Thank you, @Adilla Rhiskani S !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Patrik S
Thank you for article, I have been success install bitbucket auto scale workspace. But after I test using the pipeline I got some issue the pod got multiple times evicted and got message Pod ephemeral local storage usage exceeds the total limit of containers 5Gi.
I have following this article but issue still persist.
I share my pipeline config.
pipelines:
default:
- step:
name: build-frontend
image: node:16-alpine
runs-on:
- 'dev-runner'
caches:
- node
artifacts:
- build/**
- Dockerfile
- nginx.conf
script:
- yarn install
- yarn build
- step:
name: build-image
services:
- docker
runs-on:
- 'dev-runner'
deployment: development
dependencies:
- build-frontend
script:
- docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PAT"
- docker build -t "$docker_hub/$REPO:$BITBUCKET_COMMIT" .
Did pipeline need to declare image docker-dind again? For run docker build command, etc
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.