If someone has this 2006, MySQL server has gone away error after the second 
archive update (so after 5 minutes), and their first insert after 
connecting works. Or maybe if they have a bit of a flaky connection to 
their remote server:

for me to solve this I had to set this session variable after connecting 
(after setting the isolation level thing in the mysql.py):
        self.connection.query("set session wait_timeout=3600")

It turned out that my webhost had this on global setting set to 60 seconds 
(check it first), which is too low given my 5 minute archive interval. I 
would set it to at least 360 seconds.
Maybe other users out there with the same problem can try and see if it 
helps. It is a better solution than re-establishing the connection each 
time in this case.

Tom


Op woensdag 31 mei 2017 04:22:16 UTC+2 schreef Louis De Lange:
>
> While there seem to be great excitement for the new meteotemplate 
> uploader, I previously wrote a service that updates my meteotemplate 
> database directly without an intermediate php script.  In the service i use 
> a ."getSql("INSERT INTO" statement.  This works really well and I even 
> resolved the dayrain issue that is now being discussed on another thread.
>
> There is one annoying bug and I dont know how to solve it.  My 
> meteotemplate install is located on a different server than weewx.  It can 
> sometimes happen that the meteotemplate server is temporarily unavailable. 
>  To overcome this scenario I use a "try" statement when inserting SQL data, 
> so that it will just skip the upload attempt if the MySQL server is not 
> available.  The bug is that the mysql insert command continue to fail after 
> the meteotemplate server becomes available again, and the only way to 
> correct it is to restart weewx. 
>
> The fail message is "Error (2006, 'MySQL server has gone away')" and it 
> continues to be displayed after the meteotemplate server is back on line.
>
> Any ideas how to resolve this will be appreciated.
>
> Louis
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" 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