google-github-actions / upload-cloud-storage

A GitHub Action for uploading files to a Google Cloud Storage (GCS) bucket.
https://cloud.google.com/storage
Apache License 2.0
206 stars 49 forks source link

connect ETIMEDOUT #290

Closed liaocyintl closed 1 year ago

liaocyintl commented 1 year ago

TL;DR

Sometimes My workflow often occurs with a reason: connect ETIMEDOUT ERROR as follows. Is there anything wrong with my config?

Error: google-github-actions/upload-cloud-storage failed with: request to https://storage.googleapis.com/upload/storage/v1/b/{xxx} failed, reason: connect ETIMEDOUT {ip_address}

My setting is as follows:

- name: Deploy to GCS 
  uses: 'google-github-actions/upload-cloud-storage@v0'
  with:
    path: './build'
    destination: 'some-destination'
    parent: false
    project_id: {project_name}
    concurrency: 50

Expected behavior

No response

Observed behavior

No response

Action YAML

- name: Deploy to GCS 
  uses: 'google-github-actions/upload-cloud-storage@v0'
  with:
    path: './build'
    destination: 'some-destination'
    parent: false
    project_id: {project_name}
    concurrency: 50

Log output

Uploading ...
  Error: google-github-actions/upload-cloud-storage failed with: request to https://storage.googleapis.com/upload/storage/v1/b/xxx failed, reason: connect ETIMEDOUT xx.xx.xx.xx:443

FetchError: request to https://storage.googleapis.com/upload/storage/v1/b/xxx failed, reason: connect ETIMEDOUT xx.xx.xx.xx:443
      at ClientRequest.<anonymous> (/home/runner/work/_actions/google-github-actions/upload-cloud-storage/v0/dist/index.js:226:57777)
      at ClientRequest.emit (node:events:402:35)
      at TLSSocket.socketErrorListener (node:_http_client:447:9)
      at TLSSocket.emit (node:events:390:28)
      at emitErrorNT (node:internal/streams/destroy:157:8)
      at emitErrorCloseNT (node:internal/streams/destroy:122:3)
      at processTicksAndRejections (node:internal/process/task_queues:83:21) {
    type: 'system',
    errno: 'ETIMEDOUT',
    code: 'ETIMEDOUT',
    config: {
      method: 'PUT',
      url: 'https://storage.googleapis.com/upload/storage/v1/b/xxx',
      headers: {
        'Content-Range': 'bytes 0-*/*',
        Authorization: '***',
        'User-Agent': 'google-api-nodejs-client/7.14.1',
        'x-goog-api-client': 'gl-node/16.13.0 auth/7.14.1',
        Accept: 'application/json'
      },
      body: Readable {
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: false,
          ended: true,
          endEmitted: true,
          reading: false,
          constructed: true,
          sync: false,
          needReadable: false,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: false,
          emitClose: true,
          autoDestroy: true,
          destroyed: true,
          errored: null,
          closed: true,
          closeEmitted: true,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: false,
          dataEmitted: true,
          decoder: null,
          encoding: null,
          [Symbol(kPaused)]: true
        },
        _read: [AsyncFunction: read],
        _events: [Object: null prototype] { error: [Function (anonymous)] },
        _eventsCount: 1,
        _maxListeners: undefined,
        [Symbol(kCapture)]: false
      },
      signal: AbortSignal {},
      validateStatus: [Function (anonymous)],
      paramsSerializer: [Function: paramsSerializer],
      responseType: 'json'
    }
  }

Additional information

No response

sethvargo commented 1 year ago

Please share your complete action.yml file. Are you running on self-hosted runners? What is the operating system? How large is the file you're uploading? What is the output of the debug logging?

sage-epilog commented 1 year ago

I am experiencing the same issue while uploading a directory.

Here is the action giving me issues. You can see the call to the upload-cloud-storage action at the very end. The directory being uploaded is on the order of a few GB ~2-5 and contains a large (~2000) small files within it. The action does not fail on every run, just on every few so I am unsure how to reproduce.

Action .yml

  build_push_ota:
    needs: [build_recovery, build_kernel, build_system]
    runs-on: ubuntu-18.04
    timeout-minutes: 120
    permissions:
      contents: 'read'
      id-token: 'write'

    steps:
      - uses: actions/checkout@v3
        with:
          submodules: false

      - name: docker hub login
        uses: docker/login-action@v2
        with:
          username: ***
          password: ${{ secrets.DOCKER_HUB_TOKEN }}

      - name: Download kernel artifact
        uses: actions/download-artifact@v3

      - name: Extract rootfs and recovery docker images
        run: sudo ./github-ci/extract_docker.sh

      - name: Install nvidia flash dependencies
        run: sudo ./github-ci/setup_ota_packages.sh

      - name: Populate keyfiles
        run: ./github-ci/secret_to_keyfile.sh
        env:
          DEK_DEV_SECRET: ${{ secrets.DEK_DEV_SECRET}}
          RSA_PRIV_DEV_KEY: ${{ secrets.RSA_PRIV_DEV_KEY}}
          SBK_DEV_SECRET: ${{ secrets.SBK_DEV_SECRET}}
          USER_DEV_SECRET: ${{ secrets.USER_DEV_SECRET}}

      - name: build ota package
        run: sudo ./github-ci/build_ci_ota.sh

      - name: gcs login
        id: gcs-auth
        uses: google-github-actions/auth@v0
        with:

          credentials_json: ${{ secrets.GCS_CI_CREDENTIALS }}

      - name: push ota
        id: upload-ota
        uses: google-github-actions/upload-cloud-storage@v0
        with:
          path: ./ota_output
          destination: ***
sethvargo commented 1 year ago

Hi folks - this is a duplicate of https://github.com/googleapis/google-cloud-node/issues/996 (which was closed without resolution). We use that client library in our implementation. I would recommend filing an issue against that client library. I also found some Stackoverflow posts with the exact same error from users of that client library.