Closed xulww closed 1 week ago
Hi, it says it clearly in the error? You are not setting the s3 bucket key. You are using S3 on the client for Uppy so Companion will also try to upload to S3. Make sure you add your S3 credentials in Companion.
Note that you are using Uppy in React incorrectly. I would refrain from useRef
+ useEffect
and instead follow our recommendations from the docs.
I don't see how our Uppy implementation in React is "incorrect" but we will definitely change it so it's aligned with the docs. As I noted above, there weren't any issues in the previous major versions. The problems started to surface after we followed the migration guides. If adding additional S3 settings to the Companion server is now required, this should be included in the migration guides. Thank you for the quick response!
I don't understand how your Companion uploaded to AWS before without having any credentials? Are you sure you didn't change uploader on the client as well?
I also don't understand what went wrong with the new versions. The code I've included above is the code we've been using for the past 2+ years and we haven't had any issues until now. To be fair, I'm not sure if the files were being uploaded to S3 from the Companion server directly (most likely that wasn't the case). I also don't really understand what is the point of providing S3 credentials to the Companion instance now. Isn't the upload flow something like Companion -> Google Drive -> Companion -> Uppy (client) -> S3? After all, the docs describe Companion as:
an open source server application which takes away the complexity of authentication and the cost of downloading files from remote sources, such as Instagram, Google Drive, and others...
which sounds like it should only help users access the files (and then send it to the Uppy client instance?). I might be wrong tho, the whole thing is a bit of a black box to me and many others as it seems.
For the record, we reverted to Uppy version 3 and Companion version 4 and everything works again (using the code above)
No, the point of Companion is to not send any files to the client. The reason it exists is so clients save bandwidth. It only sends back metadata to the client to display a list of files and the client then chooses which files are going to be downloaded inside Companion.
Have you tried adding the credentials to see if it works?
@mifi did something change that was missed in the migration guide?
Initial checklist
Link to runnable example
No response
Steps to reproduce
Run the code below with the following packages installed: uppy: 4.3.0 @uppy/aws-s3: 4.1.0 @uppy/google-drive: 4.1.0 @uppy/companion: 5.1.0
Client integration
Server integration (self-hosted Companion instance)
Expected behavior
The files should be automatically uploaded to the server which was the observed behaviour before migrating the code to Uppy 4 and Companion 5.
Actual behavior
The files are not uploaded and the following error is logged on the server running the Companion instance:
[error] bc14c2f3 uploader.error TypeError: s3: bucket key must be a string or a function resolving the bucket string
The desired Google Drive file does reach the onBeforeUpload function but for some reason doesn't reach the getUploadParameters function. Something between those two functions breaks the flow of uploading a file.