pingdotgg / uploadthing

File uploads for modern web devs
https://uploadthing.com
MIT License
3.96k stars 288 forks source link

[bug]: onUploadError running even though the video was succesfully uploaded #912

Closed ralph27 closed 3 days ago

ralph27 commented 1 month ago

Provide environment information

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 1.69 GB / 15.84 GB
  Binaries:
    Node: 20.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.5.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.1.4 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Chrome: 122.0.6261.129
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    @uploadthing/react: ^6.7.2 => 6.7.2
    typescript: ^5.4.2 => 5.4.5
    uploadthing: ^6.13.2 => 6.13.2

Describe the bug

When i try to upload a 40+ MB video, the video gets saved succesfully because it shows up in the dashboard with a playable URL and the correct metadata, but for some reason, the onUploadError callback runs and i get an error that says: UploadThingError: Something went wrong. Please report this to UploadThing.

I checked the network tabs, and all the serverCallbacks passed successfully, and there are no errors in my server console.

Link to reproduction

https://github.com/Knotron/knotron

To reproduce

upload a 41 MB file using the UploadButton

Additional information

I am using the latest version of Next and the bug is not reproduceable on small files.

👨‍👧‍👦 Contributing

Code of Conduct

markflorkowski commented 4 weeks ago

Can you enable debug logging to see if there is any additional information?

I have a feeling this is polling timeout, but not 100% on that.

Also is there any errors in the dashboard (status column)?

ralph27 commented 3 weeks ago

The status of the video in the dashboard is Uploaded

and here is the result of the logging

[ "Handling multipart-complete request with input:", { "fileKey":"84e4ae0a-85d4-4212-9efd-7a9b208d438f-wenfus.mp4", "uploadId":"E0ZiaUWS.811.r.1I5w1HW.HfCwFjBkFW43mCoNgYjnxAYumt0jhOrZ533KOSHuJesYrq4Og5zEa9D0WTVg7iRbbyTBJdVAqp8zecgCHiu.G.wqHexwr5a68y7Cg_xly", "etags":[ { "tag":"\"a8148a84b17630c3ea6512e59111f605\"", "partNumber":1 }, { "tag":"\"f8f03fad7249014cf69c544b0d18804b\"", "partNumber":2 }, { "tag":"\"272ec6d6b376b6b42643952b390f0f9b\"", "partNumber":3 }, { "tag":"\"52b6ca9e57e6ac14c8a362c58d3d2212\"", "partNumber":4 }, { "tag":"\"90a74cc9c2c2611622142c0f96e07bef\"", "partNumber":5 }, { "tag":"\"8a8b59a28474c6837278deec521c5e6b\"", "partNumber":6 }, { "tag":"\"83b81c143f070aa1bf9b722cd8f6c74e\"", "partNumber":7 }, { "tag":"\"e5f0dd60c848f5f7dcfc507e26d5c2ca\"", "partNumber":8 }, { "tag":"\"3fc6493e5065b2ca5cb394271dcbd904\"", "partNumber":9 } ] } ] Notifying UploadThing that multipart upload is complete [ "UploadThing responded with:", { "success":true } ]

No errors whatsoever but onUploadError is still running

markflorkowski commented 3 weeks ago

If you are not using any server data in your client-side onUploadComplete, can you try enabling skipPolling on your component/useUploadthing?

ralph27 commented 2 weeks ago

@markflorkowski i do need server data. Can you reproduce the bug?

markflorkowski commented 2 weeks ago

Yes. The "bug" is that we only poll for a fixed amount of time on the client, and if your upload takes longer than that, it will just error.

We are in the middle of a significant infrastructure overhaul that we hope to release pretty soon that will make this a non-issue. Keep an eye out for v7 of the uploadthing packages.

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had any activity for 10 days. It will be closed in 5 days if no further activity occurs.

github-actions[bot] commented 3 days ago

This issue has been closed because it has not had any activity for 5 days since being marked as stale.