Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Phyo Arkar
Cool thanks alot  i will look into it too .

Try nginx or cherokee as http server then scgi. We using that type of
configuration in production with at least 180K json requests a
day and very complex business logic with high concurrency.
scgi is not much tunable but is really simple: on a machine like yours
will do good.
I wrote a slice here for a standard preforking scgi setup:
http://www.web2pyslices.com/slices/take_slice/143

On Thu, Sep 29, 2011 at 5:13 AM, Phyo Arkar wrote:

> I really hate apache i will never use it.
>
> So if i am going to change underlying web engine i want something that
> support long polling with concurrency , how about tornado web ? would it be
> good
>
>
> On Thu, Sep 29, 2011 at 4:59 AM, Michele Comitini <
> michele.comit...@gmail.com> wrote:
>
>> I wrote:
>> > uwsgi uses many different models.  Using uwsgi a mix of event +
>> > prefork could give a big boost, but if you care about performance
>> > avoid apache.
>> >
>>
>> I should have been:
>> uwsgi uses many different models.  Using uwsgi a mix of event +
>> prefork could give a big boost -->and<-- if you care about performance
>> avoid apache. I.e. use nginx or cherokee or lighttpd
>>
>
>


Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Phyo Arkar
I really hate apache i will never use it.

So if i am going to change underlying web engine i want something that
support long polling with concurrency , how about tornado web ? would it be
good

On Thu, Sep 29, 2011 at 4:59 AM, Michele Comitini <
michele.comit...@gmail.com> wrote:

> I wrote:
> > uwsgi uses many different models.  Using uwsgi a mix of event +
> > prefork could give a big boost, but if you care about performance
> > avoid apache.
> >
>
> I should have been:
> uwsgi uses many different models.  Using uwsgi a mix of event +
> prefork could give a big boost -->and<-- if you care about performance
> avoid apache. I.e. use nginx or cherokee or lighttpd
>


Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Michele Comitini
I wrote:
> uwsgi uses many different models.  Using uwsgi a mix of event +
> prefork could give a big boost, but if you care about performance
> avoid apache.
>

I should have been:
uwsgi uses many different models.  Using uwsgi a mix of event +
prefork could give a big boost -->and<-- if you care about performance
avoid apache. I.e. use nginx or cherokee or lighttpd


Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Michele Comitini
Ok so your machine really behaves concurrently it could be that you
stumbled in some threading problem, probably at db driver level,
I am quite confident about rocket, so the next questions are ;-)
 do you use a database?
 which database?

mod_wsgi is not so bad it is difficult to tune IMHO and does not scale
because of apache.
uwsgi uses many different models.  Using uwsgi a mix of event +
prefork could give a big boost, but if you care about performance
avoid apache.

Try nginx or cherokee as http server then scgi. We using that type of
configuration in production with at least 180K json requests a
day and very complex business logic with high concurrency.
scgi is not much tunable but is really simple: on a machine like yours
will do good.
I wrote a slice here for a standard preforking scgi setup:
http://www.web2pyslices.com/slices/take_slice/143


mic


2011/9/28 Phyo Arkar :
> Server machine is 32 cores 64 GB RAM :)
>
> WSGI limitation is bad at concurrency right? I am thinking to move to more
> Concurrent setup. Coz version 1 of this software gonna use Qooxdoo for UI
> and there will be a lot more concurrency.
>
> What are the advantages of uwsgi can use uevent right?
>
> On Thu, Sep 29, 2011 at 12:40 AM, Michele Comitini
>  wrote:
>>
>> Can you try with a setup without rocket?  I.e. scgi or uwsgi or fastcgi.
>> Is the server machine multicore?
>>
>> mic
>>
>> Il giorno 28/set/2011 18:48, "Phyo Arkar"  ha
>> scritto:
>> > Happened once again
>> >
>> > THis time 1st json request went ok and another request failed like it
>> > did before.
>> >
>> > On 9/28/11, Phyo Arkar  wrote:
>> >> Yeah i love screen coz i can search back easily and interactively debug
>> >> infos.
>> >>
>> >> Yes its doing concurrent , the problem happen again yesterday but just
>> >> for once , and gone away again.
>> >>
>> >> Theres 2 Grid (jqGrid) in one page , they request 2 json response from
>> >> that controller but from different function at Once.
>> >>
>> >> On 9/28/11, Michele Comitini  wrote:
>> >>> No way is not bad practice IMHO screen is a great tool.
>> >>> So we can exclude the problem of stdout buffer full.
>> >>> Seems something low level.
>> >>>
>> >>> Is the client doing concurrent queries?
>> >>>
>> >>> mic
>> >>>
>> >>>
>> >>>
>> >>> 2011/9/27 Phyo Arkar :
>>  Web2py is ran inside screen. coz my app is  not production-stable yet
>>  and want to debug. I print out some debug messages and can track back
>>  inside screen (i know i know , its bad practice :D)
>> 
>>  may be coz of that?
>> 
>>  On 9/27/11, Michele Comitini  wrote:
>> > I would begin to remove possible environmental causes... ;)
>> > Other questions:
>> > 4) Do you run web2py.py  attached to a tty?
>> > 5) Do you redirect standard output from web2py or leave it on the
>> > tty?
>> >
>> > The questions are because I see some print statements that could
>> > hang
>> > IO on a thread if the web2py process is not properly detached from
>> > the
>> > terminal.
>> > If that is the case use nohup and try to see what happens.
>> >
>> > wrong:
>> > $ python web2py.py  &
>> >
>> > right:
>> > $ nohup python web2py.py  &
>> >
>> > If nothing changes... well... other questions!
>> >
>> >
>> > mic
>> >
>> > 2011/9/27 Phyo Arkar :
>> >> It cannot be reproduced ..
>> >>
>> >> On 9/27/11, Phyo Arkar  wrote:
>> >>> its not the same warning notices , client recieves 0 byte and
>> >>> timed
>> >>> out at brower side looking at firebug.
>> >>>
>> >>> On 9/27/11, Massimo Di Pierro  wrote:
>>  Other than the error, do you see wrong behavior from the browser?
>>  I do not not believe that there is anything wrong as we ship the
>>  "official" rocket. We are just printing an exception that before
>>  was
>>  being ignored.
>> 
>>  Massimo
>> 
>>  On Sep 26, 2:47 pm, Phyo Arkar  wrote:
>> > Hello Web2py.
>> >
>> >  Rocket server was very  well stable for me until today , after
>> > 2
>> > weeks of update and while testing usual Json output which was
>> > never
>> > changed and working fine fore 8 months.
>> >
>> > This happens!
>> >
>> > ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving
>> > connection:
>> > Traceback (most recent call last):
>> >
>> >   File "/root/web2py/gluon/rocket.py", line 1064, in run
>> >     self.run_app(conn)
>> >
>> >   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
>> >     self.write(data, sections)
>> >
>> >   File "/root/web2py/gluon/rocket.py", line 1472, in write
>> >     self.send_headers(data, sections)
>> >
>> >   File "/root/web2py/gluon/rocket.py", line 1456, in
>> > send_headers
>> >

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Phyo Arkar
Server machine is 32 cores 64 GB RAM :)

WSGI limitation is bad at concurrency right? I am thinking to move to more
Concurrent setup. Coz version 1 of this software gonna use Qooxdoo for UI
and there will be a lot more concurrency.

What are the advantages of uwsgi can use uevent right?

On Thu, Sep 29, 2011 at 12:40 AM, Michele Comitini <
michele.comit...@gmail.com> wrote:

