Page MenuHomePhabricator

Solve database connection issues with Wikiloves tool
Closed, ResolvedPublic

Description

The wikiloves tool has not correctly udpated since November 1st.

It had started failing with

Traceback (most recent call last):
File "database.py", line 30, in connect
read_timeout=30, charset='utf8', use_unicode=True, autoping=True)
oursql.InterfaceError: (2003, "Can't connect to MySQL server on 'commonswiki.labsdb' (111)", None)

then

File "database.py", line 47, in query
self.cursor.execute(*sql)
oursql.OperationalError: (2006, 'MySQL server has gone away', None)

and finally

File "database.py", line 30, in connect
read_timeout=30, charset='utf8', use_unicode=True, autoping=True)
oursql.ProgrammingError: (1226, "User 's52927' has exceeded the 'max_user_connections' resource (current value: 10)", None)

Event Timeline

JeanFred created this task.Nov 15 2017, 8:51 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 15 2017, 8:51 AM

I initially thought it might be due to the oursql library. I switched to use pymysql but have similar results.

JeanFred triaged this task as High priority.Nov 15 2017, 8:52 AM

@Lokal_Profil, sorry to drop you into this ; but if you have any suggestions I’d be grateful :)

Lokal_Profil added a comment.EditedNov 15 2017, 11:50 AM

Can you connect manually to the db from labs as that user do you still get the max_user_connections error?

Other than that (not having looked at the code for a while):

  • maybe check if the tool only opens the connection once in the start or e.g. once per country
  • where does the tools own data get stored? If it's on the commons replica server then possibly it went away with the new db setup + server failure?

Probably related: T180014

bd808 added a subscriber: bd808.Apr 2 2020, 7:58 PM

@JeanFred is this still an active problem, or just a phab task that never got closed?

JeanFred closed this task as Resolved.Apr 3 2020, 12:01 PM

@JeanFred is this still an active problem, or just a phab task that never got closed?

Thanks for the ping @bd808. Yes, this issue was indeed fixed by switching to the new replicas in 38177c8d6310, as advised by Chase. Thanks!