Re: File upload failing occasionally

2009-01-06 Thread ppdo

To Karen: yes, I meant TCP RST, sorry.

Update:

Using mod_wsgi made the problem go away for Firefox.

Limiting my research to an interaction problem between Apache and
Safari, I stumbled upon this bug report for Apache
https://bugs.webkit.org/show_bug.cgi?id=5760 that describes something
very similar to what is happening and it is apparently still open.
Reading this gave me the idea to try and disable the keepalive and,
though I need to test it more extensively, it seems the problem is
gone.

A simple:

BrowserMatch "Safari" nokeepalive

in the Apache configuration did the trick. As on the production server
this application will not have to stand much traffic anyway, it should
be ok also without keepalive.

I'll update this thread if I have more findings.

Thank you both for your ideas!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: File upload failing occasionally

2009-01-05 Thread ppdo

I tried to monitor the interface using WireShark and the communication
just hangs during a data transfer: Apache is just acknowledging the
receipt of some packets and then just seems to hang. The suspicious
bit is a fairly long series of http RST about 20ms before the server
hangs. Though I'm not knowledgeable enough on http, to me this clearly
points in the direction of an Apache problem, though I'm not sure if
and how it can be solved.

I will try the following:
1. Check whether there is a known problem in my version of Apache
(it's the Leopard standard version, so it might be old enough)
2. Reconfigure/recompile the server, to make it work in 32-bit mode

Any idea additional is welcome, of course!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: File upload failing occasionally

2009-01-05 Thread ppdo

The failure does not depend on the file size: I manage to upload files
bigger than 60 MB and fail on 30 kB files.

I tried with Safari and Firefox and I got the same results, though I
got the *impression* (but given the randomness of the problem I am not
sure this is a real observation) that it fails more often if I use the
client on the same machine as the server and less if the client runs
from a different machine. Both client and server were all OSX/Leopard.

In the Apache configuration there is no explicit timeout directive.
However, when the problem occurs the client hangs for a very long time
before reporting the error: from the server logs it takes about 5
minutes. When it succeeds the operation completes within a few
seconds, depending on the size of the file.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: File upload failing occasionally

2009-01-04 Thread ppdo

Hi,

Thanks for looking into this. I used embedded mode and the error is
the following (different message, but same place in
multipartparser.py):

IOError at /myapp/upload/2009-01-03/1
request data read error
Request Method: POST
Request URL:http://127.0.0.1/myapp/upload/2009-01-03/1
Exception Type: IOError
Exception Value:
request data read error
Exception Location: /Library/Frameworks/Python64.framework/Versions/
2.6/lib/python2.6/site-packages/django/http/multipartparser.py in
read, line 406
Python Executable:  /usr/sbin/httpd
Python Version: 2.6.1
Python Path:['/djangoapps/', '/Library/Frameworks/Python64.framework/
Versions/2.6/lib/python26.zip', '/Library/Frameworks/
Python64.framework/Versions/2.6/lib/python2.6', '/Library/Frameworks/
Python64.framework/Versions/2.6/lib/python2.6/plat-darwin', '/Library/
Frameworks/Python64.framework/Versions/2.6/lib/python2.6/plat-mac', '/
Library/Frameworks/Python64.framework/Versions/2.6/lib/python2.6/plat-
mac/lib-scriptpackages', '/Library/Frameworks/Python64.framework/
Versions/2.6/lib/python2.6/lib-tk', '/Library/Frameworks/
Python64.framework/Versions/2.6/lib/python2.6/lib-old', '/Library/
Frameworks/Python64.framework/Versions/2.6/lib/python2.6/lib-dynload',
'/Library/Frameworks/Python64.framework/Versions/2.6/lib/python2.6/
site-packages']
Server time:Mon, 5 Jan 2009 08:20:20 +0100

Environment:

Request Method: POST
Request URL: http://127.0.0.1/myapp/upload/2009-01-03/1
Django Version: 1.0.2 final
Python Version: 2.6.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'systemic.peergroup']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/core/handlers/base.py" in get_response
  86. response = callback(request, *callback_args,
**callback_kwargs)
File "/djangoapps/myapp/../myapp/application1/views.py" in upload_file
  137. form = UploadFileForm(request.POST, request.FILES)
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/core/handlers/wsgi.py" in _get_post
  169. self._load_post_and_files()
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/core/handlers/wsgi.py" in
_load_post_and_files
  135. self._post, self._files =
self.parse_file_upload(self.META, self.environ['wsgi.input'])
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/__init__.py" in parse_file_upload
  124. return parser.parse()
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in parse
  134. for item_type, meta_data, field_stream in Parser
(stream, self._boundary):
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in __iter__
  607. for sub_stream in boundarystream:
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in next
  421. return LazyStream(BoundaryIter(self._stream,
self._boundary))
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in __init__
  447. unused_char = self._stream.read(1)
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in read
  300. out = ''.join(parts())
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in parts
  293. chunk = self.next()
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in next
  315. output = self._producer.next()
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in next
  376. data = self.flo.read(self.chunk_size)
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in read
  406. return self._file.read(num_bytes)

Exception Type: IOError at /myapp/upload/2009-01-03/1
Exception Value: request data read error

I tried to switch to daemon mode but no behavioral differences:

The configuration I use in apache (basically coming from
http://code.djangoproject.com/wiki/django_apache_and_mod_wsgi) is the
following:

Alias /djadmin/ "/adminmedia/"

Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing


WSGIDaemonProcess site-1 user=auser group=agroup threads=25
WSGIProces

File upload failing occasionally

2009-01-04 Thread ppdo
multipartparser.py" in __iter__
  607. for sub_stream in boundarystream:
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in next
  421. return LazyStream(BoundaryIter(self._stream,
self._boundary))
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in __init__
  447. unused_char = self._stream.read(1)
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in read
  300. out = ''.join(parts())
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in parts
  293. chunk = self.next()
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in next
  315. output = self._producer.next()
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in next
  376. data = self.flo.read(self.chunk_size)
File "/Library/Frameworks/Python64.framework/Versions/2.6/lib/
python2.6/site-packages/django/http/multipartparser.py" in read
  406. return self._file.read(num_bytes)

Exception Type: IOError at /myapp/upload/2009-01-03/1
Exception Value: Client read error (Timeout?)

I tried to run everything using mod_wsgi and no difference.

Does anybody know what am I doing wrong?

Thanks in advance for your help!

ppdo


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---