> Can you try with a setup without rocket?  I.e. scgi or uwsgi or fastcgi.
> Is the server machine multicore?
>
> mic
>  Il giorno 28/set/2011 18:48, "Phyo Arkar"  ha
> scritto:
>
> > Happened once again
> >
> > THis time 1st json request went ok and another request failed like it
> > did before.
> >
> > On 9/28/11, Phyo Arkar  wrote:
> >> Yeah i love screen coz i can search back easily and interactively debug
> >> infos.
> >>
> >> Yes its doing concurrent , the problem happen again yesterday but just
> >> for once , and gone away again.
> >>
> >> Theres 2 Grid (jqGrid) in one page , they request 2 json response from
> >> that controller but from different function at Once.
> >>
> >> On 9/28/11, Michele Comitini  wrote:
> >>> No way is not bad practice IMHO screen is a great tool.
> >>> So we can exclude the problem of stdout buffer full.
> >>> Seems something low level.
> >>>
> >>> Is the client doing concurrent queries?
> >>>
> >>> mic
> >>>
> >>>
> >>>
> >>> 2011/9/27 Phyo Arkar :
>  Web2py is ran inside screen. coz my app is  not production-stable yet
>  and want to debug. I print out some debug messages and can track back
>  inside screen (i know i know , its bad practice :D)
> 
>  may be coz of that?
> 
>  On 9/27/11, Michele Comitini  wrote:
> > I would begin to remove possible environmental causes... ;)
> > Other questions:
> > 4) Do you run web2py.py  attached to a tty?
> > 5) Do you redirect standard output from web2py or leave it on the
> tty?
> >
> > The questions are because I see some print statements that could hang
> > IO on a thread if the web2py process is not properly detached from
> the
> > terminal.
> > If that is the case use nohup and try to see what happens.
> >
> > wrong:
> > $ python web2py.py  &
> >
> > right:
> > $ nohup python web2py.py  &
> >
> > If nothing changes... well... other questions!
> >
> >
> > mic
> >
> > 2011/9/27 Phyo Arkar :
> >> It cannot be reproduced ..
> >>
> >> On 9/27/11, Phyo Arkar  wrote:
> >>> its not the same warning notices , client recieves 0 byte and timed
> >>> out at brower side looking at firebug.
> >>>
> >>> On 9/27/11, Massimo Di Pierro  wrote:
>  Other than the error, do you see wrong behavior from the browser?
>  I do not not believe that there is anything wrong as we ship the
>  "official" rocket. We are just printing an exception that before
> was
>  being ignored.
> 
>  Massimo
> 
>  On Sep 26, 2:47 pm, Phyo Arkar  wrote:
> > Hello Web2py.
> >
> >  Rocket server was very  well stable for me until today , after 2
> > weeks of update and while testing usual Json output which was
> never
> > changed and working fine fore 8 months.
> >
> > This happens!
> >
> > ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving
> > connection:
> > Traceback (most recent call last):
> >
> >   File "/root/web2py/gluon/rocket.py", line 1064, in run
> > self.run_app(conn)
> >
> >   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
> > self.write(data, sections)
> >
> >   File "/root/web2py/gluon/rocket.py", line 1472, in write
> > self.send_headers(data, sections)
> >
> >   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
> > self.conn.sendall(b(header_data))
> >
> >   File "/usr/lib/python2.7/socket.py", line 224, in meth
> > return getattr(self._sock,name)(*args)
> >
> > error: [Errno 32] Broken pipe
> >
> > and it is on and off randomly.
> >
> > Why?
> >
> > heres my Json Controller :
> >
> > def rows():
> >
> > if REQUEST.vars.db_name:
> > casesdb = DAL( 'mysql://root@localhost/' +
> > REQUEST.vars.db_name )
> > casesdb.define_table( 'email_data', migrate =
> > False,
> > *email_halfschema )
> > casesdb.define_table( 'loosefile_data', migrate =
> > False,
> > *file_halfschema )
> > casesdb.define_table( 'attach_data', migrate =
> > False,
> > *file_halfschema )
> > elif SESSION.db_name:
> > casesdb = DAL( 'mysql://root@localhost/' +
> >>>

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Michele Comitini
Can you try with a setup without rocket?  I.e. scgi or uwsgi or fastcgi.
Is the server machine multicore?

mic
 Il giorno 28/set/2011 18:48, "Phyo Arkar"  ha
scritto:
> Happened once again
>
> THis time 1st json request went ok and another request failed like it
> did before.
>
> On 9/28/11, Phyo Arkar  wrote:
>> Yeah i love screen coz i can search back easily and interactively debug
>> infos.
>>
>> Yes its doing concurrent , the problem happen again yesterday but just
>> for once , and gone away again.
>>
>> Theres 2 Grid (jqGrid) in one page , they request 2 json response from
>> that controller but from different function at Once.
>>
>> On 9/28/11, Michele Comitini  wrote:
>>> No way is not bad practice IMHO screen is a great tool.
>>> So we can exclude the problem of stdout buffer full.
>>> Seems something low level.
>>>
>>> Is the client doing concurrent queries?
>>>
>>> mic
>>>
>>>
>>>
>>> 2011/9/27 Phyo Arkar :
 Web2py is ran inside screen. coz my app is  not production-stable yet
 and want to debug. I print out some debug messages and can track back
 inside screen (i know i know , its bad practice :D)

 may be coz of that?

 On 9/27/11, Michele Comitini  wrote:
> I would begin to remove possible environmental causes... ;)
> Other questions:
> 4) Do you run web2py.py  attached to a tty?
> 5) Do you redirect standard output from web2py or leave it on the tty?
>
> The questions are because I see some print statements that could hang
> IO on a thread if the web2py process is not properly detached from the
> terminal.
> If that is the case use nohup and try to see what happens.
>
> wrong:
> $ python web2py.py  &
>
> right:
> $ nohup python web2py.py  &
>
> If nothing changes... well... other questions!
>
>
> mic
>
> 2011/9/27 Phyo Arkar :
>> It cannot be reproduced ..
>>
>> On 9/27/11, Phyo Arkar  wrote:
>>> its not the same warning notices , client recieves 0 byte and timed
>>> out at brower side looking at firebug.
>>>
>>> On 9/27/11, Massimo Di Pierro  wrote:
 Other than the error, do you see wrong behavior from the browser?
 I do not not believe that there is anything wrong as we ship the
 "official" rocket. We are just printing an exception that before
was
 being ignored.

 Massimo

 On Sep 26, 2:47 pm, Phyo Arkar  wrote:
> Hello Web2py.
>
>  Rocket server was very  well stable for me until today , after 2
> weeks of update and while testing usual Json output which was
never
> changed and working fine fore 8 months.
>
> This happens!
>
> ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving
> connection:
> Traceback (most recent call last):
>
>   File "/root/web2py/gluon/rocket.py", line 1064, in run
> self.run_app(conn)
>
>   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
> self.write(data, sections)
>
>   File "/root/web2py/gluon/rocket.py", line 1472, in write
> self.send_headers(data, sections)
>
>   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
> self.conn.sendall(b(header_data))
>
>   File "/usr/lib/python2.7/socket.py", line 224, in meth
> return getattr(self._sock,name)(*args)
>
> error: [Errno 32] Broken pipe
>
> and it is on and off randomly.
>
> Why?
>
> heres my Json Controller :
>
> def rows():
>
> if REQUEST.vars.db_name:
> casesdb = DAL( 'mysql://root@localhost/' +
> REQUEST.vars.db_name )
> casesdb.define_table( 'email_data', migrate =
> False,
> *email_halfschema )
> casesdb.define_table( 'loosefile_data', migrate =
> False,
> *file_halfschema )
> casesdb.define_table( 'attach_data', migrate =
> False,
> *file_halfschema )
> elif SESSION.db_name:
> casesdb = DAL( 'mysql://root@localhost/' +
> SESSION.db_name
> )
> casesdb.define_table( 'email_data', migrate =
> False,
> *email_halfschema )
> casesdb.define_table( 'loosefile_data', migrate =
> False,
> *file_halfschema )
> casesdb.define_table( 'attach_data', migrate =
> False,
> *file_halfschema )
>
> fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
>  'emailFrom', 'subject', 'cc', 'bcc',
> 'extracted',
> 'hdrs',\
>
>
>
'DateTime','OriginalDate

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Phyo Arkar
Happened once again

THis time 1st json request went ok and another request failed like it
did before.

On 9/28/11, Phyo Arkar  wrote:
> Yeah i love screen coz i can search back easily and interactively debug
> infos.
>
> Yes its doing concurrent , the problem happen again yesterday but just
> for once , and gone away again.
>
> Theres 2 Grid (jqGrid) in one page , they request 2 json response from
> that controller but from different function at Once.
>
> On 9/28/11, Michele Comitini  wrote:
>> No way is not bad practice IMHO screen is a great tool.
>> So we can exclude the problem of stdout buffer full.
>> Seems something low level.
>>
>> Is the client doing concurrent queries?
>>
>> mic
>>
>>
>>
>> 2011/9/27 Phyo Arkar :
>>> Web2py is ran inside screen. coz my app is  not production-stable yet
>>> and want to debug. I print out some debug messages and can track back
>>> inside screen (i know i know , its bad practice :D)
>>>
>>> may be coz of that?
>>>
>>> On 9/27/11, Michele Comitini  wrote:
 I would begin to remove possible environmental causes... ;)
 Other questions:
 4) Do you run web2py.py  attached to a tty?
 5) Do you redirect standard output from web2py or leave it on the tty?

 The questions are because I see some print statements that could hang
 IO on a thread if the web2py process is not properly detached from the
 terminal.
 If that is the case use nohup and try to see what happens.

 wrong:
 $ python web2py.py  &

 right:
 $ nohup python web2py.py  &

 If nothing changes... well... other questions!


 mic

 2011/9/27 Phyo Arkar :
