aquariumbio / aquarium

The Aquarium Lab Operating System
http://klavinslab.org/aquaverse/
MIT License
58 stars 15 forks source link

Upload.url not building correctly #230

Open jvrana opened 7 years ago

jvrana commented 7 years ago

Upload url is not being built correctly. The following code will produce a "bad component error."

Upload.find_by_id(2).path # will not produce error
Upload.find_by_id(2).url # will produce "bad component error"

A minrep is located on the nursery server: Bug Report Tests >> Upload url bug

The error message is copied below: Error: bad component(expected host component): uwbiofab-nursery.s3-"us-west-2".amazonaws.com /home/ubuntu/.rbenv/versions/2.2.0/lib/ruby/2.2.0/uri/generic.rb:593:in check_host' /home/ubuntu/.rbenv/versions/2.2.0/lib/ruby/2.2.0/uri/generic.rb:634:inhost=' /home/ubuntu/.rbenv/versions/2.2.0/lib/ruby/2.2.0/uri/generic.rb:668:in hostname=' /home/ubuntu/.rbenv/versions/2.2.0/lib/ruby/2.2.0/uri/generic.rb:187:ininitialize' /home/ubuntu/.rbenv/versions/2.2.0/lib/ruby/2.2.0/uri/http.rb:84:in initialize' /home/ubuntu/.rbenv/versions/2.2.0/lib/ruby/2.2.0/uri/generic.rb:134:innew' /home/ubuntu/.rbenv/versions/2.2.0/lib/ruby/2.2.0/uri/generic.rb:134:in build' /home/ubuntu/.rbenv/versions/2.2.0/lib/ruby/2.2.0/uri/http.rb:62:inbuild' /home/ubuntu/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/aws-sdk-1.7.1/lib/aws/s3/s3_object.rb:1287:in build_uri' /home/ubuntu/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/aws-sdk-1.7.1/lib/aws/s3/s3_object.rb:1172:inurl_for'

klavins commented 7 years ago

Yeah, the problem is the same as you reported before. The issue is that .url essentially doesn't work anymore because the S3 bucket is private. In the main UI, I use an expiring_url that needs to be used in 10s before it is no longer valid (that's how AWS does things). I'll have to figure out how to get this to work with protocols. Shouldn't be too bad.

klavins commented 7 years ago

Ok, this lo longer crashes, but it still may not be what you want. It gives you a url that must be used immediately, which may work for your purposes. Let me know.

klavins commented 7 years ago

Does the latest version of the code address your issue?

jvrana commented 7 years ago

No unfortunately I am still getting the "bad component" error message when I run a protocol through the manager and attempt to upload a file.

minrep: Nursery Server : Bug Report Tests>Upload Image Test job example: http://52.27.43.242:81/krill/ui?job=45554

If I test the protocol in development using random operations, there will be no error.

klavins commented 5 years ago

Is this still a bug?