issue with v0 and master version : google-github-actions/[email protected]

This issue has been tracked since 2022-02-09.

TL;DR

We have an issue with user workflows where they are trying to setup gcloud. That setup is getting timeout with below error.
Error: google-github-actions/setup-gcloud failed with: connect ETIMEDOUT 142.251.36.46:443

Actually we allow the actions on github enterprise level policies. Actions (github.com)
Here earlier we had below two entries for gcloud.
daadedc,
google-github-actions/[email protected],

But then later we started getting waring in the workflow that master is going to be unsupported so start using v0. That’s why we have added this one there and all users started using this v0 version of gcloud setup.
google-github-actions/[email protected],

However as I mentioned above all github actions are getting failed with the v0 version since last week.

Expected behavior

google-github-actions/[email protected],
was working earlier so want that to be working.

Observed behavior

google-github-actions/[email protected],
giving timeout error

Action YAML

- name: setup gcloud
        uses: google-github-actions/[email protected]
        with:
          project_id: ${{ env.PROJECT_ID }}
          service_account_key: ${{ secrets.GOOGLE_CREDENTIALS }}

Log output

Run google-github-actions/[email protected]
  with:
    project_id: XXX
    service_account_key: ***
    version: latest
    export_default_credentials: false
    cleanup_credentials: true

Additional information

This is impacting all our user since last 1 week. Also want to know why this is failing with timeout on that IP for v0 version.

sethvargo wrote this answer on 2022-02-09

Hi @kundan-krushna-shende-db

Are you using self-hosted runners? Without your complete action.yaml, it will be difficult to try and debug and reproduce this issue.

If I were to guess, the step is failing trying to communicate with Google to download the SDK. 142.251.36.46 is a Google-owned IP (we own 142.250.0.0/15).

kundan-krushna-shende-db wrote this answer on 2022-02-14

Hello,

There us one strange thing. When i mention any specific version of gcloud CLI in my workflow then it connects to the http://.dl.googl.com without any issue and downloading and installing verything. However when i dont mention any version or mention "latest" then it fails with this connection timeout error.

If I specify any gcloud CLI version then it works. From : https://cloud.google.com/sdk/docs/release-notes
In below run I have given 369.0.0 version.

_##[debug]Evaluating condition for step: 'Setup Cloud SDK - PROD'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Setup Cloud SDK - PROD
##[debug]Register post job cleanup for action: google-github-actions/[email protected]
##[debug]Loading inputs
##[debug]Evaluating: secrets.GOOGLE_PROJECT_CTL_DBC
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GOOGLE_PROJECT_CTL_DBC'
##[debug]=> ''
##[debug]Result: '
'
##[debug]Evaluating: secrets.GOOGLE_CREDENTIALS_CTL_DBC
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GOOGLE_CREDENTIALS_CTL_DBC'
##[debug]=> ''
##[debug]Result: '
'
##[debug]Loading env
Run google-github-actions/[email protected]
with:
version: 369.0.0
project_id: ***
service_account_key: ***
export_default_credentials: true
cleanup_credentials: true
env:
GITHUB_SHA: 862d9aaba3abd3658e973718dd2eb198f717b2da
##[debug]isExplicit: 369.0.0
##[debug]explicit? true
##[debug]checking cache: /home/runners_work/gcp_runners/manual/_tool/gcloud/369.0.0/x64
##[debug]not found
##[debug]Downloading https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-369.0.0-linux-x86_64.tar.gz
##[debug]Destination /home/runners_work/gcp_runners/manual/_temp/70956db9-875f-415b-82b0-0c56ea73660d
##[debug]download complete
##[debug]Checking tar --version
##[debug]tar (GNU tar) 1.30
##[debug]Copyright (C) 2017 Free Software Foundation, Inc.
##[debug]License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html.
##[debug]This is free software: you are free to change and redistribute it.
##[debug]There is NO WARRANTY, to the extent permitted by law.
##[debug]
##[debug]Written by John Gilmore and Jay Fenlason.
/usr/bin/tar xz -v --warning=no-unknown-keyword --overwrite -C /home/runners_work/gcp_runners/manual/_temp/8d195396-7d3e-4696-817b-7c473b210dc1 -f /home/runners_work/gcp_runners/manual/temp/70956db9-875f-415b-82b0-0c56ea73660d
google-cloud-sdk/.install/.download/
google-cloud-sdk/.install/anthoscli-linux-x86_64.manifest
google-cloud-sdk/.install/anthoscli-linux-x86_64.snapshot.json
google-cloud-sdk/.install/anthoscli.manifest

