[Users] mediaproxy MySQL server has gone away error

Daniel-Constantin Mierla daniel at voice-system.ro
Mon Feb 5 11:25:29 CET 2007


I do not know about mediaproxy and python libraries, but there were some 
versions of mysql client library in the past that have the reconnection 
part broken. Check goolge and mysql documentation for that.

Cheers,
Daniel


On 01/31/07 13:47, James Holden wrote:
> Hi all,
>
> I'm having a problem with the mediaproxy rtp proxy.
>
> I'm using to do accounting into a MySQL database.
>
> After a period of inactivity, it loses it's connection to the MySQL server and
> the update queries begin to fail. Openser stays connected, however.
>
> The error in the logs is:
>
> error: accounting failed. MySQL error: (2006, 'MySQL server has gone
> away')
>
> I'm running:
>
> mediaproxy 1.8.0
> openser-1.1.0 (using the RHEL3 rpm from the openser website)
> openser-mysql-1.1.0 (again using the openser RHEL3 rpm)
> Python-2.4.4
> MySQL-python-1.2.1_p2
>
> My Python skills aren't up to much. So far, I've tried added the
> following line into /usr/local/mediaproxy/modules/mysql.py just before
> the query call, to try and re-establish the connection:
>
>     def query(self, query):
>         self._query = query
>         for c in range(0, 3):
>             try:
>                 self.conn.db.ping()      <<<<<<---- added by me
>                 return self.cursor.execute(query)
>             except MySQLdb.OperationalError, why:
>                 if why[0] not in (CR.SERVER_GONE_ERROR, CR.SERVER_LOST):
>                     raise
>         raise
>
> ... but it hasn't helped.
>
> Has anyone seen this before?
>
> Best regards,
>
> James
>
>
>   




More information about the Users mailing list