One of the investigations would be to install postgres and see if it's the
samemistake, becauseI'm almost thinking that is a problem with mysql
relationships.



       Ovidio Marinho Falcao Neto
                Web Developer
             ovidio...@gmail.com
          ovidiomari...@itjp.net.br
                 ITJP - itjp.net.br
               83   8826 9088 - Oi
               83   9334 0266 - Claro
                        Brasil



2011/10/27 Richard Bruskiewich <richard.bruskiew...@delphinai.com>

> Thank you Professor  Di Pierro for your direct reply.
>
> Since I am new to the community, I'm not sure how to log a ticket.
> I'll look into that but if you will bear with me, here is perhaps the
> additional information you are asking for:
>
> I've deployed Web2PY Version 1.98.2 (2011-08-04 00:47:09)
>
> The error is routinely reproducible... on four different web browsers
> (IE, FireFox, Chrome, Safari). Seems to be associated with starting a
> new session after an old session times out(?).  Refreshing the web
> browser clears the error, but the error always  recurs so is not
> pretty for end users visiting the site, generating the anonymous, in
> accessible Web2PY ticket URL which only Admin-privileged folks (i.e.
> me) can view over an SSH tunnel.
>
> I have web2py running behind NGINX via uswgi. This is installed on an
> Amazon EC2 server using web recipes (e.g.
> http://stackoverflow.com/questions/5335153/how-to-deply-web2py-using-nginx
> ,
> https://library.linode.com/web-servers/nginx/python-uwsgi/centos-5 and
> other helpful sites - I have deployment notes available, if they'd be
> needed).
>
> I don't seem to see this problem at all while running the app on my
> local machine (using the built in Rocket 1.2.2 server) only when in
> production deployment on the Amazon cloud.
>
> The back end database on the Amazon cloud is a remote MySQL image
> running at Amazon (RDS - http://aws.amazon.com/rds/). I suspect that
> mysql connections routinely time out in the cloud if they lay unused
> for some period of time. Not sure how this might trip up the web2py
> DAL.  You have the Traceback from my previous email (the same one
> occurs each time...). The Traceback isn't too informative as to
> exactly what part of my (model?) code is the one triggering the error.
> Is it the DAL class __init__? I could, I suppose, try to chase this
> down, but perhaps somebody more intimate with the code can better
> suggest where to look.
>
> Do let me know if any other information other than the above would be
> of use to troubleshooting the problem.
>
> I'll try to read up some more about Amazon RDS (and MySQL) to see if
> there is anything I can do to tweak the MySQL installation to mitigate
> timeouts.  Meanwhile, perhaps somebody out in the web2py community can
> comment.
>
> Thanks again for your direct reply.
>
> Cheers
> Richard Bruskiewich, PhD
> Scientific Consultant,
> International Rice Research Institute (IRRI)
>
> On Oct 27, 10:51 am, Massimo Di Pierro <massimo.dipie...@gmail.com>
> wrote:
> > Which version? Is the problem reproducible? Can you tell us more?
> > Perhaps open a ticket
> >
> > On Oct 26, 11:24 am, RichardBruskiewich
> >
> >
> >
> >
> >
> >
> >
> > <richard.bruskiew...@delphinai.com> wrote:
> > > I'm a recent fan of web2py, having adopted it for some major
> > > institutional projects in global agriculture. So far, so good - very
> > > happy - but I have a recurring curious low level database error which
> > > I'm not sure how to fix.
> >
> > > I've already tried trapping my web2py data model in a try... except
> > > block, inside a loop to retry the database connection (about 20 times,
> > > or so I think), but this doesn't seem to help.  The database
> > > connection often works... it is just that when the MySQL connection is
> > > idle for too long, or when a fresh connection is requested for a new
> > > user session, something fails... DAL doesn't handle it.
> >
> > > Here's the background: I'm running web2py in an NGINX server via uwsgi
> > > (which generally works fine - configured based on good advice online).
> > > However, this server runs within an Amazon Web Services (AWS) EC2
> > > server and accesses a MySQL instance running non-locally as a AWS
> > > Relational Database (RDB) server.
> >
> > > I'm using a DAL pool_size of 10.
> >
> > > Here's the error message:
> >
> > > Operational Error: (2013, 'Lost connection to MySQL server during
> > > query')
> >
> > > Traceback (most recent call last):
> > >   File "/opt/web2py/gluon/main.py", line 506, in wsgibase
> > >     BaseAdapter.close_all_instances('commit')
> > >   File "/opt/web2py/gluon/dal.py", line 373, in close_all_instances
> > >     getattr(instance,action)()
> > >   File "/opt/web2py/gluon/dal.py", line 1225, in commit
> > >     return self.connection.commit()
> > >   File "/opt/web2py/gluon/contrib/pymysql/connections.py", line 562,
> > > in commit
> > >     self.errorhandler(None, exc, value)
> > >   File "/opt/web2py/gluon/contrib/pymysql/connections.py", line 184,
> > > in defaulterrorhandler
> > >     raise errorclass, errorvalue
> > > OperationalError: (2013, 'Lost connection to MySQL server during
> > > query')
> >
> > > I hope someone can suggest something here. Do I need to tweak some
> > > MySQL client parameter, or does someone have some advice about Amazon
> > > RDB usage practicalities in such a situation?
> >
> > > Cheers
> > > RichardBruskiewich
> > > Scientific Consultant,
> > > International Rice Research Institute (IRRI)
>

Reply via email to