Topic on Extension talk:AutoSitemap

Jump to navigation Jump to search

DataBase error after adding a new namespace to exclude

Nicolas NALLET (talkcontribs)

When I add a new namespace to exclude in $wgAutoSitemap["exclude_namespaces"] = like


and after when I try to edit a page on the wiki I get a database error.

Martynov Maxim (talkcontribs)

Can you attach trace log with debug mode enabled?

Nicolas NALLET (talkcontribs)

You can create an account on and try to edit a page to see the full erro message


Database error

A database query error has occurred. This may indicate a bug in the software.

[15d59b6bbc7b1e30c4d8f1f7] /index.php?title=Bac_%C3%A0_sable&action=submit Wikimedia\Rdbms\DBQueryError from line 1075 of /srv/data/web/vhosts/ A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: SELECT "Popularpages" AS type,

page_id AS id,

page_namespace AS namespace,

page_title AS title,

( MAX( rev_timestamp ) ) AS last_modification,

rev_timestamp AS value





page_is_redirect = 0

AND rev_page = page_id

AND page_namespace NOT IN (5,7,8,9,10,11,12,13,15,6,NS_WIDGET)

GROUP BY page_id

Function: Wikimedia\Rdbms\Database::query

Error: 1054 Unknown column 'NS_WIDGET' in 'where clause' (localhost)


#0 /srv/data/web/vhosts/ Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)

#1 /srv/data/web/vhosts/ Wikimedia\Rdbms\Database->query(string)

#2 [internal function]: AutoSitemap::writeSitemap(Revision, string, string)

#3 /srv/data/web/vhosts/ call_user_func_array(string, array)

#4 /srv/data/web/vhosts/ Hooks::run(string, array)

#5 /srv/data/web/vhosts/ Revision->insertOn(Wikimedia\Rdbms\DatabaseMysqli)

#6 /srv/data/web/vhosts/ WikiPage->doModify(WikitextContent, integer, User, string, array)

#7 /srv/data/web/vhosts/ WikiPage->doEditContent(WikitextContent, string, integer, boolean, User, string, array, integer)

#8 /srv/data/web/vhosts/ EditPage->internalAttemptSave(array, boolean)

#9 /srv/data/web/vhosts/ EditPage->attemptSave(array)

#10 /srv/data/web/vhosts/ EditPage->edit()

#11 /srv/data/web/vhosts/ EditAction->show()

#12 /srv/data/web/vhosts/ SubmitAction->show()

#13 /srv/data/web/vhosts/ MediaWiki->performAction(Article, Title)

#14 /srv/data/web/vhosts/ MediaWiki->performRequest()

#15 /srv/data/web/vhosts/ MediaWiki->main()

#16 /srv/data/web/vhosts/ MediaWiki->run()

#17 {main}

Martynov Maxim (talkcontribs)

I guess that you added new namespace in wrong way. NS_* are numeric constants, but in your case it is a string because PHP understand this unknown value as a string.

You should add new namespace properly.

Nicolas NALLET (talkcontribs)

When I try

php maintenance/eval.php

> var_dump(NS_WIDGET);

I get


Martynov Maxim (talkcontribs)

Add something like var_dump(NS_WIDGET); into LocalSettings.php before passing this namespace into an extension, and give an output here.