<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 29 November 2013 09:27, Stefan Kooman <span dir="ltr"><<a href="mailto:stefan@bit.nl" target="_blank">stefan@bit.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">Quoting Daniel Molina (<a href="mailto:dmolina@opennebula.org">dmolina@opennebula.org</a>):<br>
> On 28 November 2013 18:15, Stefan Kooman <<a href="mailto:stefan@bit.nl">stefan@bit.nl</a>> wrote:<br>
><br>
> > Quoting Daniel Molina (<a href="mailto:dmolina@opennebula.org">dmolina@opennebula.org</a>):<br>
> > > On 27 November 2013 21:27, Stefan Kooman <<a href="mailto:stefan@bit.nl">stefan@bit.nl</a>> wrote:<br>
> > ><br>
> > ><br>
> > > We didn't change anything, just:<br>
> > ><br>
> > <a href="https://github.com/OpenNebula/one/commit/f8e2e65b0170268e9c72d52c4fe9f0e13fa05acd" target="_blank">https://github.com/OpenNebula/one/commit/f8e2e65b0170268e9c72d52c4fe9f0e13fa05acd</a><br>
> > ><br>
> > > So, it should work as before.<br>
> ><br>
> > Passenger 4.0.26 is giving me this error (500):<br>
> ><br>
> > [ 2013-11-28 17:34:07.3852 19823/7f177e5a6700<br>
> > Pool2/Implementation.cpp:1291 ]: [App 19906 stderr] NameError -<br>
> > uninitialized constant PhusionPassenger::Utils::RewindableInput:<br>
> > [ 2013-11-28 17:34:07.3858 19823/7f177e5a6700<br>
> > Pool2/Implementation.cpp:1291 ]: [App 19906 stderr]<br>
> > /usr/lib/one/sunstone/sunstone-server.rb:412:in `block in <top (required)>'<br>
> ><br>
> > Image upload _is_ working with Apache Passenger 3.0.13debian-1.2.<br>
> > Apparently<br>
> > passenger 4.x needs this class to be handled differently.<br>
> ><br>
><br>
> Could you check what it the value of rackinput.class in the "post '/upload'<br>
> do" method of sunstone-server.rb. You can add a<br>
> logger.error(rackinput.class) and it will be reported in the log.<br>
<br>
</div>##############################################################################<br>
# Upload image<br>
##############################################################################<br>
post '/upload'do<br>
<br>
tmpfile = nil<br>
rackinput = request.env['rack.input']<br>
<br>
if (rackinput.class == Tempfile)<br>
tmpfile = rackinput<br>
elsif (rackinput.class == StringIO || rackinput.class == PhusionPassenger::Utils::RewindableInput)<br>
<div class="im"> tmpfile = Tempfile.open('sunstone-upload', '/mnt/sunstone_upload')<br>
</div> tmpfile.write rackinput.read<br>
tmpfile.flush<br>
else<br>
logger.error { "Unexpected rackinput class #{rackinput.class}" }<br>
logger.error(rackinput.class)<br>
return [500, ""]<br>
end<br>
<br>
@SunstoneServer.upload(params[:img], tmpfile.path)<br>
end<br>
<br>
I included logger.error(rackinput.class) like above. But I can't find<br>
the rackinput.class value. Is the above correct?<br></blockquote><div><br></div><div>Include it before the if:</div><div> logger.error(rackinput.class)<br></div><div> if (rackinput.class == Tempfile)</div><div><br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5"><br>
Gr. Stefan<br>
<br>
--<br>
| BIT BV <a href="http://www.bit.nl/" target="_blank">http://www.bit.nl/</a> Kamer van Koophandel 09090351<br>
| GPG: 0xD14839C6 <a href="tel:%2B31%20318%20648%20688" value="+31318648688">+31 318 648 688</a> / <a href="mailto:info@bit.nl">info@bit.nl</a><br>
</div></div><br>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.10 (GNU/Linux)<br>
<br>
iF4EAREIAAYFAlKYUAcACgkQTyGgYdFIOcbkjwEAl5SvTwtbCCmry69wMObQ09vo<br>
kgh9EqGgRrlfBSpFhv4A/i6LHWeKdU857PpZo2/KIoIIliyOP7Y7dqgyljrBBShi<br>
=DSa7<br>
-----END PGP SIGNATURE-----<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>--<br></div>Daniel Molina<br>Project Engineer<br>OpenNebula - Flexible Enterprise Cloud Made Simple<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:dmolina@opennebula.org" target="_blank">dmolina@opennebula.org</a> | @OpenNebula</div>
</div></div>