The thing is that the problem was on the production server, and if I want 
to replicate the problem, I will be affecting all the websites in 
production. 
I guess I will have to stay late one of these nights (when the traffic 
decreases) in order to replicate the problem.

Just to add some info (in case that someone sees something I don't), this 
was the situation that generated the problem:

A *layout.html*, an *index.html*, and a *block.html*.
The view index.html extends layout.html. 
Inside index.html there is an {{include 'block.html'}}

block.html access a database row and prints a text field of the row:

myrow = db.mytable[row_id]
{{=myrow.description.replace('\n', '')}}

The second sentence was the problematic one, in cases where 
myrow.description is None. Of course, it's expected to raise an error if 
myrow.description is None, because None has not the .replace() method.

The strange thing is that web2py doesn't raise the error, but stays hanging 
until timeout. 
The version of web2py is Version 
2.10.3-stable+timestamp.2015.04.02.21.42.07.

As I've said, I'll be staying late one of these nights to do some tests. I 
will post reslts here.



El viernes, 18 de diciembre de 2015, 5:26:09 (UTC-3), Massimo Di Pierro 
escribió:
>
> kudos for finding the solution yourself and posting the solution here.
>
> On Tuesday, 15 December 2015 11:53:35 UTC-6, Lisandro wrote:
>>
>> I've found the problem: the view rendered by the function has an 
>> {{include 'otherview.html'}} and that otherview.html had an error.
>> What is strange is that web2py never throwed 500 error :/
>>
>> In my laptop I have the exact same configuration as in the server (that 
>> is, nginx, uwsgi, same web2py version, same routes.py), and here in my 
>> laptop it does throw the 500 error. Don't know why in the server hangs 
>> until timeout.
>>
>> El martes, 15 de diciembre de 2015, 11:23:58 (UTC-3), Lisandro escribió:
>>>
>>> I'm pulling my hair off with this :P
>>>
>>> My app serves a news website. The database is in postgresql, and I'm 
>>> using redis for caching resulting views.
>>>
>>> I have a controller/function that renders the view of an article.
>>> Everything works great. In fact, I have an exact same copy of the app 
>>> running for several websites. All of them are publishing articles 
>>> correctly, no problem at all.
>>>
>>> Yesterday we installed a new website, that is, the same app. 
>>> After publishing some articles, some of them are inaccessible: the 
>>> browser just hangs until 504 gateway timeout is triggered (I'm using uwsgi 
>>> with nginx).
>>>
>>> I already tried:
>>> - flusing redis cache
>>> - using cache.ram
>>> - using no cache at all
>>> - activated LOGGING=True in my wsgihandler.py
>>>
>>>
>>> The server has a lot of available resources. Also, it's not a problem of 
>>> nginx connections or uwsgi workers, as I said, the app still renders ok all 
>>> the articles, except for some of them.
>>>
>>> I don't know where to look for more details. Nginx error log shows this:
>>> 2015/12/15 11:17:28 [error] 26865#0: *1817630 upstream timed out (110: 
>>> Connection timed out) while reading response header from upstream, client: 
>>> 24.232.71.5, server: mydomain.com.ar, request: "GET 
>>> /noticia/108/bbb-beta HTTP/1.1", upstream: 
>>> "uwsgi://unix:///tmp/medios.socket", host: "mydomain.com.ar", referrer: 
>>> "http://mydomain.com.ar/";
>>>
>>> which is ok, considering the configuration. Basically, the error says 
>>> that uwsgi didn't send a response to nginx within 60 seconds.
>>> In the uwsgi log, I don't see any errors. It seems like web2py isn't 
>>> responding with anything, but I don't know where to check what is web2py 
>>> doing.
>>>
>>> If there is a senior developer, I wouldn't mind to contact by private 
>>> and agree some price for the job. I really need to find the cause of the 
>>> problem.
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to