> It cannot be reproduced ..
>
> On 9/27/11, Phyo Arkar  wrote:
>> its not the same warning notices , client recieves 0 byte and timed
>> out at brower side looking at firebug.
>>
>> On 9/27/11, Massimo Di Pierro  wrote:
>>> Other than the error, do you see wrong behavior from the browser?
>>> I do not not believe that there is anything wrong as we ship the
>>> "official" rocket. We are just printing an exception that before was
>>> being ignored.
>>>
>>> Massimo
>>>
>>> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
 Hello Web2py.

  Rocket server was very  well stable for me until today , after 2
 weeks of update and while testing usual Json output which was never
 changed and working fine fore 8 months.

 This happens!

 ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving
 connection:
 Traceback (most recent call last):

   File "/root/web2py/gluon/rocket.py", line 1064, in run
     self.run_app(conn)

   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
     self.write(data, sections)

   File "/root/web2py/gluon/rocket.py", line 1472, in write
     self.send_headers(data, sections)

   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
     self.conn.sendall(b(header_data))

   File "/usr/lib/python2.7/socket.py", line 224, in meth
     return getattr(self._sock,name)(*args)

 error: [Errno 32] Broken pipe

 and it is on and off randomly.

 Why?

 heres my Json Controller :

 def rows():

         if REQUEST.vars.db_name:
                 casesdb = DAL( 'mysql://root@localhost/' +
 REQUEST.vars.db_name )
                 casesdb.define_table( 'email_data', migrate =
 False,
 *email_halfschema )
                 casesdb.define_table( 'loosefile_data', migrate =
 False,
 *file_halfschema )
                 casesdb.define_table( 'attach_data', migrate =
 False,
 *file_halfschema )
         elif SESSION.db_name:
                 casesdb = DAL( 'mysql://root@localhost/' +
 SESSION.db_name
 )
                 casesdb.define_table( 'email_data', migrate =
 False,
 *email_halfschema )
                 casesdb.define_table( 'loosefile_data', migrate =
 False,
 *file_halfschema )
                 casesdb.define_table( 'attach_data', migrate =
 False,
 *file_halfschema )

         fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
                          'emailFrom', 'subject', 'cc', 'bcc',
 'extracted',
 'hdrs',\


 'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
 MD5Hash','msgID','fqdn']
         rows = []
         page = int( request.vars.page )

         max = request.vars.totalrows
         if max:
                 pagesize = int( max )
         else:

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Phyo Arkar
Yeah i love screen coz i can search back easily and interactively debug infos.

Yes its doing concurrent , the problem happen again yesterday but just
for once , and gone away again.

Theres 2 Grid (jqGrid) in one page , they request 2 json response from
that controller but from different function at Once.

On 9/28/11, Michele Comitini  wrote:
> No way is not bad practice IMHO screen is a great tool.
> So we can exclude the problem of stdout buffer full.
> Seems something low level.
>
> Is the client doing concurrent queries?
>
> mic
>
>
>
> 2011/9/27 Phyo Arkar :
>> Web2py is ran inside screen. coz my app is  not production-stable yet
>> and want to debug. I print out some debug messages and can track back
>> inside screen (i know i know , its bad practice :D)
>>
>> may be coz of that?
>>
>> On 9/27/11, Michele Comitini  wrote:
>>> I would begin to remove possible environmental causes... ;)
>>> Other questions:
>>> 4) Do you run web2py.py  attached to a tty?
>>> 5) Do you redirect standard output from web2py or leave it on the tty?
>>>
>>> The questions are because I see some print statements that could hang
>>> IO on a thread if the web2py process is not properly detached from the
>>> terminal.
>>> If that is the case use nohup and try to see what happens.
>>>
>>> wrong:
>>> $ python web2py.py  &
>>>
>>> right:
>>> $ nohup python web2py.py  &
>>>
>>> If nothing changes... well... other questions!
>>>
>>>
>>> mic
>>>
>>> 2011/9/27 Phyo Arkar :
 It cannot be reproduced ..

 On 9/27/11, Phyo Arkar  wrote:
> its not the same warning notices , client recieves 0 byte and timed
> out at brower side looking at firebug.
>
> On 9/27/11, Massimo Di Pierro  wrote:
>> Other than the error, do you see wrong behavior from the browser?
>> I do not not believe that there is anything wrong as we ship the
>> "official" rocket. We are just printing an exception that before was
>> being ignored.
>>
>> Massimo
>>
>> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
>>> Hello Web2py.
>>>
>>>  Rocket server was very  well stable for me until today , after 2
>>> weeks of update and while testing usual Json output which was never
>>> changed and working fine fore 8 months.
>>>
>>> This happens!
>>>
>>> ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving connection:
>>> Traceback (most recent call last):
>>>
>>>   File "/root/web2py/gluon/rocket.py", line 1064, in run
>>>     self.run_app(conn)
>>>
>>>   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
>>>     self.write(data, sections)
>>>
>>>   File "/root/web2py/gluon/rocket.py", line 1472, in write
>>>     self.send_headers(data, sections)
>>>
>>>   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
>>>     self.conn.sendall(b(header_data))
>>>
>>>   File "/usr/lib/python2.7/socket.py", line 224, in meth
>>>     return getattr(self._sock,name)(*args)
>>>
>>> error: [Errno 32] Broken pipe
>>>
>>> and it is on and off randomly.
>>>
>>> Why?
>>>
>>> heres my Json Controller :
>>>
>>> def rows():
>>>
>>>         if REQUEST.vars.db_name:
>>>                 casesdb = DAL( 'mysql://root@localhost/' +
>>> REQUEST.vars.db_name )
>>>                 casesdb.define_table( 'email_data', migrate = False,
>>> *email_halfschema )
>>>                 casesdb.define_table( 'loosefile_data', migrate =
>>> False,
>>> *file_halfschema )
>>>                 casesdb.define_table( 'attach_data', migrate = False,
>>> *file_halfschema )
>>>         elif SESSION.db_name:
>>>                 casesdb = DAL( 'mysql://root@localhost/' +
>>> SESSION.db_name
>>> )
>>>                 casesdb.define_table( 'email_data', migrate = False,
>>> *email_halfschema )
>>>                 casesdb.define_table( 'loosefile_data', migrate =
>>> False,
>>> *file_halfschema )
>>>                 casesdb.define_table( 'attach_data', migrate = False,
>>> *file_halfschema )
>>>
>>>         fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
>>>                          'emailFrom', 'subject', 'cc', 'bcc',
>>> 'extracted',
>>> 'hdrs',\
>>>
>>>
>>> 'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
>>> MD5Hash','msgID','fqdn']
>>>         rows = []
>>>         page = int( request.vars.page )
>>>
>>>         max = request.vars.totalrows
>>>         if max:
>>>                 pagesize = int( max )
>>>         else:
>>>                 pagesize = int( request.vars.rows )
>>>         print pagesize
>>>         limitby = ( page * pagesize - pagesize, page * pagesize )
>>> #       limitby = ( 1, 25 )
>>>         print "str( page * pagesize - pagesize )" + str( page *
>>> pagesize
>>> -
>>> pagesize ) + " li

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-27 Thread Michele Comitini
No way is not bad practice IMHO screen is a great tool.
So we can exclude the problem of stdout buffer full.
Seems something low level.

Is the client doing concurrent queries?

mic



2011/9/27 Phyo Arkar :
> Web2py is ran inside screen. coz my app is  not production-stable yet
> and want to debug. I print out some debug messages and can track back
> inside screen (i know i know , its bad practice :D)
>
> may be coz of that?
>
> On 9/27/11, Michele Comitini  wrote:
>> I would begin to remove possible environmental causes... ;)
>> Other questions:
>> 4) Do you run web2py.py  attached to a tty?
>> 5) Do you redirect standard output from web2py or leave it on the tty?
>>
>> The questions are because I see some print statements that could hang
>> IO on a thread if the web2py process is not properly detached from the
>> terminal.
>> If that is the case use nohup and try to see what happens.
>>
>> wrong:
>> $ python web2py.py  &
>>
>> right:
>> $ nohup python web2py.py  &
>>
>> If nothing changes... well... other questions!
>>
>>
>> mic
>>
>> 2011/9/27 Phyo Arkar :
>>> It cannot be reproduced ..
>>>
>>> On 9/27/11, Phyo Arkar  wrote:
 its not the same warning notices , client recieves 0 byte and timed
 out at brower side looking at firebug.

 On 9/27/11, Massimo Di Pierro  wrote:
