[one-users] Sunstone image upload not working - images not in tmpdir

Stefan Kooman stefan at bit.nl
Wed Nov 13 04:41:08 PST 2013


Quoting Daniel Molina (dmolina at opennebula.org):
> Hi Stefan,
 
> Could you try exporting the $TMPDIR var before starting the passenger
> processes?
> 
> This is the code that generates the temp file (sunstone-server.rb):
>         tmpfile = Tempfile.open('sunstone-upload')
> 
> by default, it uses Dir.tmpdir as temp dir and this method checks the env
> var TMPDIR.  This variable is defined in the sunstone-server script, but
> Apache do not use this script to start new server instances
> 
> You can also specify it as a parameter in the code:
>         tmpfile = Tempfile.open('sunstone-upload', '/mnt/sunstone_upload')

I've tried this and that works, i.e. the image gets uploaded and stored
in /mnt/sunstone_upload directory. However, something goes wrong copying
the file to the datastore. The file is empty (0 bytes). Here some logging:

sunstone.log:
[13/Nov/2013 12:19:28] "POST /upload?img=%7B%22i
mage%22%3A%7B%22NAME%22%3A%22ubuntu_saucy%22%2C%22TYPE%22%3A%22CDROM%22%2C%22PERSISTENT%22%3A%22NO%22%7D%2C%22ds_id%2
2%3A%22105%22%7D&file=ubuntu-13.10-server-amd64.iso&qqfile=ubuntu-13.10-server-amd64.iso
" 201 910 11.8890

oned.log:

Wed Nov 13 12:19:23 2013 [ReM][D]: Req:8352 UID:0 ImageAllocate invoked,
"NAME="ubuntu_saucy"...", 105
Wed Nov 13 12:19:23 2013 [ImM][I]: Copying
/mnt/sunstone_upload/sunstone-upload20131113-23887-1gdh6b2 to repository
for image 22
Wed Nov 13 12:19:23 2013 [ReM][D]: Req:8352 UID:0 ImageAllocate result
SUCCESS, 22
Wed Nov 13 12:19:23 2013 [ReM][D]: Req:8624 UID:0 ImageInfo invoked, 22
Wed Nov 13 12:19:23 2013 [ReM][D]: Req:8624 UID:0 ImageInfo result
SUCCESS, "<IMAGE><ID>22</ID><U..."
Wed Nov 13 12:19:24 2013 [ImM][I]: Image copied and ready to use.


file listing in datastore:
-rw-rw-r-- 1 oneadmin oneadmin 11G Nov 13 10:52 a72586472f7351691e70f637d0ff7278
-rw-rw-r-- 1 oneadmin oneadmin   0 Nov 13 12:54 54ea1f1607a44c65b70936e2df020887


> Hope this helps
It sure does help but I'm not there yet :).

How can I debug this final step (copy from tempdir to datastore)?

Thanks,

Stefan


-- 
| BIT BV  http://www.bit.nl/        Kamer van Koophandel 09090351
| GPG: 0xD14839C6                   +31 318 648 688 / info at bit.nl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: Digital signature
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20131113/46c5e146/attachment-0002.pgp>


More information about the Users mailing list