Page MenuHomePhabricator

GenderCache::doQuery/MediaWikiTitleCodec::getNamespaceName causes DB error
Closed, ResolvedPublic

Description

Appears then using the EmailPage extension. Originally reported here but ...

Setup:

MW 1.23.10 with PHP 5.4.45 (cgi-fcgi) and MySQL 5.1.73-log

Query:

SELECT user_name,up_value FROM `rg_user` LEFT JOIN `rg_user_properties` ON ((user_id = up_user) AND up_property = 'gender') WHERE user_name = 'DFRV - Regionalgruppe Berlin'

Function:
GenderCache::doQuery/MediaWikiTitleCodec::getNamespaceName

Error:
0

I am quite sure that this started with MW 1.23.9 Adding this issue to I18n because of GenderCache, however I might be wrong here.

Event Timeline

Kghbln created this task.Oct 17 2015, 4:55 PM
Kghbln raised the priority of this task from to Needs Triage.
Kghbln updated the task description. (Show Details)
Kghbln added a project: I18n.
Kghbln added a subscriber: Kghbln.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 17 2015, 4:55 PM
Kghbln set Security to None.Oct 17 2015, 4:58 PM
Kghbln added a subscriber: Nad.
Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptDec 12 2015, 8:17 PM
Kghbln added a comment.Feb 2 2017, 4:37 PM

Just wanted to report this as a new issue. This is what I have written now. Apparently nobody is involved with issues of caching or database queries going wild? :)

Setup

  • MediaWiki 1.23.15
  • PHP 5.6.30 (cgi-fcgi)
  • MySQL 5.1.73-log
  • EmailPage 2.3.3, 2015-03-05

Issue
The following database query error appears sometimes when trying to use the EmailPage extension for sending out pages.

Query:

SELECT user_name,up_value FROM `rg_user` LEFT JOIN `rg_user_properties` ON ((user_id = up_user) AND up_property = 'gender') WHERE user_name = 'DFRV - Regionalgruppe Berlin'

Function:

GenderCache::doQuery/MediaWikiTitleCodec::getNamespaceName

Error:

0

@Shizhao: Can you please provide reasons why this is requested?

@Shizhao: Can you please provide reasons why this is requested?

What problem?

Oops, I am sorry - I guess I mixed up some open tabs here. Please ignore this and the last two comments!

Thanks for the note. I added the settings to "LocalSettings.php" and I will be able to provide better feedback in the first or second week of March. Stay tuned.

Now I had the opportunity again to recreate the failure an get a log. What happened: The script timed out and I got no backtrace. Next time I can try is end of June. One of these days. :(

Kghbln added a comment.Jul 3 2017, 5:29 PM

Finally I got a bit more information, hopefully enough to spot more easily. The issue is also present in current MW LTS (1.27.x). I wonder why the notice comes from "DatabaseMysqli.php". This database system is not in use for the wiki.

New setup

  • MediaWiki 1.27.3
  • PHP 5.6.30 (cgi-fcgi)
  • MySQL 5.5.55-0+deb7u1-log
  • EmailPage 2.4.4, 2017-04-26

LocalSettings.php

error_reporting( -1 );
ini_set( 'display_errors', 1 );
$wgShowExceptionDetails = true;
$wgShowSQLErrors = true;
$wgDebugDumpSql = true;

Issue
The following database query error appears sometimes when trying to use the EmailPage extension for sending out pages. (REM self: chunk Berlin 3)

Warning: mysqli::query(): MySQL server has gone away in /.../rg/includes/db/DatabaseMysqli.php on line 43
Warning: mysqli::query(): Error reading result set's header in /.../rg/includes/db/DatabaseMysqli.php on line 43
Warning: mysqli::query(): MySQL server has gone away in /.../rg/includes/db/DatabaseMysqli.php on line 43
Warning: mysqli::query(): Error reading result set's header in /.../rg/includes/db/DatabaseMysqli.php on line 43

Database error

Query:

SELECT  user_name,up_value  FROM `rg_user` LEFT JOIN `rg_user_properties` ON ((user_id = up_user) AND up_property = 'gender')  WHERE user_name = 'DFRV - Regionalgruppe Berlin'

Function:

GenderCache::doQuery/MediaWikiTitleCodec::getNamespaceName

Error:

2006 MySQL server has gone away (db444256697.db.1and1.com)
Krinkle added a subscriber: Krinkle.Jun 5 2019, 2:17 PM

"server has gone away" generally indicates that the MySQL server decided to close or drop the connection. This could indicate that there is insufficient network capacity on the server, or that a restriction was exceeded (e.g. number of open connections).

I don't recall exactly since when, but since 1-2 years ago MW will in such case attempt once to re-establish connection and only emit this failure if it still failed after that. As such, I'm assuming this to be either resolved in MW 1.29+, or that (if it still happens) to be an issue outside the scope of what MW can handle.

Kghbln added a comment.Jun 5 2019, 2:28 PM

Thanks a lot for your feedback. Admittedly this wiki was on some shitty (please excuse this word) 1and1 shared hosting plan. Thus your assessment of the issue does make sense to me. From remembering the behaviour it showed it was most likely a database server timeout.

Unfortunately in the meantime this wiki fell victim to the new European privacy regime introduced last May and was defunct prior to a planned update to MW 1.31.x.