> Other than the error, do you see wrong behavior from the browser?
> I do not not believe that there is anything wrong as we ship the
> "official" rocket. We are just printing an exception that before was
> being ignored.
>
> Massimo
>
> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
>> Hello Web2py.
>>
>>  Rocket server was very  well stable for me until today , after 2
>> weeks of update and while testing usual Json output which was never
>> changed and working fine fore 8 months.
>>
>> This happens!
>>
>> ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving connection:
>> Traceback (most recent call last):
>>
>>   File "/root/web2py/gluon/rocket.py", line 1064, in run
>>     self.run_app(conn)
>>
>>   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
>>     self.write(data, sections)
>>
>>   File "/root/web2py/gluon/rocket.py", line 1472, in write
>>     self.send_headers(data, sections)
>>
>>   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
>>     self.conn.sendall(b(header_data))
>>
>>   File "/usr/lib/python2.7/socket.py", line 224, in meth
>>     return getattr(self._sock,name)(*args)
>>
>> error: [Errno 32] Broken pipe
>>
>> and it is on and off randomly.
>>
>> Why?
>>
>> heres my Json Controller :
>>
>> def rows():
>>
>>         if REQUEST.vars.db_name:
>>                 casesdb = DAL( 'mysql://root@localhost/' +
>> REQUEST.vars.db_name )
>>                 casesdb.define_table( 'email_data', migrate = False,
>> *email_halfschema )
>>                 casesdb.define_table( 'loosefile_data', migrate =
>> False,
>> *file_halfschema )
>>                 casesdb.define_table( 'attach_data', migrate = False,
>> *file_halfschema )
>>         elif SESSION.db_name:
>>                 casesdb = DAL( 'mysql://root@localhost/' +
>> SESSION.db_name
>> )
>>                 casesdb.define_table( 'email_data', migrate = False,
>> *email_halfschema )
>>                 casesdb.define_table( 'loosefile_data', migrate =
>> False,
>> *file_halfschema )
>>                 casesdb.define_table( 'attach_data', migrate = False,
>> *file_halfschema )
>>
>>         fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
>>                          'emailFrom', 'subject', 'cc', 'bcc',
>> 'extracted',
>> 'hdrs',\
>>
>>
>> 'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
>> MD5Hash','msgID','fqdn']
>>         rows = []
>>         page = int( request.vars.page )
>>
>>         max = request.vars.totalrows
>>         if max:
>>                 pagesize = int( max )
>>         else:
>>                 pagesize = int( request.vars.rows )
>>         print pagesize
>>         limitby = ( page * pagesize - pagesize, page * pagesize )
>> #       limitby = ( 1, 25 )
>>         print "str( page * pagesize - pagesize )" + str( page *
>> pagesize
>> -
>> pagesize ) + " limitby " + str( page * pagesize )
>> #       orderby = request.vars.sidx
>>         orderby = casesdb.email_data[request.vars.sidx]
>>         print orderby
>>         if request.vars.sord == 'desc':
>>                 orderby = ~orderby
>>
>>         query = casesdb.email_data.id > 0
>>
>>         for r in casesdb( query ).select( orderby = orderby, limitby =
>> limitby ):
>>                 vals = []
>>                 for f in fields:

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-27 Thread Phyo Arkar
Web2py is ran inside screen. coz my app is  not production-stable yet
and want to debug. I print out some debug messages and can track back
inside screen (i know i know , its bad practice :D)

may be coz of that?

On 9/27/11, Michele Comitini  wrote:
> I would begin to remove possible environmental causes... ;)
> Other questions:
> 4) Do you run web2py.py  attached to a tty?
> 5) Do you redirect standard output from web2py or leave it on the tty?
>
> The questions are because I see some print statements that could hang
> IO on a thread if the web2py process is not properly detached from the
> terminal.
> If that is the case use nohup and try to see what happens.
>
> wrong:
> $ python web2py.py  &
>
> right:
> $ nohup python web2py.py  &
>
> If nothing changes... well... other questions!
>
>
> mic
>
> 2011/9/27 Phyo Arkar :
>> It cannot be reproduced ..
>>
>> On 9/27/11, Phyo Arkar  wrote:
>>> its not the same warning notices , client recieves 0 byte and timed
>>> out at brower side looking at firebug.
>>>
>>> On 9/27/11, Massimo Di Pierro  wrote:
 Other than the error, do you see wrong behavior from the browser?
 I do not not believe that there is anything wrong as we ship the
 "official" rocket. We are just printing an exception that before was
 being ignored.

 Massimo

 On Sep 26, 2:47 pm, Phyo Arkar  wrote:
> Hello Web2py.
>
>  Rocket server was very  well stable for me until today , after 2
> weeks of update and while testing usual Json output which was never
> changed and working fine fore 8 months.
>
> This happens!
>
> ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving connection:
> Traceback (most recent call last):
>
>   File "/root/web2py/gluon/rocket.py", line 1064, in run
>     self.run_app(conn)
>
>   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
>     self.write(data, sections)
>
>   File "/root/web2py/gluon/rocket.py", line 1472, in write
>     self.send_headers(data, sections)
>
>   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
>     self.conn.sendall(b(header_data))
>
>   File "/usr/lib/python2.7/socket.py", line 224, in meth
>     return getattr(self._sock,name)(*args)
>
> error: [Errno 32] Broken pipe
>
> and it is on and off randomly.
>
> Why?
>
> heres my Json Controller :
>
> def rows():
>
>         if REQUEST.vars.db_name:
>                 casesdb = DAL( 'mysql://root@localhost/' +
> REQUEST.vars.db_name )
>                 casesdb.define_table( 'email_data', migrate = False,
> *email_halfschema )
>                 casesdb.define_table( 'loosefile_data', migrate =
> False,
> *file_halfschema )
>                 casesdb.define_table( 'attach_data', migrate = False,
> *file_halfschema )
>         elif SESSION.db_name:
>                 casesdb = DAL( 'mysql://root@localhost/' +
> SESSION.db_name
> )
>                 casesdb.define_table( 'email_data', migrate = False,
> *email_halfschema )
>                 casesdb.define_table( 'loosefile_data', migrate =
> False,
> *file_halfschema )
>                 casesdb.define_table( 'attach_data', migrate = False,
> *file_halfschema )
>
>         fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
>                          'emailFrom', 'subject', 'cc', 'bcc',
> 'extracted',
> 'hdrs',\
>
>
> 'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
> MD5Hash','msgID','fqdn']
>         rows = []
>         page = int( request.vars.page )
>
>         max = request.vars.totalrows
>         if max:
>                 pagesize = int( max )
>         else:
>                 pagesize = int( request.vars.rows )
>         print pagesize
>         limitby = ( page * pagesize - pagesize, page * pagesize )
> #       limitby = ( 1, 25 )
>         print "str( page * pagesize - pagesize )" + str( page *
> pagesize
> -
> pagesize ) + " limitby " + str( page * pagesize )
> #       orderby = request.vars.sidx
>         orderby = casesdb.email_data[request.vars.sidx]
>         print orderby
>         if request.vars.sord == 'desc':
>                 orderby = ~orderby
>
>         query = casesdb.email_data.id > 0
>
>         for r in casesdb( query ).select( orderby = orderby, limitby =
> limitby ):
>                 vals = []
>                 for f in fields:
>                         if f == 'extracted':
>                                 vals.append( _sentisize(r[f]) )
>                         else :
>                                 vals.append( r[f] )
>                 rows.append( dict( id = r.id, cell = vals ) )
>
>         total = casesdb( query ).count()
>       

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-27 Thread Michele Comitini
I would begin to remove possible environmental causes... ;)
Other questions:
4) Do you run web2py.py  attached to a tty?
5) Do you redirect standard output from web2py or leave it on the tty?

The questions are because I see some print statements that could hang
IO on a thread if the web2py process is not properly detached from the
terminal.
If that is the case use nohup and try to see what happens.

wrong:
$ python web2py.py  &

right:
$ nohup python web2py.py  &

If nothing changes... well... other questions!


mic

2011/9/27 Phyo Arkar :
> It cannot be reproduced ..
>
> On 9/27/11, Phyo Arkar  wrote:
>> its not the same warning notices , client recieves 0 byte and timed
>> out at brower side looking at firebug.
>>
>> On 9/27/11, Massimo Di Pierro  wrote:
>>> Other than the error, do you see wrong behavior from the browser?
>>> I do not not believe that there is anything wrong as we ship the
>>> "official" rocket. We are just printing an exception that before was
>>> being ignored.
>>>
>>> Massimo
>>>
>>> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
 Hello Web2py.

  Rocket server was very  well stable for me until today , after 2
 weeks of update and while testing usual Json output which was never
 changed and working fine fore 8 months.

 This happens!

 ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving connection:
 Traceback (most recent call last):

   File "/root/web2py/gluon/rocket.py", line 1064, in run
     self.run_app(conn)

   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
     self.write(data, sections)

   File "/root/web2py/gluon/rocket.py", line 1472, in write
     self.send_headers(data, sections)

   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
     self.conn.sendall(b(header_data))

   File "/usr/lib/python2.7/socket.py", line 224, in meth
     return getattr(self._sock,name)(*args)

 error: [Errno 32] Broken pipe

 and it is on and off randomly.

 Why?

 heres my Json Controller :

 def rows():

         if REQUEST.vars.db_name:
                 casesdb = DAL( 'mysql://root@localhost/' +
 REQUEST.vars.db_name )
                 casesdb.define_table( 'email_data', migrate = False,
 *email_halfschema )
                 casesdb.define_table( 'loosefile_data', migrate = False,
 *file_halfschema )
                 casesdb.define_table( 'attach_data', migrate = False,
 *file_halfschema )
         elif SESSION.db_name:
                 casesdb = DAL( 'mysql://root@localhost/' +
 SESSION.db_name
 )
                 casesdb.define_table( 'email_data', migrate = False,
 *email_halfschema )
                 casesdb.define_table( 'loosefile_data', migrate = False,
 *file_halfschema )
                 casesdb.define_table( 'attach_data', migrate = False,
 *file_halfschema )

         fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
                          'emailFrom', 'subject', 'cc', 'bcc',
 'extracted',
 'hdrs',\


 'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
 MD5Hash','msgID','fqdn']
         rows = []
         page = int( request.vars.page )

         max = request.vars.totalrows
         if max:
                 pagesize = int( max )
         else:
                 pagesize = int( request.vars.rows )
         print pagesize
         limitby = ( page * pagesize - pagesize, page * pagesize )
 #       limitby = ( 1, 25 )
         print "str( page * pagesize - pagesize )" + str( page * pagesize
 -
 pagesize ) + " limitby " + str( page * pagesize )
 #       orderby = request.vars.sidx
         orderby = casesdb.email_data[request.vars.sidx]
         print orderby
         if request.vars.sord == 'desc':
                 orderby = ~orderby

         query = casesdb.email_data.id > 0

         for r in casesdb( query ).select( orderby = orderby, limitby =
 limitby ):
                 vals = []
                 for f in fields:
                         if f == 'extracted':
                                 vals.append( _sentisize(r[f]) )
                         else :
                                 vals.append( r[f] )
                 rows.append( dict( id = r.id, cell = vals ) )

         total = casesdb( query ).count()
         print total
         if total % pagesize >0:
                 pages = int( total / pagesize ) +1
         else:
                 pages = int( total / pagesize )
         #if total % pagesize == 0: pages -= 1
         data = dict( total = pages, page = page, rows = rows )
         return data
