[0.5.0] Upload issue

34 views
Skip to first unread message

CEA-SEPIA

unread,
Jun 20, 2011, 9:34:46 AM6/20/11
to UCengine
Hello,


I have an issue when I'm trying to send a file to ucengine server.

The upload are submited to /api/0.5/file/demo?
uid=UID&sid=SID&metadata[from]=mms and the corresponding return is a
502 Bad Gateway "The proxy server received an invalid response from an
upstream server".

The access log show that the request arrived at yaws at least:

log/127.0.0.1.access:127.0.0.1 - - [20/Jun/2011:14:54:08 +0200] "POST /
api/0.5/file/demo?
uid=89025136736738112173920777914035&sid=59254822166061178671050077621431&metadata[from]=mms
HTTP/1.1" 500 28 "http://127.0.0.1/encre/" "browser spec"


But the ucengine.log doesn't have any matching for the method file
add, just the 'list' action.

log/ucengine.log:DEBUG: appmod_uce:87: "127.0.0.1": call
file_controller:list matching ["demo"] with
["89025136736738112173920777914035",...

Do you have an idea of the problem ?


Thanks a lot for your answer.

François de Metz

unread,
Jun 21, 2011, 4:15:28 AM6/21/11
to ucen...@googlegroups.com
Hello,

Currently not. This is maybe an error of the proxy. Or your post request
can be malformed. Can you provide a complete testcase please ?

François

signature.asc

CEA-SEPIA

unread,
Jun 21, 2011, 5:27:39 AM6/21/11
to UCengine
The proxy give success response for all you're other REST method.

Below the request/response at all state of the connection.

This functionnality was working for me on 0.3.0.

Request made to apache server:

POST /api/0.5/file/demo?
uid=89025136736738112173920777914035&sid=58542379044191193007770527300885&metadata[from]=mms
HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.2.17) Gecko/
20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://127.0.0.1/encre/
Content-Type: multipart/form-data;
boundary=---------------------------2103240821312348760863993048
Content-Length: 256

-----------------------------2103240821312348760863993048
Content-Disposition: form-data; name="_filename";
filename="test_upload"
Content-Type: application/octet-stream

test_upload_af83


-----------------------------2103240821312348760863993048--


Request forwarded to the proxy:

POST /api/0.5/file/demo?
uid=89025136736738112173920777914035&sid=58542379044191193007770527300885&metadata[from]=mms
HTTP/1.1
Host: 127.0.0.1:5281
User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.2.17) Gecko/
20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Referer: http://127.0.0.1/encre/
Content-Type: multipart/form-data;
boundary=---------------------------2103240821312348760863993048
Via: 1.1 localhost.localdomain
X-Forwarded-For: 127.0.0.1
X-Forwarded-Host: 127.0.0.1
X-Forwarded-Server: localhost.localdomain
Connection: Keep-Alive
Content-Length: 256

-----------------------------2103240821312348760863993048
Content-Disposition: form-data; name="_filename";
filename="test_upload"
Content-Type: application/octet-stream

test_upload_af83


-----------------------------2103240821312348760863993048--


Response sended by yaws to the proxy:

HTTP/1.1 500 Internal Server Error
Server: Yaws/1.89 Yet Another Web Server
Date: Tue, 21 Jun 2011 09:19:27 GMT
Content-Length: 28
Content-Type: application/json

{"error":"unexpected_error"}

Responses forwareded by apache proxy:

HTTP/1.1 500 Internal Server Error
Date: Tue, 21 Jun 2011 09:19:27 GMT
Server: Yaws/1.89 Yet Another Web Server
Content-Length: 28
Content-Type: application/json
Via: 1.1 localhost.localdomain
Connection: close

{"error":"unexpected_error"}

Thanks a lot
>  signature.asc
> < 1 000AfficherTélécharger

François de Metz

unread,
Jun 21, 2011, 5:33:26 AM6/21/11
to ucen...@googlegroups.com
Okay, we have no more 502 Bad Gateway.

Can you try to rename the name of your file upload from _filename to
"content" please ?

Actual : > Content-Disposition: form-data; name="_filename";
Expected: > Content-Disposition: form-data; name="content"

And if it doesn't work, can you send ucengine.log ? You can send me a
private email if you want: fde...@af83.com.

François

signature.asc

CEA-SEPIA

unread,
Jun 21, 2011, 5:39:39 AM6/21/11
to UCengine
I'm getting the same result:

Browser to server:

POST /api/0.5/file/demo?
uid=89025136736738112173920777914035&sid=99624760169076272549857178282593&metadata[from]=mms
HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.2.17) Gecko/
20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://127.0.0.1/encre/
Content-Type: multipart/form-data;
boundary=---------------------------40812447514103809201326394139
Content-Length: 256

