Comments (7)
What S3-compatible service are you uploading to? I see mentions of google cloud here. It's possible that this service has slightly different behaviour than S3 does, and that it doesn't accept some arguments.
If you think this happens with AWS S3 as well, could you try reproducing it using the tus-ruby-server's S3 storage directly? For example:
require "tus/storage/s3"
require "stringio"
s3 = Tus::Storage::S3.new(...)
s3.create_file("foo", info = {})
s3.patch_file("foo", StringIO.new("content"), info)
s3.finalize_file("foo", info)
from tus-ruby-server.
Error is raising when try to create file:
from tus-ruby-server.
How is your S3 bucket configured? The following script executes without errors for me:
# credentials that have permissions for creating buckets
ENV["AWS_ACCESS_KEY_ID"] = "..."
ENV["AWS_SECRET_ACCESS_KEY"] = "..."
ENV["AWS_REGION"] = "..."
require "tus/storage/s3"
require "securerandom"
# create the bucket
client = Aws::S3::Client.new
client.create_bucket(bucket: bucket = SecureRandom.hex)
at_exit do
# delete the bucket
client.delete_object(bucket: bucket, key: "foo")
client.delete_object(bucket: bucket, key: "foo.info")
client.delete_bucket(bucket: bucket)
end
storage = Tus::Storage::S3.new(bucket: bucket)
storage.create_file("foo", info = {})
storage.patch_file("foo", StringIO.new("content"), info)
storage.finalize_file("foo", info)
from tus-ruby-server.
Raises the same error on storage.create_file
.
But if you create the file from Aws::S3::Client it works:
client = Aws::S3::Client.new
client.create_bucket(bucket: bucket = SecureRandom.hex)
obj = client.bucket(bucket).object('key')
obj.upload_file('tmp/tmp.csv')
Seems about the difference between two ways to create an object.
from tus-ruby-server.
Yes, the tus server storage will initiate a multipart upload (as you can see from the exception backtrace), which the other will do a simple PUT upload. So, they’re different operations.
Since this works for me, it’s your responsibility to provide more information for reproducing the error. For starters you never answered whether you’re using S3 or an S3-comaptible service.
I will close this now as it doesn’t appear to be a bug in tus-ruby-server.
from tus-ruby-server.
Yes, thanks for your help.
It is Google Cloud Storage service. It is a S3 compatible service. I gave 'Admin Storage' role permission to my user, and created S3 keys for it.
from tus-ruby-server.
Just found that GoogleStorage and Amazon S3 do not manage multipart uploads the same way: https://www.zenko.io/blog/four-differences-google-amazon-s3-api/
Google suggests resumable uploads for big files: https://cloud.google.com/storage/docs/resumable-uploads
from tus-ruby-server.
Related Issues (17)
- Rack dependency version prevents usage with Rails 4 HOT 3
- Before- and after-create hooks HOT 10
- S3-compatible endpoint consistency causing 409 Upload-Offset errors HOT 2
- S3 expire_files not checking prefix? HOT 1
- Failure on big files with S3 storage HOT 3
- error 400 in local HOT 3
- dynamic storage adapters HOT 2
- How can you find the Tus server configuration? HOT 3
- Returning 404 on OPTION check for file results in upload being unable to happen HOT 3
- Full file SHA256 checksum? HOT 5
- Configure a CI
- Setting to update expire timestamp on PATCH requests HOT 5
- Mounting multiple Tus::Server instances with different storage adapters HOT 2
- tus server on rails HOT 1
- 412 Pre-Condition Failed returns after whole body uploaded HOT 19
- Getting tus-ruby-server to run behind a reverse proxy HOT 10
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 tus-ruby-server.