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
223 stars 50 forks source link

Error during upload: the offset is lower than the number of bytes written. #331

Closed cwolf24 closed 1 year ago

cwolf24 commented 1 year ago

TL;DR

An unexpected Error: the offset is lower than the number of bytes written. appears when we upload files.

Expected behavior

Uploading the files (test reports) always works.

Observed behavior

Today, the mentioned error appears already two times when we tried to upload our files (test reports). See log output for error details

Action YAML

- name: Authenticate to GCP
        uses: google-github-actions/auth@v1.1.1
        with:
          token_format: access_token
          workload_identity_provider: ${{ secrets.GCP_OIDC_ID_PROVIDER }}
          service_account: ${{ secrets.GCP_OIDC_SA}}
      - name: Authenticate to GKE cluster
        uses: google-github-actions/get-gke-credentials@v1.0.2
        with:
          cluster_name: ${{ secrets.GCP_K8S_CLUSTER }}
          location: ${{ secrets.GCP_K8S_REGION }}
          use_internal_ip: true 
      - name: Upload Report
        uses: google-github-actions/upload-cloud-storage@v1
        with:
          path: tests/output/allure-report
          parent: false
          destination: ${{ env.GCP_BUCKET_NAME }}/${{ env.GCP_BUCKET_PATH }}
          concurrency: 50

Log output

Error: google-github-actions/upload-cloud-storage failed with: the offset is lower than the number of bytes written. The server has 0 bytes and while 10 bytes has been uploaded - thus 10 bytes are missing. Stopping as this could result in data loss. Initiate a new upload to continue.
  node:internal/process/promises:279
              triggerUncaughtException(err, true /* fromPromise */);
              ^

  RangeError: The offset is lower than the number of bytes written. The server has 0 bytes and while 10 bytes has been uploaded - thus 10 bytes are missing. Stopping as this could result in data loss. Initiate a new upload to continue.
      at Upload.startUploading (/home/runner/work/_actions/google-github-actions/upload-cloud-storage/v1/dist/index.js:139:6312)
      at Upload.continueUploading (/home/runner/work/_actions/google-github-actions/upload-cloud-storage/v1/dist/index.js:139:5810)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)


### Additional information

So far this issue has only been seen today.
sethvargo commented 1 year ago

Hi @cwolf24 - there we're some minor Cloud Storage outages yesterday:

Is the issue still occurring?

cwolf24 commented 1 year ago

@sethvargo We saw this issue today in the morning (german time 😉 ) and i just did re-run the upload job and now it worked fine. Looks like it was a temporary github issue and therfor i will close this issue here. Thanks for your fast response! --> CLOSED

huvber commented 5 months ago

We noticed the same problem yesterday, can we re-open the issue?

cwolf24 commented 5 months ago

@huvber I think it would be better to create a new ticket, or?

So far we have not noticed this issue anymore.