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 when uploading file bigger than 5GB #14

Open
Kurounin opened this issue Mar 25, 2024 · 2 comments
Open

Error when uploading file bigger than 5GB #14

Kurounin opened this issue Mar 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Kurounin
Copy link

Kurounin commented Mar 25, 2024

Bug report

Describe the bug

When uploading a file which is bigger than 5GB, on the Pro Plan with a global limit of 20GB the following error is returned:

Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
 at Newtonsoft.Json.JsonTextReader.ParseValue()
 at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
 at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
 at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
 at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
 at Supabase.Storage.Extensions.HttpClientProgress.UploadAsync(HttpClient client, Uri uri, Stream stream, Dictionary`2 headers, Progress`1 progress)
 at Supabase.Storage.StorageFileApi.UploadOrUpdate(String localPath, String supabasePath, FileOptions options, EventHandler`1 onProgress)
 at Supabase.Storage.StorageFileApi.Upload(String localFilePath, String supabasePath, FileOptions options, EventHandler`1 onProgress, Boolean inferContentType) 

This is triggered because the response is not a json but a 413 error from Cloudflare:

<html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>cloudflare</center>
</body>
</html> 

System information

  • Version of supabase-csharp: 0.16.1
  • Version of supabase-storage-csharp: 1.4.0
@Kurounin Kurounin added the bug Something isn't working label Mar 25, 2024
@acupofjose
Copy link
Member

This is because our supabase-storage client hasn't yet implemented the TUS protocol like the JS client has (see here: https://dev.to/supabase/supabase-storage-v3-resumable-uploads-with-support-for-50gb-files-2egd). I'll need to look into what that entails. Always open to PRs if you're interested!

@acupofjose
Copy link
Member

I'm going to see about replacing our HttpClient implementation with the following package: https://github.com/bluetianx/BirdMessenger - which should clear this issue up and add some additional functionality!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants