Need Help Setting up Extender Locally

Hello,

I am following instructions from Setup local build server and I’ve ran into a problem.

I followed Step 1 (from the mentioned instructions):

$ gcloud auth application-default login

Your browser has been opened to visit:

https://accounts.google.com/o/oauth2/auth?response_type=code<removed the rest>

Credentials saved to file: [C:\Users\citizen\AppData\Roaming\gcloud\application_default_credentials.json]

These credentials will be used by any library that requests Application Default Credentials (ADC).
WARNING:
Cannot find a quota project to add to ADC. You might receive a “quota exceeded” or “API not enabled” error. Run $ gcloud auth application-default set-quota-project to add a quota project.

Step 2:

$ gcloud auth configure-docker europe-west1-docker.pkg.dev

Adding credentials for: europe-west1-docker.pkg.dev
After update, the following will be written to your Docker config file located at [C:\Users\citizen.docker\config.json]:

 {
  "credHelpers": {
    "europe-west1-docker.pkg.dev": "gcloud"
  }
}

Do you want to continue (Y/n)? Y

Docker configuration file updated.

Step 3:

$ docker pull --platform linux/amd64 europe-west1-docker.pkg.dev/extender-426409/extender-public-registry/extender-base-env:latest

Python not foundError response from daemon: failed to resolve reference “europe-west1-docker.pkg.dev/extender-426409/extender-public-registry/extender-base-env:latest”: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://europe-west1-docker.pkg.dev/v2/token?scope=repository%3Aextender-426409%2Fextender-public-registry%2Fextender-base-env%3Apull&service=europe-west1-docker.pkg.dev: 403 Forbidden

I believe Step 1 and 2 passed fine, but Step 3 is failing as above.

I am trying this on Windows.

Any help would be appreciated.

Hello. As I saw during Step 3 you have “Python not found” error. I guess that problem with it. As I know gcloud utility uses Python under the hood.
Please, verify gcloud installation according to the official documentation https://cloud.google.com/sdk/docs/install-sdk#windows (pay attention to Step 3).
Also as other option to try is to define which Ptyhon interpreter should use by gcloud. Take a look here https://stackoverflow.com/a/75047958.

1 Like

Thanks Eugene. There is some progress.

I followed the instructions from the stackoverflow.com post you referenced and set up the CLOUDSDK_PYTHON environment variable.

$ printenv | grep CLOUD
CLOUDSDK_PYTHON=C:\Users\citizen\AppData\Local\Programs\Python\Python310\python.exe

The “Python not found” message is now gone, but the docker pull command is still failing:

$  docker pull --platform linux/amd64 europe-west1-docker.pkg.dev/extender-426409/extender-public-registry/extender-base-env:latest
Error response from daemon: failed to resolve reference "europe-west1-docker.pkg.dev/extender-426409/extender-public-registry/extender-base-env:latest": failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://europe-west1-docker.pkg.dev/v2/token?scope=repository%3Aextender-426409%2Fextender-public-registry%2Fextender-base-env%3Apull&service=europe-west1-docker.pkg.dev: 403 Forbidden

I am new to both Docker and gcloud so I would appreciate further assistance.

Let’s check following:

  1. Execute gcloud auth list to see if any active account is presented.
  2. Execute gcloud auth print-access-token. Should be long output with access token.

If any of that step returns error - run gcloud auth login.

1 Like

Here’s what I got:

$ gcloud auth list

No credentialed accounts.

$ gcloud auth print-access-token
ERROR: (gcloud.auth.print-access-token) You do not currently have an active account selected.
Please run:

  $ gcloud auth login

to obtain new credentials.

If you have already logged in with a different account, run:

  $ gcloud config set account ACCOUNT

to select an already authenticated account to use.

To login, run:
  $ gcloud auth login `ACCOUNT`

So I ran:

gcloud auth login

After going through the “gcloud auth login” procedure the docker pull command worked.

Issue solved. Thank you very much.

3 Likes

Thank you too. Seems I need update instructions because docker login relies on gcloud auth login result, not on gcloud auth application-default login.

4 Likes