Comments (5)
That's odd, indeed. I looked at the Assembly status at https://api2.transloadit.com/assemblies/46140cb99b11473a8878b5dcfbd8e0a1 and there are a couple of things to note:
The Assembly is created with one upload to be expected, but two files are uploaded via tus for it. From the logs, it appears as if these two tus uploads were started at basically the same time. One possible explanation is a race condition in companion or tus-js-client, which causes duplicate uploads to be created. The two uploads could also explain why the upload URL changed.
That being said, I am not sure why the tus uploads include size: 0
. That's incorrect and I will look into it.
The two files from the tus uploads were also successfully added to the Assembly. Logs from the servers also indicate that jobs for extracting the metadata completed, so the files were properly imported into the api2.
Although the uploads were finished and process by the api2, the assembly is marked as REQUEST_ABORT. I guess this is because bytes_expected !== bytes_received
. The formed is calculated based on the size
property of the uploads, which are incorrect for some reason.
yarn dev:with-companion
and the Transloadit(tus) plugin,
Use for example DropBox, add a single file and upload it.
Do I need some secret credentials in my environment to do this? Can this also be reproduced when using something else than Dropbox?
from uppy.
Ok this is very interesting, thanks!
Do I need some secret credentials in my environment to do this?
yes. but maybe not for the URL plugin.
at least you need inside .env
:
VITE_TRANSLOADIT_KEY
VITE_TRANSLOADIT_SERVICE_URL=https://api2.transloadit.com
VITE_TRANSLOADIT_SECRET
VITE_TRANSLOADIT_TEMPLATE
VITE_COMPANION_URL=http://localhost:3020
VITE_UPLOADER=transloadit
see also .env.example (although maybe not quite up to date)
Can this also be reproduced when using something else than Dropbox?
I believe so, and it can be reproduced with the URL plugin. I wanted to ttry to reproduce it on transloadit.com but that is currently broken due to a different issue
from uppy.
Thanks for the tips! I will wait what you and Merlijn discover. If there is a need for me, I can try to reproduce it as well :)
from uppy.
We found out what's the cause. After a refactor (#4734), Uppy now sends the "resume" event right after starting an upload. This calls this.tus.start():
the problem is that this.tus.start() has already been called by companion when the upload started (some hundred milliseconds before). Calling tus.start() twice causes tus-js-client to start the same upload twice, but produce a new uploadUrls the second time, sent back to uppy. I'm not sure if this is intended behaviour in tus-js-client (start the same upload twice in parallel for the same assembly), but we will workaround the issue by implementing a simple state machine to prevent calling tus.start() if we are already in the paused state. for fun we tried to call tus.start() 3 times back-to-back and indeed it uploaded the file 3 times to the assembly.
from uppy.
Now that you are talking about it, I remember that another user of tus-js-client also ran into duplicate uploads because of the same reason. I opened an issue in tus-js-client to implement protection against this in the future: tus/tus-js-client#659. Thanks for looking it this!
from uppy.
Related Issues (20)
- IMPORTANT: macOS Safari does not work with Uppy HOT 2
- @uppy/core and @uppy/dashboard 4.0.0-beta-3 versions contain references to React packages and JSX files in an Angular 17 app HOT 3
- `DashboardMiscOptions.trigger` requires `string`, but `findAllDOMElements` accepts `Node` as well
- have maxFileSize check the file after compression/resizing via Compressor plugin HOT 2
- Rewrite all Companion validation errors to respond with a status code and message
- Using uppy.setOptions({locale}) won't update locale strings in Restricter instance
- Incomplete type definitions for `BasePlugin` HOT 1
- XHRUpload stuck at 100% despite 2xx response code. HOT 12
- [AWS S3 Uploader] Allow retrieving Object Version ID HOT 3
- Dashboard - status bar upload button visible after restoring files, despite hideUploadButton being true.
- Custom Uploader add list of necessary events
- @transloadit/prettier-bytes 0.3.3 not working with webpack HOT 7
- uppy pauseResume throw unhandled error HOT 2
- Disable browse file / drag and drop on uppy dashboard HOT 2
- Can't resolve '@uppy/core/lib/UploaderPlugin.js HOT 10
- Errors in TypeScript definitions when installed with pnpm HOT 5
- Latest version of @uppy/xhr-upload doesn't support PATCH method HOT 11
- aws-s3-multipart + golden retriever HOT 3
- Event listener that fires before file upload process starts HOT 4
- Drag & Drop not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uppy.