Re: django 1.3 timing out on empty POST request

2011-06-28 Thread mehdi ait oufkir
Hello Roberto,

it looks like upgrading to uWSGI 0.9.8.1 solved the issue.
Thanks for your help!


On Jun 27, 9:18 pm, Roberto De Ioris  wrote:
> Il giorno 27/giu/2011, alle ore 22.07, mehdi ait oufkir ha scritto:
>
> > Roberto, I'm actually using uWSGI 0.9.6.5.
>
> > Can you tell me what is the issue with the previous version. I can
> > stop by on uwsgi IRC if you want to take the conversation off google's
> > groups.
>
> > -mehdi
>
> Versions < 0.9.8 expect a fully compliant (read: very simple) WSGI behaviour.
>
> Actually the world is a bit more complex than this so in 0.9.8 i added a more 
> "tolerant"
> wsgi.input object. (pratically it is the same technic of mod_wsgi for apache 
> with some addition)
>
> Upgrading to 0.9.8.1 can bypass the issue or eventually throw an error 
> pointing to what it is wrong
> in django code.
>
>
>
>
>
>
>
> > On Jun 26, 9:47 pm, "Roberto De Ioris"  wrote:
> >>> Roberto,
>
> >>> it is uWSGI, but can you explain a bit more what the post-buffering
> >>> would help me do?
> >>> Would it help me debug with pdb?
> >>> -mehdi
>
> >> Before starting a pretty long and boring explanation, can you double check
> >> if you are using the 0.9.8.1 version of uWSGI ? It should manage POST data
> >> in a safer way avoiding blocking calls.
>
> >> --
> >> Roberto De Iorishttp://unbit.it
>
> > --
> > 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 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> Roberto De Iorishttp://unbit.it

-- 
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: django 1.3 timing out on empty POST request

2011-06-27 Thread Roberto De Ioris

Il giorno 27/giu/2011, alle ore 22.07, mehdi ait oufkir ha scritto:

> Roberto, I'm actually using uWSGI 0.9.6.5.
> 
> Can you tell me what is the issue with the previous version. I can
> stop by on uwsgi IRC if you want to take the conversation off google's
> groups.
> 
> -mehdi


Versions < 0.9.8 expect a fully compliant (read: very simple) WSGI behaviour.

Actually the world is a bit more complex than this so in 0.9.8 i added a more 
"tolerant"
wsgi.input object. (pratically it is the same technic of mod_wsgi for apache 
with some addition)

Upgrading to 0.9.8.1 can bypass the issue or eventually throw an error pointing 
to what it is wrong
in django code. 



> 
> On Jun 26, 9:47 pm, "Roberto De Ioris"  wrote:
>>> Roberto,
>> 
>>> it is uWSGI, but can you explain a bit more what the post-buffering
>>> would help me do?
>>> Would it help me debug with pdb?
>>> -mehdi
>> 
>> Before starting a pretty long and boring explanation, can you double check
>> if you are using the 0.9.8.1 version of uWSGI ? It should manage POST data
>> in a safer way avoiding blocking calls.
>> 
>> --
>> Roberto De Iorishttp://unbit.it
> 
> -- 
> 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.
> 

--
Roberto De Ioris
http://unbit.it

-- 
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: django 1.3 timing out on empty POST request

2011-06-27 Thread mehdi ait oufkir
(not sure if my previous message went through).

Roberto,

I'm using uWSGI 0.9.6.5. Can you tell me a bit more about the issue?
and why this is happening only with 1.3.

We can take the conversation of google group if you want. I can join
the #uwsgi irc.

Please let me know,
-mehdi

On Jun 26, 9:47 pm, "Roberto De Ioris"  wrote:
> > Roberto,
>
> > it is uWSGI, but can you explain a bit more what the post-buffering
> > would help me do?
> > Would it help me debug with pdb?
> > -mehdi
>
> Before starting a pretty long and boring explanation, can you double check
> if you are using the 0.9.8.1 version of uWSGI ? It should manage POST data
> in a safer way avoiding blocking calls.
>
> --
> Roberto De Iorishttp://unbit.it

