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

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

Closed edulodgify closed 1 week ago

edulodgify commented 1 week 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 always works

Observed behavior

we have been observing this behavior where pipelines randomly fail since April with the mentioned error, if we re-run those pipelines they work perfectly

Action YAML

- name: 📤 Update commit build on Google Cloud
        uses: google-github-actions/upload-cloud-storage@v2
        with:
          path: ./build
          destination: ${{ env.GCP_BUCKET_NAME }}/${{ env.GCP_BUCKET_PATH }}/${{ github.sha }}
          parent: false

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.

Additional information

It seems that this only happens when we are using the managed runners, with self-hosted we have not observed this problem, but as I said it happens randomly so it may or may not happen in the future

sethvargo commented 1 week ago

Hi @edulodgify - this is almost always some kind of transient network, firewall, or connectivity issue that we have no control over. I'm not sure if there's anything we can do in the GitHub Action to make it better.

edulodgify commented 1 week ago

Ok, thanks for your help @sethvargo