.
.

When I don’t mention any version or give “latest” then it fails with that connection timeout error.
As per below logs.

##[debug]Evaluating condition for step: 'Setup Cloud SDK - PROD'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Setup Cloud SDK - PROD
##[debug]Register post job cleanup for action: google-github-actions/[email protected]
##[debug]Loading inputs
##[debug]Evaluating: secrets.GOOGLE_PROJECT_CTL_DBC
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GOOGLE_PROJECT_CTL_DBC'
##[debug]=> ''
##[debug]Result: '
'
##[debug]Evaluating: secrets.GOOGLE_CREDENTIALS_CTL_DBC
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GOOGLE_CREDENTIALS_CTL_DBC'
##[debug]=> ''
##[debug]Result: '
'
##[debug]Loading env
Run google-github-actions/[email protected]
with:
version: latest
project_id: ***
service_account_key: ***
export_default_credentials: true
cleanup_credentials: true
env:
GITHUB_SHA: a4f0512241183be7ad6a21cbea9b639f0960d1e7
Error: google-github-actions/setup-gcloud failed with: connect ETIMEDOUT 142.251.36.46:443
##[debug]Node Action run completed with exit code 1
##[debug]CLOUDSDK_METRICS_ENVIRONMENT='github-actions-setup-gcloud'
##[debug]Finishing: Setup Cloud SDK - PROD

Please find below my complete workflow.

name: Testing gcloud

on:
push:
branches: [ main ]
workflow_dispatch:

Environment variables available to all jobs and steps in this workflow

env:
GITHUB_SHA: ${{ github.sha }}

jobs:
setup-build-publish-deploy:
name: "Testing gcloud"
runs-on: DBGDBC

steps:
  # Checkout repository
  - name: Checkout
    uses: actions/[email protected]

  # Setup gcloud CLI
  - run: env
  - name: Setup Cloud SDK - PROD
    uses: 'google-github-actions/[email protected]'
    with:
      #version: 369.0.0
      project_id: ${{ secrets.GOOGLE_PROJECT_CTL_DBC }}
      service_account_key: ${{ secrets.GOOGLE_CREDENTIALS_CTL_DBC }}
      export_default_credentials: true

kundan-krushna-shende-db wrote this answer on 2022-02-14

@sethvargo

One more thing along with my above details.

As getting latest version o cloudsdk was working fine till last month, i have tried checking your index.js code and found that it has changed last month.

Changes are around that URL which is getting failed to connect. Earlier ULR was within the function and now its outside. I didnot look whole code changes but if you can identify the issue.

Old:
function getLatestGcloudSDKVersion() {
return n(this, void 0, void 0, (function*() {
const e = https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json;
const t = new o.HttpClient("github-actions-setup-gcloud-sdk");
return yield(0, i.retry)((() => n(this, void 0, void 0, (function*() {
const r = yield t.get(e);
if (r.message.statusCode != 200) {
throw new Error(Failed to retrieve gcloud SDK version, HTTP error code: ${r.message.statusCode} url: ${e})
}
const n = yield r.readBody();
const o = JSON.parse(n);
if (!o.version) {
throw new Error(Failed to retrieve gcloud SDK version, invalid response body: ${n})
}
return o.version
}))), {
delay: 200,
factor: 2,
maxAttempts: 4
})
}))
}
t.getLatestGcloudSDKVersion = getLatestGcloudSDKVersion

Existing code:

t.getLatestGcloudSDKVersion = void 0;
const s = i(r(687));
const o = r(310);
const a = r(494);
const c = r(593);
const l = https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json;

                    function getLatestGcloudSDKVersion() {
                        return n(this, void 0, void 0, (function*() {
                            const e = {
                                delay: 200,
                                factor: 2,
                                maxAttempts: 3
                            };
                            return yield(0, a.retry)((() => n(this, void 0, void 0, (function*() {
                                return yield getGcloudVersion(l)
                            }))), e)
                        }))
                    }
                    t.getLatestGcloudSDKVersion = getLatestGcloudSDKVersion;