-----------------------------40812447514103809201326394139
Content-Disposition: form-data; name="content"; filename="test_upload"
Content-Type: application/octet-stream

test_upload_af83


-----------------------------40812447514103809201326394139--


Server to Proxy:

POST /api/0.5/file/demo?
uid=89025136736738112173920777914035&sid=99624760169076272549857178282593&metadata[from]=mms
HTTP/1.1
Host: 127.0.0.1:5281
User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.2.17) Gecko/
20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Referer: http://127.0.0.1/encre/
Content-Type: multipart/form-data;
boundary=---------------------------40812447514103809201326394139
Via: 1.1 localhost.localdomain
X-Forwarded-For: 127.0.0.1
X-Forwarded-Host: 127.0.0.1
X-Forwarded-Server: localhost.localdomain
Connection: Keep-Alive
Content-Length: 256

-----------------------------40812447514103809201326394139
Content-Disposition: form-data; name="content"; filename="test_upload"
Content-Type: application/octet-stream

test_upload_af83


-----------------------------40812447514103809201326394139--

Proxy To Server:

HTTP/1.1 500 Internal Server Error
Server: Yaws/1.89 Yet Another Web Server
Date: Tue, 21 Jun 2011 09:41:11 GMT
Content-Length: 28
Content-Type: application/json

{"error":"unexpected_error"}

Server To Browser:

HTTP/1.1 500 Internal Server Error
Date: Tue, 21 Jun 2011 09:41:11 GMT
Server: Yaws/1.89 Yet Another Web Server
Content-Length: 28
Content-Type: application/json
Via: 1.1 localhost.localdomain
Connection: close

{"error":"unexpected_error"}



On 21 juin, 11:33, François de Metz <franc...@2metz.fr> wrote:
> Okay, we have no more 502 Bad Gateway.
>
> Can you try to rename the name of your file upload from _filename to
> "content" please ?
>
> Actual : > Content-Disposition: form-data; name="_filename";
> Expected: > Content-Disposition: form-data; name="content"
>
> And if it doesn't work, can you send ucengine.log ? You can send me a
> private email if you want: fdem...@af83.com.
>  signature.asc
> < 1 000AfficherTélécharger

François de Metz

unread,
Jun 22, 2011, 6:13:58 AM6/22/11
to ucen...@googlegroups.com
Can you send me your ucengine.log and sasl-error.log please ?
signature.asc

SEPIA ENCRE

unread,
Jun 22, 2011, 6:46:36 AM6/22/11
to ucen...@googlegroups.com
The sasl-error.log is empty.

2011/6/22 François de Metz <fran...@2metz.fr>
ucengine.log

François de Metz

unread,
Jun 22, 2011, 6:50:11 AM6/22/11
to ucen...@googlegroups.com, SEPIA ENCRE
On 06/22/2011 12:46 PM, SEPIA ENCRE wrote:
> The sasl-error.log is empty.

=ERROR REPORT==== 22-Jun-2011::12:44:05 ===
uce_http:59: Upload error: {error,enoent}.

You must create the "data" dir. http://docs.ucengine.org/config.html#data

This should fix your issue.

François

>
> 2011/6/22 François de Metz <fran...@2metz.fr <mailto:fran...@2metz.fr>>

> > Host: 127.0.0.1:5281 <http://127.0.0.1:5281>

> <mailto:franc...@2metz.fr>> wrote:
> >> Okay, we have no more 502 Bad Gateway.
> >>
> >> Can you try to rename the name of your file upload from _filename to
> >> "content" please ?
> >>
> >> Actual : > Content-Disposition: form-data; name="_filename";
> >> Expected: > Content-Disposition: form-data; name="content"
> >>
> >> And if it doesn't work, can you send ucengine.log ? You can send me a
> >> private email if you want: fdem...@af83.com

> <mailto:fdem...@af83.com>.

> >>> Host: 127.0.0.1:5281 <http://127.0.0.1:5281>

signature.asc

CEA-SEPIA

unread,
Jun 22, 2011, 8:37:07 AM6/22/11
to UCengine
Fixed. Thanks.

On 22 juin, 12:50, François de Metz <franc...@2metz.fr> wrote:
> On 06/22/2011 12:46 PM, SEPIA ENCRE wrote:
>
> > The sasl-error.log is empty.
>
> =ERROR REPORT==== 22-Jun-2011::12:44:05 ===
> uce_http:59: Upload error: {error,enoent}.
>
> You must create the "data" dir.http://docs.ucengine.org/config.html#data
>
> This should fix your issue.
>
> François
>
>
>
> > 2011/6/22 François de Metz <franc...@2metz.fr <mailto:franc...@2metz.fr>>
>  signature.asc
> < 1 000AfficherTélécharger
Reply all
Reply to author
Forward
0 new messages