>>
>


Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-27 Thread Phyo Arkar
It cannot be reproduced ..

On 9/27/11, Phyo Arkar  wrote:
> its not the same warning notices , client recieves 0 byte and timed
> out at brower side looking at firebug.
>
> On 9/27/11, Massimo Di Pierro  wrote:
>> Other than the error, do you see wrong behavior from the browser?
>> I do not not believe that there is anything wrong as we ship the
>> "official" rocket. We are just printing an exception that before was
>> being ignored.
>>
>> Massimo
>>
>> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
>>> Hello Web2py.
>>>
>>>  Rocket server was very  well stable for me until today , after 2
>>> weeks of update and while testing usual Json output which was never
>>> changed and working fine fore 8 months.
>>>
>>> This happens!
>>>
>>> ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving connection:
>>> Traceback (most recent call last):
>>>
>>>   File "/root/web2py/gluon/rocket.py", line 1064, in run
>>> self.run_app(conn)
>>>
>>>   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
>>> self.write(data, sections)
>>>
>>>   File "/root/web2py/gluon/rocket.py", line 1472, in write
>>> self.send_headers(data, sections)
>>>
>>>   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
>>> self.conn.sendall(b(header_data))
>>>
>>>   File "/usr/lib/python2.7/socket.py", line 224, in meth
>>> return getattr(self._sock,name)(*args)
>>>
>>> error: [Errno 32] Broken pipe
>>>
>>> and it is on and off randomly.
>>>
>>> Why?
>>>
>>> heres my Json Controller :
>>>
>>> def rows():
>>>
>>> if REQUEST.vars.db_name:
>>> casesdb = DAL( 'mysql://root@localhost/' +
>>> REQUEST.vars.db_name )
>>> casesdb.define_table( 'email_data', migrate = False,
>>> *email_halfschema )
>>> casesdb.define_table( 'loosefile_data', migrate = False,
>>> *file_halfschema )
>>> casesdb.define_table( 'attach_data', migrate = False,
>>> *file_halfschema )
>>> elif SESSION.db_name:
>>> casesdb = DAL( 'mysql://root@localhost/' +
>>> SESSION.db_name
>>> )
>>> casesdb.define_table( 'email_data', migrate = False,
>>> *email_halfschema )
>>> casesdb.define_table( 'loosefile_data', migrate = False,
>>> *file_halfschema )
>>> casesdb.define_table( 'attach_data', migrate = False,
>>> *file_halfschema )
>>>
>>> fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
>>>  'emailFrom', 'subject', 'cc', 'bcc',
>>> 'extracted',
>>> 'hdrs',\
>>>
>>>
>>> 'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
>>> MD5Hash','msgID','fqdn']
>>> rows = []
>>> page = int( request.vars.page )
>>>
>>> max = request.vars.totalrows
>>> if max:
>>> pagesize = int( max )
>>> else:
>>> pagesize = int( request.vars.rows )
>>> print pagesize
>>> limitby = ( page * pagesize - pagesize, page * pagesize )
>>> #   limitby = ( 1, 25 )
>>> print "str( page * pagesize - pagesize )" + str( page * pagesize
>>> -
>>> pagesize ) + " limitby " + str( page * pagesize )
>>> #   orderby = request.vars.sidx
>>> orderby = casesdb.email_data[request.vars.sidx]
>>> print orderby
>>> if request.vars.sord == 'desc':
>>> orderby = ~orderby
>>>
>>> query = casesdb.email_data.id > 0
>>>
>>> for r in casesdb( query ).select( orderby = orderby, limitby =
>>> limitby ):
>>> vals = []
>>> for f in fields:
>>> if f == 'extracted':
>>> vals.append( _sentisize(r[f]) )
>>> else :
>>> vals.append( r[f] )
>>> rows.append( dict( id = r.id, cell = vals ) )
>>>
>>> total = casesdb( query ).count()
>>> print total
>>> if total % pagesize >0:
>>> pages = int( total / pagesize ) +1
>>> else:
>>> pages = int( total / pagesize )
>>> #if total % pagesize == 0: pages -= 1
>>> data = dict( total = pages, page = page, rows = rows )
>>> return data
>


Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-27 Thread Phyo Arkar
1) It was clear HTTP
2) The Json Response is 0 byte and client was timed out (It happened
to both me and my Client from US , not Latency Issue)
3) No nothing.

On 9/27/11, Michele Comitini  wrote:
> Hi Phyo
> Broken pipe... seems that the other end has died and the server tried
> to write to a dead socket.
> Questions:
> 1) is it a clear HTTP session i.e. without SSL/TLS?
> 2) what do you see on the client i.e. does it wait forever for the
> server to answer?
> 3) did you change anything on the client or the network?
>
> mic
>
>
> 2011/9/27 Massimo Di Pierro :
>> Sorry. I did not read the initial post with sufficient attention.
>>
>> On Sep 26, 4:06 pm, Jonathan Lundell  wrote:
>>> On Sep 26, 2011, at 1:42 PM, Massimo Di Pierro wrote:
>>>
>>> > It is not but it may be raised at the same point.
>>> > It is important to determine which rocket version did not cause the
>>> > error so we can look at differences.
>>>
>>> The added line only logs SSLError, FWIW.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> > On Sep 26, 3:34 pm, Jonathan Lundell  wrote:
>>> >> On Sep 26, 2011, at 1:30 PM, Massimo Di Pierro wrote:
>>>
>>> >>> Other than the error, do you see wrong behavior from the browser?
>>> >>> I do not not believe that there is anything wrong as we ship the
>>> >>> "official" rocket. We are just printing an exception that before was
>>> >>> being ignored.
>>>
>>> >> I don't think this is the same exception.
>>>
>>> >>> Massimo
>>>
>>> >>> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
>>>  Hello Web2py.
>>>
>>>   Rocket server was very  well stable for me until today , after 2
>>>  weeks of update and while testing usual Json output which was never
>>>  changed and working fine fore 8 months.
>>>
>>>  This happens!
>>>
>>>  ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving
>>>  connection:
>>>  Traceback (most recent call last):
>>>
>>>    File "/root/web2py/gluon/rocket.py", line 1064, in run
>>>  self.run_app(conn)
>>>
>>>    File "/root/web2py/gluon/rocket.py", line 1552, in run_app
>>>  self.write(data, sections)
>>>
>>>    File "/root/web2py/gluon/rocket.py", line 1472, in write
>>>  self.send_headers(data, sections)
>>>
>>>    File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
>>>  self.conn.sendall(b(header_data))
>>>
>>>    File "/usr/lib/python2.7/socket.py", line 224, in meth
>>>  return getattr(self._sock,name)(*args)
>>>
>>>  error: [Errno 32] Broken pipe
>>>
>>>  and it is on and off randomly.
>>>
>>>  Why?
>>>
>>>  heres my Json Controller :
>>>
>>>  def rows():
>>>
>>>  if REQUEST.vars.db_name:
>>>  casesdb = DAL( 'mysql://root@localhost/' +
>>>  REQUEST.vars.db_name )
>>>  casesdb.define_table( 'email_data', migrate = False,
>>>  *email_halfschema )
>>>  casesdb.define_table( 'loosefile_data', migrate =
>>>  False, *file_halfschema )
>>>  casesdb.define_table( 'attach_data', migrate =
>>>  False, *file_halfschema )
>>>  elif SESSION.db_name:
>>>  casesdb = DAL( 'mysql://root@localhost/' +
>>>  SESSION.db_name )
>>>  casesdb.define_table( 'email_data', migrate = False,
>>>  *email_halfschema )
>>>  casesdb.define_table( 'loosefile_data', migrate =
>>>  False, *file_halfschema )
>>>  casesdb.define_table( 'attach_data', migrate =
>>>  False, *file_halfschema )
>>>
>>>  fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
>>>   'emailFrom', 'subject', 'cc', 'bcc',
>>>  'extracted', 'hdrs',\
>>> 
>>>   
>>>  'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
>>>  MD5Hash','msgID','fqdn']
>>>  rows = []
>>>  page = int( request.vars.page )
>>>
>>>  max = request.vars.totalrows
>>>  if max:
>>>  pagesize = int( max )
>>>  else:
>>>  pagesize = int( request.vars.rows )
>>>  print pagesize
>>>  limitby = ( page * pagesize - pagesize, page * pagesize )
>>>  #   limitby = ( 1, 25 )
>>>  print "str( page * pagesize - pagesize )" + str( page *
>>>  pagesize -
>>>  pagesize ) + " limitby " + str( page * pagesize )
>>>  #   orderby = request.vars.sidx
>>>  orderby = casesdb.email_data[request.vars.sidx]
>>>  print orderby
>>>  if request.vars.sord == 'desc':
>>>  orderby = ~orderby
>>>
>>>  query = casesdb.email_data.id > 0
>>>
>>>  for r in casesdb( query ).select( orderby = orderby, limitby
>>>  = limitby ):
>>>  vals = []
>>>  for f in fields:
>>>  if f == 'extracted':
>>>    

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-27 Thread Phyo Arkar
its not the same warning notices , client recieves 0 byte and timed
out at brower side looking at firebug.