-- 
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: django 1.3 timing out on empty POST request

2011-06-27 Thread mehdi ait oufkir
Roberto, I'm actually using uWSGI 0.9.6.5.

Can you tell me what is the issue with the previous version. I can
stop by on uwsgi IRC if you want to take the conversation off google's
groups.

-mehdi

On Jun 26, 9:47 pm, "Roberto De Ioris"  wrote:
> > Roberto,
>
> > it is uWSGI, but can you explain a bit more what the post-buffering
> > would help me do?
> > Would it help me debug with pdb?
> > -mehdi
>
> Before starting a pretty long and boring explanation, can you double check
> if you are using the 0.9.8.1 version of uWSGI ? It should manage POST data
> in a safer way avoiding blocking calls.
>
> --
> Roberto De Iorishttp://unbit.it

-- 
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: django 1.3 timing out on empty POST request

2011-06-26 Thread Roberto De Ioris

> Roberto,
>
> it is uWSGI, but can you explain a bit more what the post-buffering
> would help me do?
> Would it help me debug with pdb?
> -mehdi


Before starting a pretty long and boring explanation, can you double check
if you are using the 0.9.8.1 version of uWSGI ? It should manage POST data
in a safer way avoiding blocking calls.



-- 
Roberto De Ioris
http://unbit.it

-- 
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: django 1.3 timing out on empty POST request

2011-06-26 Thread mehdi ait oufkir
Roberto,

it is uWSGI, but can you explain a bit more what the post-buffering
would help me do?
Would it help me debug with pdb?
-mehdi

On Jun 25, 11:32 am, "Roberto De Ioris"  wrote:
> > @Karen, I tried the patch, and it doesn't seem to help. Do you have
> > any ideas when is the1.3.X scheduled to be released?
>
> > @Bruno, using nginx + WSGI +DJANGOis the setup.
>
> If you mean mod_wsgi for nginx, i am not able to help you, but if you mean
> nginx + uWSGI, you will probably only need to enable post-buffering in
> uWSGI (--post-buffering 4096 will be enough).
>
> Remember to use 0.9.8.1 (latest stable) as it contains a much better
> wsgi.input implementation.
>
>
>
> --
> Roberto De Iorishttp://unbit.it

-- 
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: django 1.3 timing out on empty POST request

2011-06-25 Thread Roberto De Ioris

> @Karen, I tried the patch, and it doesn't seem to help. Do you have
> any ideas when is the 1.3.X scheduled to be released?
>
> @Bruno, using nginx + WSGI + DJANGO is the setup.

If you mean mod_wsgi for nginx, i am not able to help you, but if you mean
nginx + uWSGI, you will probably only need to enable post-buffering in
uWSGI (--post-buffering 4096 will be enough).

Remember to use 0.9.8.1 (latest stable) as it contains a much better
wsgi.input implementation.

>
-- 
Roberto De Ioris
http://unbit.it

-- 
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: django 1.3 timing out on empty POST request

2011-06-25 Thread mehdi ait oufkir
@Karen, I tried the patch, and it doesn't seem to help. Do you have
any ideas when is the 1.3.X scheduled to be released?

@Bruno, using nginx + WSGI + DJANGO is the setup.

-mehdi

On Jun 25, 8:56 am, bruno desthuilliers
 wrote:
> On Jun 25, 10:27 am, mehdi ait oufkir  wrote:
>
> > Thanks for the response Bruno.
>
> > Your comment made me think I forgot to mention that the issue only
> > happens in production when django is behind nginx.
>
> Duh...
>
> > I'm not sure how to run pdb in this context.
>
> Don't know if you can (no experience with nginx).
>
> > Any ideas where else to look?
>
> Anywhere between Django and nginx - which makes quite a few LOCs.
> What's your setup ? nginx + FCGI ?

-- 
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: django 1.3 timing out on empty POST request

2011-06-25 Thread bruno desthuilliers
On Jun 25, 10:27 am, mehdi ait oufkir  wrote:
> Thanks for the response Bruno.
>
> Your comment made me think I forgot to mention that the issue only
> happens in production when django is behind nginx.

