You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Gonçalo Lourenço <gm...@gmail.com> on 2014/05/27 22:32:52 UTC

Problems with libdeltacloud

Greetings everyone! I've been trying to use Deltacloud in a small project
of mine in order to make it easier for me to access multiple CSPs in a
quick, efficient manner. Due to the project's codebase being in the C
language, I decided to give libdeltacloud a try in hopes that it'd work as
intended. Much to my disappointment, it seemingly does not. I have written
a few functions that utilize the library in question, and none of them work.

What I wanted to implement was a few functions that'd allow me to download
from and upload to a bucket. I'd have multiple instances of the Deltacloud
Server running, one for each CSP that I use. For testing purposes, I've
only been using my account on Microsoft's Azure, which means I've been
using exactly one instance of the Deltacloud Server at any given time.

For starters, here's a small function whose intended job is to download a
file from a given bucket:
http://pastebin.com/Nv2YMDv1

Whenever I run this particular function, I get a file with the right size
in bytes, but some XML returned by the Deltacloud Server gets inserted into
the beginning of the file. So far, I've only tried to download JPEG files,
and none of them has been downloaded successfully. However, when I use the
web interface of the Server, the file is downloaded correctly.

Then there's the upload function:
http://pastebin.com/9abkZpVb

When I run this one, I get a whole lot of error messages spewed out by the
Server. The file isn't uploaded at all, and I'm left with a semi-working
Deltacloud Server. Here's the full output of the Server:

Starting Deltacloud API :: azure :: http://localhost:3001/api
> Thin web server (v1.6.2 codename Doc Brown)
> Debugging ON
> Maximum connections set to 1024
> Listening on localhost:3001, CTRL+C to stop
> 127.0.0.1 - - [27/May/2014 21:26:33] "GET /api HTTP/1.1" 200 192 0.0143
> 127.0.0.1 - - [27/May/2014 21:26:33] "GET /api/buckets/tese HTTP/1.1" 200
> 315 0.4380
> 127.0.0.1 - - [27/May/2014 21:26:33] "GET /api/buckets/tese HTTP/1.1" 200
> 315 0.2591
> 127.0.0.1 - - [27/May/2014 21:26:34] "GET /api/buckets/tese/test.txt
> HTTP/1.1" 404 512 0.3162
> E, [2014-05-27T21:26:35.604921 #28922] ERROR -- 500:
> [Deltacloud::Exceptions::BackendError] Unhandled exception or status code
> (no implicit conversion of Tempfile into String)
>
> /usr/local/share/gems/gems/waz-storage-1.3.6/lib/waz/blobs/service.rb:110:in
> `digest'
> /usr/local/share/gems/gems/waz-storage-1.3.6/lib/waz/blobs/service.rb:110:in
> `hexdigest'
> /usr/local/share/gems/gems/waz-storage-1.3.6/lib/waz/blobs/service.rb:110:in
> `put_blob'
> /usr/local/share/gems/gems/waz-storage-1.3.6/lib/waz/blobs/container.rb:129:in
> `store'
> /usr/local/share/gems/gems/deltacloud-core-1.1.3/lib/deltacloud/drivers/azure/azure_driver.rb:108:in
> `block in create_blob'
> /usr/local/share/gems/gems/deltacloud-core-1.1.3/lib/deltacloud/drivers/exceptions.rb:220:in
> `call'
> /usr/local/share/gems/gems/deltacloud-core-1.1.3/lib/deltacloud/drivers/exceptions.rb:220:in
> `safely'
> /usr/local/share/gems/gems/deltacloud-core-1.1.3/lib/deltacloud/drivers/azure/azure_driver.rb:105:in
> `create_blob'
> /usr/local/share/gems/gems/deltacloud-core-1.1.3/lib/deltacloud/collections/buckets.rb:190:in
> `block (4 levels) in <class:Buckets>'
> /usr/local/share/gems/gems/sinatra-rabbit-1.1.6/lib/sinatra/rabbit/base.rb:400:in
> `instance_eval'
> /usr/local/share/gems/gems/sinatra-rabbit-1.1.6/lib/sinatra/rabbit/base.rb:400:in
> `block in control'
> /usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
> /usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in
> `block in compile!'
> /usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
> /usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block
> (3 levels) in route!'
> /usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in
> `route_eval'
> /usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block
> (2 levels) in route!'
> /usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in
> `block in process_route'
> /usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in
> `catch'
> /usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in
> `process_route'
> /usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block
> in route!'
>
>
> 127.0.0.1 - - [27/May/2014 21:26:35] "POST /api/buckets/tese HTTP/1.1" 500
> 77520 0.1392
>


I have no idea why neither of the two wants to work. I humbly ask for your
insight on this manner, and I'd appreciate any help you can give me.


Kind regards,
Gonçalo Lourenço