sethvargo wrote this answer on 2022-02-14

Hi @kundan-krushna-shende-db

I think we figured out the root cause of the issue. We're pretty sure the HTTP client was not listening to HTTP_PROXY and NO_PROXY environment variables. This was fixed in google-github-actions/setup-cloud-sdk#94, and we'll need to do a dependency update into this library to see if that fixes your issue.

bharathkkb wrote this answer on 2022-02-14

@kundan-krushna-shende-db We merged a fix that should respect the proxy env vars. Could you temporarily check with the main branch if the issue is resolved google-github-actions/[email protected]?

kundan-krushna-shende-db wrote this answer on 2022-02-16

@sethvargo

Yes, it is worked fine without specific version with @master.

##[debug]Evaluating condition for step: 'Setup Cloud SDK - PROD'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Setup Cloud SDK - PROD
##[debug]Register post job cleanup for action: google-github-actions/[email protected]
##[debug]Loading inputs
##[debug]Evaluating: secrets.GOOGLE_PROJECT_CTL_DBC
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GOOGLE_PROJECT_CTL_DBC'
##[debug]=> ''
##[debug]Result: '
'
##[debug]Evaluating: secrets.GOOGLE_CREDENTIALS_CTL_DBC
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GOOGLE_CREDENTIALS_CTL_DBC'
##[debug]=> ''
##[debug]Result: '
'
##[debug]Loading env
Run google-github-actions/[email protected]
with:
project_id: ***
service_account_key: ***
export_default_credentials: true
version: latest
cleanup_credentials: true
env:
GITHUB_SHA: 1749add48e44e0bd3001cf3c9788b6a52a4b7bbf
Warning: google-github-actions/setup-gcloud is pinned at "master". We strongly advise against pinning to "@master" as it may be unstable. Please update your GitHub Action YAML from:

uses: 'google-github-actions/[email protected]'

to:

uses: 'google-github-actions/[email protected]'

Alternatively, you can pin to any git tag or git SHA in the repository.
##[debug]isExplicit: 373.0.0
##[debug]explicit? true
##[debug]checking cache: /home/runners_work/gcp_runners/manual/_tool/gcloud/373.0.0/x64
##[debug]Found tool in cache gcloud 373.0.0 x64
##[debug]isExplicit: 373.0.0
##[debug]explicit? true
##[debug]checking cache: /home/runners_work/gcp_runners/manual/_tool/gcloud/373.0.0/x64
##[debug]Found tool in cache gcloud 373.0.0 x64
##[debug]Running command: gcloud --quiet config set project ***
Successfully set default project
Warning: "service_account_key" has been deprecated. Please switch to using google-github-actions/auth which supports both Workload Identity Federation and Service Account Key JSON authentication. For more details, see https://github.com/google-github-actions/setup-gcloud#authorization
##[debug]Running command: gcloud --quiet auth activate-service-account [email protected].iam.gserviceaccount.com --key-file -
Successfully exported GCLOUD_PROJECT ***
Successfully exported Default Application Credentials
##[debug]Node Action run completed with exit code 0
##[debug]CLOUDSDK_METRICS_ENVIRONMENT='github-actions-setup-gcloud'
##[debug]GCLOUD_PROJECT='
'
##[debug]GOOGLE_APPLICATION_CREDENTIALS='/home/runners_work/gcp_runners/manual/demo-repository/demo-repository/f30911f1223819fb20b03ec8'
##[debug]GOOGLE_GHA_CREDS_PATH='/home/runners_work/gcp_runners/manual/demo-repository/demo-repository/f30911f1223819fb20b03ec8'
##[debug]Finishing: Setup Cloud SDK - PROD

kundan-krushna-shende-db wrote this answer on 2022-02-16

@sethvargo Also please let me know when we can try v0

sethvargo wrote this answer on 2022-02-16

I just released a new version. You can use v0 again.

More Details About Repo
Owner Name google-github-actions
Repo Name setup-gcloud
Full Name google-github-actions/setup-gcloud
Language TypeScript
Created Date 2019-11-05
Updated Date 2023-03-23
Star Count 1505
Watcher Count 65
Fork Count 548
Issue Count 11

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date