Mongrel error on read file after upload


#1

I have a java client that uploads files to a web server. The problem is
that whenever the client uploads a file, and mongrel saves it in a
temporary file (in this case, mongrel13800-0), mongrel can’t read the
file resulting in the error below.

Read error: #<Errno::EACCES: Permission denied -
/home/Jim/work/tmp/mongrel3800-0>

pastie link here: http://pastie.org/486246

i’ve resolved the problem by setting Mongrel::Const::MAX_BODY to 5MB,
but i don’t really like that solution. And I have no control over the
size of the uploads.

i’ve tried chmod and chown but it doesn’t solve the problem. any ideas?
thanks!


#2

On May 22, 10:32 am, Jim ruther Nill <rails-mailing-l…@andreas-
s.net> wrote:

I have a java client that uploads files to a web server. The problem is
that whenever the client uploads a file, and mongrel saves it in a
temporary file (in this case, mongrel13800-0), mongrel can’t read the
file resulting in the error below.

Does the java code run as a different user than your mongrel ?

Fred


#3

Frederick C. wrote:

On May 22, 10:32�am, Jim ruther Nill <rails-mailing-l…@andreas-
s.net> wrote:

Does the java code run as a different user than your mongrel ?

Fred

i’ll try asking that to the java developers. I have no control over the
java code. i’ll keep you posted. thanks!


#4

Jim ruther Nill wrote:

i’ll try asking that to the java developers. I have no control over the
java code. i’ll keep you posted. thanks!

i run the client in the same pc as the server. but it did not solve the
problem. if it helps, using webrick doesn’t produce any errors.

one other thing i’m having trouble after the file is uploaded is this
error:

CGI::Session::CookieStore::TamperedWithCookie

after the java client uploads the file to the server, before getting to
the action that will handle the saving of the file, the server sends
this error to the client. Looking at the request/response, the
session_key sent by the client is different from the session_key sent by
the server as a response. I looked around for a cause to this, and the
only answer i found is when you change the secret key in your
environment.rb file. and i haven’t done that. any clues?