Bug #2407
Image upload to Sunstone running under Apache
Status: | Closed | Start date: | 10/24/2013 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | Daniel Molina | % Done: | 100% | |
Category: | Sunstone | |||
Target version: | Release 4.4 | |||
Resolution: | fixed | Pull request: | ||
Affected Versions: | OpenNebula 4.2 |
Description
Hi,
I'm running OpenNebula and Sunstone 4.2.0-1 on a Debian 7.1 machine. Sunstone is running under Apache 2.2.22-13 (with SSL) via mod_passenger.
When I try to upload an image (Virtual Resources -> Images -> Create -> 'Image Location' set to 'upload') the operation hangs.
The temporary file is not uploaded to the folder specified in /etc/one/sunstone-server.conf as :tmpdir:, even if it is owned by the same user running Apache.
The progress bar is filled, but in the Sunstone logfile (/var/log/one/sunstone.log) I see the following error:
Thu Oct 24 11:12:59 2013 [E]: Unexpected rackinput class PhusionPassenger::Utils::RewindableInput
and then this message
Thu Oct 24 11:12:59 2013 [I]: 129.187.12.55 - - [24/Oct/2013 11:12:59] "POST /upload?img=%7B%22image%22%3A%7B%22NAME%22%3A%22voyageupl%22%2C%22TYPE%22%3A%22OS%22%2C%22PERSISTENT%22%3A%22NO%22%7D%2C%22ds_id%22%3A%221%22%7D&file=voyage.img&qqfile=voyage.img " 500 - 0.0022
The file doesn't show up in the datastore.
Is it possible that this is a bug?
Thanks for the help.
Matteo
Associated revisions
bug #2407: Fix Image upload to Sunstone running under Apache
bug #2407: Fix Image upload to Sunstone running under Apache
(cherry picked from commit f8e2e65b0170268e9c72d52c4fe9f0e13fa05acd)
History
#1 Updated by Ruben S. Montero over 7 years ago
- Status changed from Pending to New
- Target version set to Release 4.4
#2 Updated by Daniel Molina over 7 years ago
Hi Matteo,
Indeed it is a bug, could you try changing the following in your code:
diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 167bcdd..2876aa2 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -408,7 +408,7 @@ post '/upload'do if (rackinput.class == Tempfile) tmpfile = rackinput - elsif (rackinput.class == StringIO) + elsif (rackinput.class == StringIO || rackinput.class == PhusionPassenger::Utils::RewindableInput) tmpfile = Tempfile.open('sunstone-upload') tmpfile.write rackinput.read tmpfile.flush
This code is necessary since we need a path to create the image
#3 Updated by Matteo Lanati over 7 years ago
Hi Daniel,
it worked indeed after applying the patch.
Thanks a lot for providing it so quickly.
All the best,
Matteo
#4 Updated by Daniel Molina over 7 years ago
- Category set to Sunstone
- Status changed from New to Closed
- Assignee set to Daniel Molina
- % Done changed from 0 to 100
- Resolution set to fixed
Great! Thank you for your feedback
It's already included in master.