Page MenuHomePhabricator

Improving message "databaseerror-text"
Closed, ResolvedPublicFeature

Description

In September this message was introduced which basically only says that there is something in the water.

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

What about rephrasing it to

"A database query error has occurred. Please contact the system administrator. See also the manual on how [[Manual:How to debug#SQL errors|to debug SQL errors]]."

or shorter

"A database query error has occurred. See the manual on how [[Manual:How to debug#SQL errors|to debug SQL errors]]."

Thus it would also provide a hint on how to help the cause. I personally opt for the shorter version. Perhaps you have different ideas on how to rephrase it, if at all.


Version: 1.24rc
Severity: enhancement

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:57 AM
bzimport set Reference to bz61419.

Do not know why I removed the "This may ..." part. So the suggestion is:

"A database query error has occurred. This may indicate a bug in the software. See the manual on how [[Manual:How to debug#SQL errors|to debug SQL errors]]."

I don't understand: what's the intended audience in your proposal? The page you propose to link is meant for sysadmins and devs, while the error message is mainly for users I think.
If you/we want the message to work for users, another page is needed (or some user-centric section in the same page).

Currently this message has no intended audience and is thus as useless as ... Since my original proposal turns out to be too specific I suggest "A database query error has occurred. This may indicate a bug in the software. Please contact the system administrator." or the like.

I would like to work on this bug.Please assign me this bug.

(In reply to Joyce from comment #4)

I would like to work on this bug.Please assign me this bug.

You can do so yourself now.
https://www.mediawiki.org/wiki/Git/Tutorial explains how to make the most important bug status change, adding a patch. ;-)

Can I know in which repository is this?

(In reply to Joyce from comment #6)

Can I know in which repository is this?

MediaWiki core, see the "product" and "component" above. For the file, see [[mw:Localisation]].

Change 171540 had a related patch set uploaded by Joyceg:
My commit message

https://gerrit.wikimedia.org/r/171540

Change 171540 had a related patch set uploaded by Joyceg:
Bug: Bug 61419 - Improving message "databaseerror-text" Change-Id:I55862204ef71f69bc88c79fe2259f7cb8365699a I have fixed the bug by rephrasing the error message

https://gerrit.wikimedia.org/r/171540

Change 171562 had a related patch set uploaded by Joyceg:
Improving message "databaseerror-text"

https://gerrit.wikimedia.org/r/171562

Change 171540 abandoned by Alex Monk:
Bug: Bug 61419 - Improving message "databaseerror-text" Change-Id:I55862204ef71f69bc88c79fe2259f7cb8365699a I have fixed the bug by rephrasing the error message

https://gerrit.wikimedia.org/r/171540

Joyceg set Security to None.
Joyceg removed Joyceg as the assignee of this task.Mar 2 2015, 3:21 PM
Joyceg unsubscribed.

Can I know when is this message generated?

MarcoAurelio removed a project: Patch-For-Review.
MarcoAurelio moved this task from Doing to Backlog on the good first task board.
MarcoAurelio added a subscriber: Joyceg.

@marcelonoliveira90: Hi, thanks for claiming this task. Do you need any help? How is your progress? :)

@Aklapper: I think I've found a solution to this issue. As suggested here, some sort of code change has to be made to process the HTML inside the error message. So, in order to render the HTML link correctly, I've made a change into the code to process messages using a rawElement just when it's a database error. However, I'm not sure if it's the best approach, cause if there is another case in which HTML must be processed (instead of escaped) it would be necessary another change in the code, what could be hard to maintain. I have not a better solution in mind. So I'm going to commit that and see what the reviewer will say.

Feel free to share your patch on Gerrit, or amend the existing patch.

Change 469503 had a related patch set uploaded (by Marcelonoliveira90; owner: Marcelonoliveira90):
[mediawiki/core@master] MWExceptionRenderer: Improve the message shown when a database error occurs

https://gerrit.wikimedia.org/r/469503

Please I would like to know if this issue has been fixed

Hi @Tobestjoel, thanks for taking the time to report this and welcome to Wikimedia Phabricator! No, see the open patch, and see the upper left corner of this task: Its status is "Open". (If you have any questions about Phabricator itself, please see mw:Phabricator/Help.)

Hi @Tobestjoel, thanks for taking the time to report this and welcome to Wikimedia Phabricator! No, see the open patch, and see the upper left corner: It says "Open". (If you have any questions about Phabricator itself, please see mw:Phabricator/Help.)

I am new to open-source. Please assign me this issue

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:23 PM
Diesel_kapasule changed the task status from Open to In Progress.Mar 2 2022, 3:28 PM
Diesel_kapasule claimed this task.

Change 767798 had a related patch set uploaded (by Diesel kapasule; author: Diesel kapasule):

[mediawiki/core@master] Improving message "databaserror-text"

https://gerrit.wikimedia.org/r/767798

Change 767798 abandoned by Diesel kapasule:

[mediawiki/core@master] Improving message "databaserror-text"

Reason:

Too many conflicts

https://gerrit.wikimedia.org/r/767798

Change 768107 had a related patch set uploaded (by Diesel kapasule; author: Diesel kapasule):

[mediawiki/core@master] Improving message "databaserror-text"

https://gerrit.wikimedia.org/r/768107

In what scenario is this message shown?
When it is shown, is the wikitext actually parsed?
When it is shown, what else do we show instead?

The scenario I tested is to make a typo in the query from WikiPage::getQueryInfo by changing page_id to page_xyz. This results in a DBQueryError on every page.

This is what it looks like today on master without the above change:

MediaWiki internal error.

Original exception: [db49ca7e9136755ce8133118] /wiki/Main_Page Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading or after adding a new extension?

Please see https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Upgrading and https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:How_to_debug for more information.

Error 1: no such column: page_idz
Function: WikiPage::pageData
Query: SELECT page_idz,

This tells me that:

  • The message is not parsed, because when database errors ocurr we cannot savely invoke the MW parser generally and so it is shown as plain text. This means that if we add this link, it should be plain text, not using [ syntax.
  • The link for How_to_debug is already there. This comes from MWExceptionHandler::getLogMessage().

@Krinkle on which page did you trigger databaseError- text? Could you kindly share the steps! Thanks!

The database-error text message is added from MWExceptionHandler::getLogMessage() .Therefore ticket is already resolved.

Change 768107 abandoned by Diesel kapasule:

[mediawiki/core@master] rdbms: Improve message "databaseerror-text"

Reason:

Ticket solved already

https://gerrit.wikimedia.org/r/768107

@Krinkle on which page did you trigger databaseError- text? Could you kindly share the steps! Thanks!

I loaded /wiki/Main_Page in the browser. It should work for any page. Before I loaded the page, I modified WikiPage::getQueryInfo in includes/WikiPages.php.

@Diesel_kapasule Thanks again for the patch. I'm sorry it turned out this was already solved. I hope it was a somewhat useful excercise nonetheless.

If you would like help to find an area of your interest to contribute to, feel free to ask on IRC. Or simply pick something else from good first task and patch-welcome.

Change 469503 abandoned by Bartosz Dziewoński:

[mediawiki/core@master] MWExceptionRenderer: Improve the message shown when a database error occurs

Reason:

https://gerrit.wikimedia.org/r/469503