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.
google-github-actions/[email protected],
was working earlier so want that to be working.
google-github-actions/[email protected],
giving timeout error
- name: setup gcloud
uses: google-github-actions/[email protected]
with:
project_id: ${{ env.PROJECT_ID }}
service_account_key: ${{ secrets.GOOGLE_CREDENTIALS }}
Run google-github-actions/[email protected]
with:
project_id: XXX
service_account_key: ***
version: latest
export_default_credentials: false
cleanup_credentials: true
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.
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
).
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.
name: Testing gcloud
on:
push:
branches: [ main ]
workflow_dispatch:
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
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;
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.
@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]
?
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
@sethvargo Also please let me know when we can try v0
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 |
Issue Title | Created Date | Updated Date |
---|