Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: tus: unexpected response while uploading chunk, originated from request (response code: 408, response text: stream timeout) #176

Closed
implicit-invocation opened this issue Nov 10, 2019 · 15 comments
Labels

Comments

@implicit-invocation
Copy link

Describe the bug
I tried using tus-js-client for uploading videos to CloudFlare Stream. Video files are about 1~5GB. Most of the times (49/50), I got this this error

Error: tus: unexpected response while uploading chunk, originated from request (response code: 408, response text: stream timeout)

To Reproduce
Steps to reproduce the behavior:

  1. Use the sample source code from CloudFlare Stream documentation, similar to the one on Readme page.
  2. Run from nodejs.
  3. See error.

Expected behavior
onSuccess fired

Setup details
Please provide following details, if applicable to your situation:

  • Runtime environment: Node.js v12.13.0
  • Used tus-js-client version: 1.8.0
  • Used tus server software: CloudFlare
@Acconut
Copy link
Member

Acconut commented Nov 10, 2019

Good point, tus-js-client currently does not retry when the server returns a 408 status code (see https://github.com/tus/tus-js-client/blob/master/lib/upload.js#L189-L199), which does not seem correct in this case. Would mind opening a PR to fix this and allow tus-js-client to also retry 408s?

@rnakashiro
Copy link

rnakashiro commented Nov 18, 2019

Hi, we have same error to upload to CloudFlare Stream, with python tus client.

Current python implementation does not check Status Code. It checks only response header upload-offset.
We are happy if the retry checks are fixed.

And once we could upload to CFStream with retry option below 😄

        uploader = tus_client.uploader(
            file_path=...,
            chunk_size=...,
            retries=TUS_RETRY_COUNT, # int > 0
            retry_delay=...,
        )

@Acconut
Copy link
Member

Acconut commented Nov 18, 2019

@rnakashiro Thanks for reporting, but please open an issue about this in the tus-py-client repository (https://github.com/tus/tus-py-client).

@rnakashiro
Copy link

@implicit-invocation
Hi, I have same issue for CFStream, and posted my measurement to cloudflare community. FYI 😄

https://community.cloudflare.com/t/cloudflare-stream-uploading-with-tus-stops-with-408/130639/6

@Acconut
Copy link
Member

Acconut commented Dec 2, 2019

@rnakashiro Please open an issue in tus-py-client about your problem, so it can be resolved there. This repository is for tus-js-client which you don't seem the be using.

@rnakashiro
Copy link

@Acconut
Thanks, as I wrote, I think that should be server side problem.

So, now I don't wanna to be fixed in client library side.
Please make issue yourself if you improve it.

@Acconut
Copy link
Member

Acconut commented Dec 4, 2019

I think that should be server side problem. So, now I don't wanna to be fixed in client library side.

Sure enough! I am just not sure if CloudFlare is going to patch their servers. That's the impression I get from reading https://community.cloudflare.com/t/cloudflare-stream-uploading-with-tus-stops-with-408/130639

@rnakashiro
Copy link

rnakashiro commented Dec 5, 2019

@Acconut
Thanks. FYI below.

The ticket on community don't have reply to resolve now, but I made support ticket to CloudFlare about the issue and condition to reproduce.

Then, I could hear that they are investigating the issue of last chunk upload.
I think that if the improvement is released, all client lib will work on JS and python and so on.

@ifedapoolarewaju
Copy link
Contributor

Current python implementation does not check Status Code. It checks only response header upload-offset

@rnakashiro the tuspy client always checks for status code after each request here. Or is it something else you were referring to? 🤔

@rnakashiro
Copy link

@ifedapoolarewaju
I'm sorry, I wanted to say about error condition for 40X, such like 403 => destroy, 408 => some retry. 😄

@frhnfrq
Copy link

frhnfrq commented Apr 1, 2020

Is there any update on this? On the CF community forum post (linked above), I see that the issue is caused by the last chunk taking long time to upload. Someone from CF team has replied that they have made optimizations and we should try to upload the last chunk again when 400 errors are returned

@kvz
Copy link
Member

kvz commented Apr 1, 2020

Can you ask the CloudFlare team to weigh in and perhaps contribute their fix back to this open source project?

@frhnfrq
Copy link

frhnfrq commented Apr 1, 2020

Created a new ticket on CF support, let's see what they say.

@daghendrik
Copy link

Created a new ticket on CF support, let's see what they say.

Did you hear anything back from them, @frhnfrq ?

@Acconut
Copy link
Member

Acconut commented Aug 1, 2022

Closing this issue due to inactivity. Feel free to leave a comment if you want to continue the discussion :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants