question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google Cloud Storage issues

See original GitHub issue

Hi, I’m trying to use tus-node-server & tus-js-client for resumable uploads to Google Gloud Storage,

First up, some context: as I understand it, the chunkSize must be set to lower than the file size in order for it to actually be “resumable”, otherwise it just starts over at the beginning after any pause/interruption. So the default size of Infinity on tus-js-client seems like a poor choice given that resumability is the headline feature. But, as far as I can tell, it’s the only setting that actually works, at least for Google Cloud Storage. Anything less than the size of the uploaded file hits multiple issues:

  1. 409 Upload-Offset conflict. GCS appears to take some time to process uploaded data and update the file size. So, when the second chunk begins, GCS still reports a file size of 0, and then tus-node-server rejects the second chunk because it’s starting offset doesn’t match the erroneous file size that GCS reports.

    I’m not sure what a good way to solve this is. Disabling the offset check works, but then you’re not following the protocol. Adding a 15-second delay also works, but is slow and stupid and brittle.

  2. With a hack in place to get around the above, the third chunk starts in the wrong position. This is because, I think, the 0 should be offset here: https://github.com/tus/tus-node-server/blob/master/lib/stores/GCSDataStore.js#L151

    This seems like a straightforward logic error, but the only thing that gives me pause is that it also starts at 0 in https://github.com/tus/tus-node-server/blob/master/lib/stores/FileStore.js#L111 and that one seems to works correctly. So maybe I’m misunderstanding something.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Murderloncommented, Dec 13, 2022

This should be fixed by now 😃

1reaction
nfriedlycommented, Oct 20, 2017

FWIW, I figured out where Google’s official library for this is: it’s part of the Firebase SDK: https://firebase.google.com/docs/storage/web/start

I switched to that and things started working properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Cloud Storage
This page describes troubleshooting methods for common errors you may encounter while using Cloud Storage. See the Google Cloud Status Dashboard for ...
Read more >
Google Cloud Service Health
Check back here to view the current status of the services listed below. If you are experiencing an issue not listed here, please...
Read more >
Google Cloud down? Current problems and outages
Real-time problems and outages for Google Cloud. Is your application down? Servers not working? Here you see what is going on.
Read more >
Troubleshooting Loads from Google Cloud Storage
This topic provides instructions for resolving issues specific to loading data from Google Cloud Storage stages. For general data loading troublehshooting ...
Read more >
Connect to Google Cloud Storage - Looker Studio Help
Google Cloud Storage (GCS) offers world-wide storage and retrieval of any amount of data. GCS combines the performance and scalability of Google's cloud...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found