Topic on Project:Support desk

Semako96 (talkcontribs)

Currently I can't open Spezial:Verwaiste Seiten (https://mariowiki.net/wiki/Spezial:Verwaiste_Seiten), because I get a database errror: [5583067846a46113244ad127] 2019-01-25 17:15:11: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“

What is the problem here? Other pages work and I can upload files and create new articles.

AhmadF.Cheema (talkcontribs)

In LocalSettings.php, set:

$wgShowExceptionDetails = true;
$wgDevelopmentWarnings = true; error_reporting( -1 ); ini_set( 'display_errors', 1);
# SQL errors:
$wgShowuserSQLErrors = true; $wgShowDBErrorBacktrace = true;

Manual:How to debug

Semako96 (talkcontribs)

Do you have any idea why this single page doesn't work? Does it use a specific MySQL table or query, so that I can test it manually? I don't want to have all those warnings from open_basedir showing up again, so I decativated PHP warning reports in the server config.

AhmadF.Cheema (talkcontribs)

After you turn on debugging, probably especially the portion related to SQL errors, will anyone "have any idea why this single page doesn't work?" Which "specific MySQL table or query" is the issue here?

Debugging needs to be turned On temporarily. Turn it On > Reload the page > Note down the error > Turn Off debugging.

Semako96 (talkcontribs)

Activated debug mode, and got that error on Spezial:Verwaiste_Seiten

[9599436522e6674869066803] /wiki/Spezial:Verwaiste_Seiten   Wikimedia\Rdbms\DBQueryError from line 1457 of /home/.sites/327/site4525714/web/wiki/w/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 

 Query: SELECT  page_namespace AS `namespace`,page_title AS `title`,page_title AS `value`  FROM `page` LEFT JOIN `pagelinks` ON ((pl_namespace = page_namespace) AND (pl_title = page_title)) LEFT JOIN `templatelinks` ON ((tl_namespace = page_namespace) AND (tl_title = page_title))   WHERE (pl_namespace IS NULL) AND page_namespace = '0' AND page_is_redirect = '0' AND (tl_namespace IS NULL)  ORDER BY page_title LIMIT 101  

 Function: LonelyPagesPage::reallyDoQuery

 Error: 1104 The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay (mysqlsvr39.world4you.com)

Backtrace:

#0 /home/.sites/327/site4525714/web/wiki/w/includes/libs/rdbms/database/Database.php(1427): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)

 #1 /home/.sites/327/site4525714/web/wiki/w/includes/libs/rdbms/database/Database.php(1200): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)

 #2 /home/.sites/327/site4525714/web/wiki/w/includes/libs/rdbms/database/Database.php(1653): Wikimedia\Rdbms\Database->query(string, string)

 #3 /home/.sites/327/site4525714/web/wiki/w/includes/specialpage/QueryPage.php(425): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)

 #4 /home/.sites/327/site4525714/web/wiki/w/includes/specialpage/QueryPage.php(599): QueryPage->reallyDoQuery(integer, integer)

 #5 /home/.sites/327/site4525714/web/wiki/w/includes/specialpage/SpecialPage.php(522): QueryPage->execute(NULL)

 #6 /home/.sites/327/site4525714/web/wiki/w/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)

 #7 /home/.sites/327/site4525714/web/wiki/w/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)

 #8 /home/.sites/327/site4525714/web/wiki/w/includes/MediaWiki.php(861): MediaWiki->performRequest()

 #9 /home/.sites/327/site4525714/web/wiki/w/includes/MediaWiki.php(524): MediaWiki->main()

 #10 /home/.sites/327/site4525714/web/wiki/w/index.php(42): MediaWiki->run()

 #11 {main}

I ran the update script after the update from MediaWiki 1.24, and it finished with success, so if that table didn't get updated in the process, there must be a critical bug in the update script.

2001:16B8:1063:9500:98C4:8EB:C659:9B56 (talkcontribs)

Does not seem so.

> The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay (mysqlsvr39.world4you.com)

The default value of max_join_size is 18446744073709551615. I think this value should not be exceeded in your case.

What is max_join_size set to? I guess it should be set to something higher!

Semako96 (talkcontribs)

Where do I find that setting in phpMyAdmin?

Semako96 (talkcontribs)

Anyone?

Ciencia Al Poder (talkcontribs)
Semako96 (talkcontribs)

How can I check wether my database is missing some indices?

If it was caused by a limitation from my hoster, why do the other similar special paged all work? Anything I can do? That page is important for the wiki...

Ciencia Al Poder (talkcontribs)

Check in Manual:Database layout or Manual:tables.sql for index definition and compare that on your database. Since there are a lot of tables, start checking only the tables involved in the query that failed: page, pagelinks and templatelinks

Semako96 (talkcontribs)

Compared those to my database and found out that profiling and change_tag_dev are missing. My database also contains some other tables that aren't listed there and probably leftovers from an older MediaWiki version or older extensions.

Semako96 (talkcontribs)

anyone has an Idea about what to do?

Ciencia Al Poder (talkcontribs)

Did you create the missing indices?

This post was hidden by 2A02:8388:6982:B700:64A6:9F4D:4333:2906 (history)
Semako96 (talkcontribs)

No, I haven't created them yet. Are those related to the issue with Spezial:Verwaiste Seiten?

Ciencia Al Poder (talkcontribs)

Indices prevent queries from scanning the entire table. This is the issue your host is limiting: The SELECT would examine more than MAX_JOIN_SIZE rows. If the index is in place, it shouldn't need to scan so many rows, apparently

Semako96 (talkcontribs)

Just noticed that the profiling table doesn't exist by default, and change_tag_dev exists only from MediaWiki 1.32 onwards, not 1.31. So there are no missing indices in my database. Is there anything I can do to make that page work? And why do pages like Spezial:Verwaiste_Dateien, Spezial:Verwaiste_Kategorien work anyways? There are much more files than article pages including redirects on our wiki.

Ciencia Al Poder (talkcontribs)

I don't know. However, your host is imposing limitations to database queries, and this is an issue that you may encounter more frequently as your wiki grows. You can try to live with that, or migrate to a better hosting.

Semako96 (talkcontribs)

I just got an answer from my hoster. I need to insert SET SQL_BIG_SELECTS=1; into the code where it does the database select request. Can you tell me where that is?

Ciencia Al Poder (talkcontribs)

It's somewhere in includes/libs/rdbms/database/Database.php: near or inside Wikimedia\Rdbms\Database->selectDomain(Wikimedia\Rdbms\DatabaseDomain)

Semako96 (talkcontribs)

that's really vague. Anyone who knows exactly where the database select request in question is done?

Semako96 (talkcontribs)

Anyone?

Reply to "Database error"