Duh...

> I'm not sure how to run pdb in this context.

Don't know if you can (no experience with nginx).

> Any ideas where else to look?

Anywhere between Django and nginx - which makes quite a few LOCs.
What's your setup ? nginx + FCGI ?

-- 
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: django 1.3 timing out on empty POST request

2011-06-25 Thread Karen Tracey
On Sat, Jun 25, 2011 at 4:27 AM, mehdi ait oufkir wrote:

> Thanks for the response Bruno.
>
> Your comment made me think I forgot to mention that the issue only
> happens in production when django is behind nginx.
> I'm not sure how to run pdb in this context.
> Any ideas where else to look?
>

I'd first try running with current 1.3.X branch code. This ticket:

https://code.djangoproject.com/ticket/15679

sounds like it might be related, and has been fixed on the 1.3.X maintenance
branch.

Karen
-- 
http://tracey.org/kmt/

-- 
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: django 1.3 timing out on empty POST request

2011-06-25 Thread mehdi ait oufkir
Thanks for the response Bruno.

Your comment made me think I forgot to mention that the issue only
happens in production when django is behind nginx.
I'm not sure how to run pdb in this context.
Any ideas where else to look?
-mehdi

On Jun 24, 11:37 am, bruno desthuilliers
 wrote:
> On Jun 24, 7:19 pm, mehdi ait oufkir  wrote:
>
>
>
> >     def cleanup_request(request):
> >         """
> >         Removes `oauth_` keys from various dicts on the
> >         request object, and returns the sanitized version.
> >         """
> >         for method_type in ('GET', 'PUT', 'POST', 'DELETE'):
>
>               if method_type == "POST":
>                    import pdb; pdb.set_trace()
>
> >             block = getattr(request, method_type, { })
>
> Then you start the dev server, send a POST request with an empty body,
> and step thru the code until you find out  what's happening.

-- 
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: django 1.3 timing out on empty POST request

2011-06-24 Thread bruno desthuilliers
On Jun 24, 7:19 pm, mehdi ait oufkir  wrote:
>
>     def cleanup_request(request):
>         """
>         Removes `oauth_` keys from various dicts on the
>         request object, and returns the sanitized version.
>         """
>         for method_type in ('GET', 'PUT', 'POST', 'DELETE'):

  if method_type == "POST":
   import pdb; pdb.set_trace()

>             block = getattr(request, method_type, { })


Then you start the dev server, send a POST request with an empty body,
and step thru the code until you find out  what's happening.

-- 
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: django 1.3 timing out on empty POST request

2011-06-24 Thread mehdi ait oufkir
Sorry for the typo, in the previous post.
here is the full method (in comes from piston's code).

def cleanup_request(request):
"""
Removes `oauth_` keys from various dicts on the
request object, and returns the sanitized version.
"""
for method_type in ('GET', 'PUT', 'POST', 'DELETE'):

block = getattr(request, method_type, { })

if True in [ k.startswith("oauth_") for k in
block.keys() ]:
sanitized = block.copy()

for k in sanitized.keys():
if k.startswith("oauth_"):
sanitized.pop(k)

setattr(request, method_type, sanitized)

return request


The call blocks on method_type = "POST" if the request is a POST
request with an empty body.

-mehdi


On Jun 24, 12:51 am, Ivo Brodien  wrote:
> On Jun 24, 2011, at 2:40 AM, mehdi ait oufkir wrote:
>
> > block = getattr(request, POST, { })
>
> shouldn’t it be:
>
> block = getattr(request, ‘POST', { }) ?
>
> What are you trying to do? Can you post the rest of the view function?

-- 
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: django 1.3 timing out on empty POST request

2011-06-24 Thread Ivo Brodien

On Jun 24, 2011, at 2:40 AM, mehdi ait oufkir wrote:

> block = getattr(request, POST, { })


shouldn’t it be:


block = getattr(request, ‘POST', { }) ?

What are you trying to do? Can you post the rest of the view function?



-- 
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.