File uploads going haywire

All-

I attempted to do some searching in your archives regarding file
uploads and didn’t find much so hopefully I’m not treading on ground
ill-covered by this list. I’m seeing some pretty awesome errors fly
out of my application and am in need of some more experienced guidance
as to what’s going wrong.

My configuration (don’t laugh ;)) is as follows:

Oracle Application Server 10.1.x
Windows Server 2003
Java 5 EE

My rails application is running on Rack 0.9 and JRuby 1.1.2 put
together with warbler. And the problem I’m seeing affects file
uploads done with attachment_fu, though I don’t see it making it that
far in the error message:

MyApp: /!\ FAILSAFE /!\ Wed Jun 11 19:07:20 -0400 2008
Status: 500 Internal Server Error
cannot generate tempfile C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/1/ CGI2100-13': File exists - file exists: C:/DOCUME~1/ADMINI~1/LOCALS~1/ Temp/1/CGI2100-13 /tempfile.rb:39:ininitialize’
D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/
WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/request.rb:
521:in
new' D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/ WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/request.rb: 521:inread_multipart’
D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/
WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/request.rb:
517:in
loop' D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/ WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/request.rb: 517:inread_multipart’
D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/
WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/request.rb:
445:in
parse_multipart_form_parameters' D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/ WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/request.rb: 383:inparse_formatted_request_parameters’
D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/
WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/
cgi_process.rb:78:in
request_parameters' D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/ WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/request.rb: 287:inparameters’
D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/
WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/request.rb:
22:in
request_method' D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/ WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/request.rb: 35:inmethod’
D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/
WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/routing.rb:
1483:in
extract_request_environment' D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/ WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/routing.rb: 1424:inrecognize’
D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/
WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:
170:in
handle_request' D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/ WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb: 115:indispatch’
D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/
WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:
126:in
dispatch_cgi' D:/product/10.1.2/ocs/j2ee/OC4J_custom/applications/MyApp/MyApp/ WEB-INF/gems/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb: 9:indispatch’
/rack/adapter/rails.rb:37:in serve_rails' /rack/adapter/rails.rb:44:incall’
/jruby/rack/rails.rb:129:in call' /rack/handler/servlet.rb:22:incall’
/rack/builder.rb:1

This problem comes up very often in the span of an hour, and I’ve not
seen any method to reproduce the error faithfully through subsequent
requests. I originally thought that files which have the same name or
content were hashed into the same file on the system, but most
recently have found that files which I know have never been uploaded
to the system will also cause this “name collision” error as well. On
the surface, as a user, it happens for no apparent reason.

So my questions right now are … is this a Rack issue? Is the
application server writing the tempfile? Is Rack writing the tempfile
using data from the AS which isn’t being “updated” often by the AS?
Is there anything I can do to force the issue and make it work?

Thanks in advance.

-J.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Joshua D. wrote:

MyApp: /!\ FAILSAFE /!\ Wed Jun 11 19:07:20 -0400 2008
Status: 500 Internal Server Error
cannot generate tempfile
C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/1/CGI2100-13': File exists - file exists: C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/1/CGI2100-13 /tempfile.rb:39:ininitialize’

Well this looks pretty simple…seems like the directory listed just
isn’t accessible. You might try setting an environment variable pointing
TEMP to some other directory. My guess is that Oracle AS is not running
as Administrator, but is trying to use your Administrator’s home dir
temp dir.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Charles-

Thanks for the reply to this. The directory is owned by Administrator
and (I have been informed) the server is being run by Local System.
I’m not a Windows guy but the Windows guys seem to think this isn’t a
problem, as running as Local System is essentially running with
Administrator privileges.

Frankly, I haven’t seen any reports of the error–past what I’ve seen
after rolling out the code. It’s not enduring heavy use right now, so
I’ll just keep an eye on it and see what happens. If the problem
continues to arise and we find a solution to it, I’ll check back in
with an update. :wink:

Thanks again.

-J.

On Jun 14, 2008, at 2:22 PM, Charles Oliver N. wrote:

pointing TEMP to some other directory. My guess is that Oracle AS is


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email