On 9/27/11, Massimo Di Pierro  wrote:
> Other than the error, do you see wrong behavior from the browser?
> I do not not believe that there is anything wrong as we ship the
> "official" rocket. We are just printing an exception that before was
> being ignored.
>
> Massimo
>
> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
>> Hello Web2py.
>>
>>  Rocket server was very  well stable for me until today , after 2
>> weeks of update and while testing usual Json output which was never
>> changed and working fine fore 8 months.
>>
>> This happens!
>>
>> ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving connection:
>> Traceback (most recent call last):
>>
>>   File "/root/web2py/gluon/rocket.py", line 1064, in run
>> self.run_app(conn)
>>
>>   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
>> self.write(data, sections)
>>
>>   File "/root/web2py/gluon/rocket.py", line 1472, in write
>> self.send_headers(data, sections)
>>
>>   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
>> self.conn.sendall(b(header_data))
>>
>>   File "/usr/lib/python2.7/socket.py", line 224, in meth
>> return getattr(self._sock,name)(*args)
>>
>> error: [Errno 32] Broken pipe
>>
>> and it is on and off randomly.
>>
>> Why?
>>
>> heres my Json Controller :
>>
>> def rows():
>>
>> if REQUEST.vars.db_name:
>> casesdb = DAL( 'mysql://root@localhost/' +
>> REQUEST.vars.db_name )
>> casesdb.define_table( 'email_data', migrate = False,
>> *email_halfschema )
>> casesdb.define_table( 'loosefile_data', migrate = False,
>> *file_halfschema )
>> casesdb.define_table( 'attach_data', migrate = False,
>> *file_halfschema )
>> elif SESSION.db_name:
>> casesdb = DAL( 'mysql://root@localhost/' + SESSION.db_name
>> )
>> casesdb.define_table( 'email_data', migrate = False,
>> *email_halfschema )
>> casesdb.define_table( 'loosefile_data', migrate = False,
>> *file_halfschema )
>> casesdb.define_table( 'attach_data', migrate = False,
>> *file_halfschema )
>>
>> fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
>>  'emailFrom', 'subject', 'cc', 'bcc', 'extracted',
>> 'hdrs',\
>>
>>  'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
>> MD5Hash','msgID','fqdn']
>> rows = []
>> page = int( request.vars.page )
>>
>> max = request.vars.totalrows
>> if max:
>> pagesize = int( max )
>> else:
>> pagesize = int( request.vars.rows )
>> print pagesize
>> limitby = ( page * pagesize - pagesize, page * pagesize )
>> #   limitby = ( 1, 25 )
>> print "str( page * pagesize - pagesize )" + str( page * pagesize -
>> pagesize ) + " limitby " + str( page * pagesize )
>> #   orderby = request.vars.sidx
>> orderby = casesdb.email_data[request.vars.sidx]
>> print orderby
>> if request.vars.sord == 'desc':
>> orderby = ~orderby
>>
>> query = casesdb.email_data.id > 0
>>
>> for r in casesdb( query ).select( orderby = orderby, limitby =
>> limitby ):
>> vals = []
>> for f in fields:
>> if f == 'extracted':
>> vals.append( _sentisize(r[f]) )
>> else :
>> vals.append( r[f] )
>> rows.append( dict( id = r.id, cell = vals ) )
>>
>> total = casesdb( query ).count()
>> print total
>> if total % pagesize >0:
>> pages = int( total / pagesize ) +1
>> else:
>> pages = int( total / pagesize )
>> #if total % pagesize == 0: pages -= 1
>> data = dict( total = pages, page = page, rows = rows )
>> return data


Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-27 Thread Phyo Arkar
it is Stable not trunk

On 9/27/11, Phyo Arkar  wrote:
> Thanks Michele
>
> The problem comes up randomly . Yes on the client end the json data do
> not recieved (0 byte) and stopped due to request timedout.
>
> And it happened to both testers for that period of time (until web2py
> was restarted), I am testing from myanmar and my Client is from NA so
> thats not latency / connection issue.
>
> Both tested using Firefox.
>
> it was upgraded from 1.95.1 to 1.98.2 and thats 2nd week after upgraded.
>
> On 9/27/11, Michele Comitini  wrote:
>> Hi Phyo
>> Broken pipe... seems that the other end has died and the server tried
>> to write to a dead socket.
>> Questions:
>> 1) is it a clear HTTP session i.e. without SSL/TLS?
>> 2) what do you see on the client i.e. does it wait forever for the
>> server to answer?
>> 3) did you change anything on the client or the network?
>>
>> mic
>>
>>
>> 2011/9/27 Massimo Di Pierro :
>>> Sorry. I did not read the initial post with sufficient attention.
>>>
>>> On Sep 26, 4:06 pm, Jonathan Lundell  wrote:
 On Sep 26, 2011, at 1:42 PM, Massimo Di Pierro wrote:

 > It is not but it may be raised at the same point.
 > It is important to determine which rocket version did not cause the
 > error so we can look at differences.

 The added line only logs SSLError, FWIW.









 > On Sep 26, 3:34 pm, Jonathan Lundell  wrote:
 >> On Sep 26, 2011, at 1:30 PM, Massimo Di Pierro wrote:

 >>> Other than the error, do you see wrong behavior from the browser?
 >>> I do not not believe that there is anything wrong as we ship the
 >>> "official" rocket. We are just printing an exception that before
 >>> was
 >>> being ignored.

 >> I don't think this is the same exception.

 >>> Massimo

 >>> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
  Hello Web2py.

   Rocket server was very  well stable for me until today , after 2
  weeks of update and while testing usual Json output which was
  never
  changed and working fine fore 8 months.

  This happens!

  ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving
  connection:
  Traceback (most recent call last):

    File "/root/web2py/gluon/rocket.py", line 1064, in run
      self.run_app(conn)

    File "/root/web2py/gluon/rocket.py", line 1552, in run_app
      self.write(data, sections)

    File "/root/web2py/gluon/rocket.py", line 1472, in write
      self.send_headers(data, sections)

    File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
      self.conn.sendall(b(header_data))

    File "/usr/lib/python2.7/socket.py", line 224, in meth
      return getattr(self._sock,name)(*args)

  error: [Errno 32] Broken pipe

  and it is on and off randomly.

  Why?

  heres my Json Controller :

  def rows():

          if REQUEST.vars.db_name:
                  casesdb = DAL( 'mysql://root@localhost/' +
  REQUEST.vars.db_name )
                  casesdb.define_table( 'email_data', migrate =
  False,
  *email_halfschema )
                  casesdb.define_table( 'loosefile_data', migrate =
  False, *file_halfschema )
                  casesdb.define_table( 'attach_data', migrate =
  False, *file_halfschema )
          elif SESSION.db_name:
                  casesdb = DAL( 'mysql://root@localhost/' +
  SESSION.db_name )
                  casesdb.define_table( 'email_data', migrate =
  False,
  *email_halfschema )
                  casesdb.define_table( 'loosefile_data', migrate =
  False, *file_halfschema )
                  casesdb.define_table( 'attach_data', migrate =
  False, *file_halfschema )

          fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
                           'emailFrom', 'subject', 'cc', 'bcc',
  'extracted', 'hdrs',\
 
   'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
  MD5Hash','msgID','fqdn']
          rows = []
          page = int( request.vars.page )

          max = request.vars.totalrows
          if max:
                  pagesize = int( max )
          else:
                  pagesize = int( request.vars.rows )
          print pagesize
          limitby = ( page * pagesize - pagesize, page * pagesize )
  #       limitby = ( 1, 25 )
          print "str( page * pagesize - pagesize )" + str( page *
  pagesize -
  pagesize ) + " limitby " + str( page * pagesize )
  #       orderby = request.var

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-27 Thread Phyo Arkar
Thanks Michele

The problem comes up randomly . Yes on the client end the json data do
not recieved (0 byte) and stopped due to request timedout.

And it happened to both testers for that period of time (until web2py
was restarted), I am testing from myanmar and my Client is from NA so
thats not latency / connection issue.

Both tested using Firefox.

it was upgraded from 1.95.1 to 1.98.2 and thats 2nd week after upgraded.

On 9/27/11, Michele Comitini  wrote:
> Hi Phyo
> Broken pipe... seems that the other end has died and the server tried
> to write to a dead socket.
> Questions:
> 1) is it a clear HTTP session i.e. without SSL/TLS?
> 2) what do you see on the client i.e. does it wait forever for the
> server to answer?
> 3) did you change anything on the client or the network?
>
> mic
>
>
> 2011/9/27 Massimo Di Pierro :
>> Sorry. I did not read the initial post with sufficient attention.
>>
>> On Sep 26, 4:06 pm, Jonathan Lundell  wrote:
>>> On Sep 26, 2011, at 1:42 PM, Massimo Di Pierro wrote:
>>>
>>> > It is not but it may be raised at the same point.
>>> > It is important to determine which rocket version did not cause the
>>> > error so we can look at differences.
>>>
>>> The added line only logs SSLError, FWIW.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> > On Sep 26, 3:34 pm, Jonathan Lundell  wrote:
>>> >> On Sep 26, 2011, at 1:30 PM, Massimo Di Pierro wrote:
>>>
>>> >>> Other than the error, do you see wrong behavior from the browser?
>>> >>> I do not not believe that there is anything wrong as we ship the
>>> >>> "official" rocket. We are just printing an exception that before was
>>> >>> being ignored.
>>>
>>> >> I don't think this is the same exception.
>>>
>>> >>> Massimo
>>>
>>> >>> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
>>>  Hello Web2py.
>>>
>>>   Rocket server was very  well stable for me until today , after 2
>>>  weeks of update and while testing usual Json output which was never
>>>  changed and working fine fore 8 months.
>>>
>>>  This happens!
>>>
>>>  ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving
>>>  connection:
>>>  Traceback (most recent call last):
>>>
>>>    File "/root/web2py/gluon/rocket.py", line 1064, in run
>>>      self.run_app(conn)
>>>
>>>    File "/root/web2py/gluon/rocket.py", line 1552, in run_app
>>>      self.write(data, sections)
>>>
>>>    File "/root/web2py/gluon/rocket.py", line 1472, in write
>>>      self.send_headers(data, sections)
>>>
>>>    File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
>>>      self.conn.sendall(b(header_data))
>>>
>>>    File "/usr/lib/python2.7/socket.py", line 224, in meth
>>>      return getattr(self._sock,name)(*args)
>>>
>>>  error: [Errno 32] Broken pipe
>>>
>>>  and it is on and off randomly.
>>>
>>>  Why?
>>>
>>>  heres my Json Controller :
>>>
>>>  def rows():
>>>
>>>          if REQUEST.vars.db_name:
>>>                  casesdb = DAL( 'mysql://root@localhost/' +
>>>  REQUEST.vars.db_name )
>>>                  casesdb.define_table( 'email_data', migrate = False,
>>>  *email_halfschema )
>>>                  casesdb.define_table( 'loosefile_data', migrate =
>>>  False, *file_halfschema )
>>>                  casesdb.define_table( 'attach_data', migrate =
>>>  False, *file_halfschema )
>>>          elif SESSION.db_name:
>>>                  casesdb = DAL( 'mysql://root@localhost/' +
>>>  SESSION.db_name )
>>>                  casesdb.define_table( 'email_data', migrate = False,
>>>  *email_halfschema )
>>>                  casesdb.define_table( 'loosefile_data', migrate =
>>>  False, *file_halfschema )
>>>                  casesdb.define_table( 'attach_data', migrate =
>>>  False, *file_halfschema )
>>>
>>>          fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
>>>                           'emailFrom', 'subject', 'cc', 'bcc',
>>>  'extracted', 'hdrs',\
>>> 
>>>   'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
>>>  MD5Hash','msgID','fqdn']
>>>          rows = []
>>>          page = int( request.vars.page )
>>>
>>>          max = request.vars.totalrows
>>>          if max:
>>>                  pagesize = int( max )
>>>          else:
>>>                  pagesize = int( request.vars.rows )
>>>          print pagesize
>>>          limitby = ( page * pagesize - pagesize, page * pagesize )
>>>  #       limitby = ( 1, 25 )
>>>          print "str( page * pagesize - pagesize )" + str( page *
>>>  pagesize -
>>>  pagesize ) + " limitby " + str( page * pagesize )
>>>  #       orderby = request.vars.sidx
>>>          orderby = casesdb.email_data[request.vars.sidx]
>>>          print orderby
>>>          if request.vars.sord == 'desc':
>>>                  orderby = ~orderby
>>>
>>>          query = casesdb.email_

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-27 Thread Michele Comitini
Hi Phyo
Broken pipe... seems that the other end has died and the server tried
to write to a dead socket.
Questions:
1) is it a clear HTTP session i.e. without SSL/TLS?
2) what do you see on the client i.e. does it wait forever for the
server to answer?
3) did you change anything on the client or the network?

mic


2011/9/27 Massimo Di Pierro :
> Sorry. I did not read the initial post with sufficient attention.
>
> On Sep 26, 4:06 pm, Jonathan Lundell  wrote:
>> On Sep 26, 2011, at 1:42 PM, Massimo Di Pierro wrote:
>>
>> > It is not but it may be raised at the same point.
>> > It is important to determine which rocket version did not cause the
>> > error so we can look at differences.
>>
>> The added line only logs SSLError, FWIW.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > On Sep 26, 3:34 pm, Jonathan Lundell  wrote:
>> >> On Sep 26, 2011, at 1:30 PM, Massimo Di Pierro wrote:
>>
>> >>> Other than the error, do you see wrong behavior from the browser?
>> >>> I do not not believe that there is anything wrong as we ship the
>> >>> "official" rocket. We are just printing an exception that before was
>> >>> being ignored.
>>
>> >> I don't think this is the same exception.
>>
>> >>> Massimo
>>
>> >>> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
>>  Hello Web2py.
>>
>>   Rocket server was very  well stable for me until today , after 2
>>  weeks of update and while testing usual Json output which was never
>>  changed and working fine fore 8 months.
>>
>>  This happens!
>>
>>  ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving connection:
>>  Traceback (most recent call last):
>>
>>    File "/root/web2py/gluon/rocket.py", line 1064, in run
>>      self.run_app(conn)
>>
>>    File "/root/web2py/gluon/rocket.py", line 1552, in run_app
>>      self.write(data, sections)
>>
>>    File "/root/web2py/gluon/rocket.py", line 1472, in write
>>      self.send_headers(data, sections)
>>
>>    File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
>>      self.conn.sendall(b(header_data))
>>
>>    File "/usr/lib/python2.7/socket.py", line 224, in meth
>>      return getattr(self._sock,name)(*args)
>>
>>  error: [Errno 32] Broken pipe
>>
>>  and it is on and off randomly.
>>
>>  Why?
>>
>>  heres my Json Controller :
>>
>>  def rows():
>>
>>          if REQUEST.vars.db_name:
>>                  casesdb = DAL( 'mysql://root@localhost/' + 
>>  REQUEST.vars.db_name )
>>                  casesdb.define_table( 'email_data', migrate = False, 
>>  *email_halfschema )
>>                  casesdb.define_table( 'loosefile_data', migrate = 
>>  False, *file_halfschema )
>>                  casesdb.define_table( 'attach_data', migrate = False, 
>>  *file_halfschema )
>>          elif SESSION.db_name:
>>                  casesdb = DAL( 'mysql://root@localhost/' + 
>>  SESSION.db_name )
>>                  casesdb.define_table( 'email_data', migrate = False, 
>>  *email_halfschema )
>>                  casesdb.define_table( 'loosefile_data', migrate = 
>>  False, *file_halfschema )
>>                  casesdb.define_table( 'attach_data', migrate = False, 
>>  *file_halfschema )
>>
>>          fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
>>                           'emailFrom', 'subject', 'cc', 'bcc', 
>>  'extracted', 'hdrs',\
>>                           
>>  'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
>>   MD5Hash','msgID','fqdn']
>>          rows = []
>>          page = int( request.vars.page )
>>
>>          max = request.vars.totalrows
>>          if max:
>>                  pagesize = int( max )
>>          else:
>>                  pagesize = int( request.vars.rows )
>>          print pagesize
>>          limitby = ( page * pagesize - pagesize, page * pagesize )
>>  #       limitby = ( 1, 25 )
>>          print "str( page * pagesize - pagesize )" + str( page * 
>>  pagesize -
>>  pagesize ) + " limitby " + str( page * pagesize )
>>  #       orderby = request.vars.sidx
>>          orderby = casesdb.email_data[request.vars.sidx]
>>          print orderby
>>          if request.vars.sord == 'desc':
>>                  orderby = ~orderby
>>
>>          query = casesdb.email_data.id > 0
>>
>>          for r in casesdb( query ).select( orderby = orderby, limitby = 
>>  limitby ):
>>                  vals = []
>>                  for f in fields:
>>                          if f == 'extracted':
>>                                  vals.append( _sentisize(r[f]) )
>>                          else :
>>                                  vals.append( r[f] )
>>                  rows.append( dict( id = r.id, cell = vals ) )
>>
>>          total = casesdb( query ).count()
>>          print total
>>      

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-26 Thread Jonathan Lundell
On Sep 26, 2011, at 1:42 PM, Massimo Di Pierro wrote:

> It is not but it may be raised at the same point.
> It is important to determine which rocket version did not cause the
> error so we can look at differences.

The added line only logs SSLError, FWIW.

> 
> On Sep 26, 3:34 pm, Jonathan Lundell  wrote:
>> On Sep 26, 2011, at 1:30 PM, Massimo Di Pierro wrote:
>> 
>>> Other than the error, do you see wrong behavior from the browser?
>>> I do not not believe that there is anything wrong as we ship the
>>> "official" rocket. We are just printing an exception that before was
>>> being ignored.
>> 
>> I don't think this is the same exception.
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Massimo
>> 
>>> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
 Hello Web2py.
>> 
  Rocket server was very  well stable for me until today , after 2
 weeks of update and while testing usual Json output which was never
 changed and working fine fore 8 months.
>> 
 This happens!
>> 
 ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving connection:
 Traceback (most recent call last):
>> 
   File "/root/web2py/gluon/rocket.py", line 1064, in run
 self.run_app(conn)
>> 
   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
 self.write(data, sections)
>> 
   File "/root/web2py/gluon/rocket.py", line 1472, in write
 self.send_headers(data, sections)
>> 
   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
 self.conn.sendall(b(header_data))
>> 
   File "/usr/lib/python2.7/socket.py", line 224, in meth
 return getattr(self._sock,name)(*args)
>> 
 error: [Errno 32] Broken pipe
>> 
 and it is on and off randomly.
>> 
 Why?
>> 
 heres my Json Controller :
>> 
 def rows():
>> 
 if REQUEST.vars.db_name:
 casesdb = DAL( 'mysql://root@localhost/' + 
 REQUEST.vars.db_name )
 casesdb.define_table( 'email_data', migrate = False, 
 *email_halfschema )
 casesdb.define_table( 'loosefile_data', migrate = False, 
 *file_halfschema )
 casesdb.define_table( 'attach_data', migrate = False, 
 *file_halfschema )
 elif SESSION.db_name:
 casesdb = DAL( 'mysql://root@localhost/' + SESSION.db_name 
 )
 casesdb.define_table( 'email_data', migrate = False, 
 *email_halfschema )
 casesdb.define_table( 'loosefile_data', migrate = False, 
 *file_halfschema )
 casesdb.define_table( 'attach_data', migrate = False, 
 *file_halfschema )
>> 
 fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
  'emailFrom', 'subject', 'cc', 'bcc', 'extracted', 
 'hdrs',\
  
 'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated','
  MD5Hash','msgID','fqdn']
 rows = []
 page = int( request.vars.page )
>> 
 max = request.vars.totalrows
 if max:
 pagesize = int( max )
 else:
 pagesize = int( request.vars.rows )
 print pagesize
 limitby = ( page * pagesize - pagesize, page * pagesize )
 #   limitby = ( 1, 25 )
 print "str( page * pagesize - pagesize )" + str( page * pagesize -
 pagesize ) + " limitby " + str( page * pagesize )
 #   orderby = request.vars.sidx
 orderby = casesdb.email_data[request.vars.sidx]
 print orderby
 if request.vars.sord == 'desc':
 orderby = ~orderby
>> 
 query = casesdb.email_data.id > 0
>> 
 for r in casesdb( query ).select( orderby = orderby, limitby = 
 limitby ):
 vals = []
 for f in fields:
 if f == 'extracted':
 vals.append( _sentisize(r[f]) )
 else :
 vals.append( r[f] )
 rows.append( dict( id = r.id, cell = vals ) )
>> 
 total = casesdb( query ).count()
 print total
 if total % pagesize >0:
 pages = int( total / pagesize ) +1
 else:
 pages = int( total / pagesize )
 #if total % pagesize == 0: pages -= 1
 data = dict( total = pages, page = page, rows = rows )
 return data




Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-26 Thread Jonathan Lundell
On Sep 26, 2011, at 1:30 PM, Massimo Di Pierro wrote:

> Other than the error, do you see wrong behavior from the browser?
> I do not not believe that there is anything wrong as we ship the
> "official" rocket. We are just printing an exception that before was
> being ignored.

I don't think this is the same exception.

> 
> Massimo
> 
> On Sep 26, 2:47 pm, Phyo Arkar  wrote:
>> Hello Web2py.
>> 
>>  Rocket server was very  well stable for me until today , after 2
>> weeks of update and while testing usual Json output which was never
>> changed and working fine fore 8 months.
>> 
>> This happens!
>> 
>> ERROR:Rocket.Errors.Thread-6:Unhandled Error when serving connection:
>> Traceback (most recent call last):
>> 
>>   File "/root/web2py/gluon/rocket.py", line 1064, in run
>> self.run_app(conn)
>> 
>>   File "/root/web2py/gluon/rocket.py", line 1552, in run_app
>> self.write(data, sections)
>> 
>>   File "/root/web2py/gluon/rocket.py", line 1472, in write
>> self.send_headers(data, sections)
>> 
>>   File "/root/web2py/gluon/rocket.py", line 1456, in send_headers
>> self.conn.sendall(b(header_data))
>> 
>>   File "/usr/lib/python2.7/socket.py", line 224, in meth
>> return getattr(self._sock,name)(*args)
>> 
>> error: [Errno 32] Broken pipe
>> 
>> and it is on and off randomly.
>> 
>> Why?
>> 
>> heres my Json Controller :
>> 
>> def rows():
>> 
>> if REQUEST.vars.db_name:
>> casesdb = DAL( 'mysql://root@localhost/' + 
>> REQUEST.vars.db_name )
>> casesdb.define_table( 'email_data', migrate = False, 
>> *email_halfschema )
>> casesdb.define_table( 'loosefile_data', migrate = False, 
>> *file_halfschema )
>> casesdb.define_table( 'attach_data', migrate = False, 
>> *file_halfschema )
>> elif SESSION.db_name:
>> casesdb = DAL( 'mysql://root@localhost/' + SESSION.db_name )
>> casesdb.define_table( 'email_data', migrate = False, 
>> *email_halfschema )
>> casesdb.define_table( 'loosefile_data', migrate = False, 
>> *file_halfschema )
>> casesdb.define_table( 'attach_data', migrate = False, 
>> *file_halfschema )
>> 
>> fields = ['id', 'filePath', 'fileName', 'cus', 'sentto',\
>>  'emailFrom', 'subject', 'cc', 'bcc', 'extracted', 
>> 'hdrs',\
>>  
>> 'DateTime','OriginalDateTime','TimeZone','reply_to',"master",'duplicated',' 
>> MD5Hash','msgID','fqdn']
>> rows = []
>> page = int( request.vars.page )
>> 
>> max = request.vars.totalrows
>> if max:
>> pagesize = int( max )
>> else:
>> pagesize = int( request.vars.rows )
>> print pagesize
>> limitby = ( page * pagesize - pagesize, page * pagesize )
>> #   limitby = ( 1, 25 )
>> print "str( page * pagesize - pagesize )" + str( page * pagesize -
>> pagesize ) + " limitby " + str( page * pagesize )
>> #   orderby = request.vars.sidx
>> orderby = casesdb.email_data[request.vars.sidx]
>> print orderby
>> if request.vars.sord == 'desc':
>> orderby = ~orderby
>> 
>> query = casesdb.email_data.id > 0
>> 
>> for r in casesdb( query ).select( orderby = orderby, limitby = 
>> limitby ):
>> vals = []
>> for f in fields:
>> if f == 'extracted':
>> vals.append( _sentisize(r[f]) )
>> else :
>> vals.append( r[f] )
>> rows.append( dict( id = r.id, cell = vals ) )
>> 
>> total = casesdb( query ).count()
>> print total
>> if total % pagesize >0:
>> pages = int( total / pagesize ) +1
>> else:
>> pages = int( total / pagesize )
>> #if total % pagesize == 0: pages -= 1
>> data = dict( total = pages, page = page, rows = rows )
>> return data