Topic on Project:Support desk

Jump to: navigation, search

[RESOLVED] Database error in upgrading from 1.18 to 1.22

12
113.193.104.33 (talkcontribs)

Hi, I am trying to upgrade wiki 1.18 to 1.22. I uploaded wiki-22 files, copied Localsettings.php to the folder, ran mw-config/index.php from web browser, then got this error:

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

How should I fix this error? Your help is much appreciated.

My current version: MediaWiki 1.18.0 PHP 5.3.24 (cgi-fcgi) MySQL 5.0.96-log

Thanks, Vikas

88.130.102.228 (talkcontribs)

Hi Vikas,

at the end of your LocalSettings.php file add

$wgShowSQLErrors = 1;

and run the update script again. What error message do you get?

113.193.104.33 (talkcontribs)

Thanks for reply.

This says:

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

Query: SELECT page_id,page_namespace,page_title,page_restrictions,page_counter,page_is_redirect,page_is_new,page_random,page_touched,page_latest,page_len,page_content_model FROM `jainwikipage` WHERE page_namespace = '0' AND page_title = 'Mw-config/index.php' LIMIT 1 Function: WikiPage::pageData Error: 1054 Unknown column 'page_content_model' in 'field list' (jainwikiuser.db.7394013.hostedresource.com)

88.130.102.228 (talkcontribs)

The interesting part in that message is:

Function: WikiPage::pageData Error: 1054 Unknown column 'page_content_model' in 'field list' (jainwikiuser.db.7394013.hostedresource.com)

The updater obviously expects the column "page_content_model" to be in your database, but it is not. As afirst step, I would take a backup of the database and just try the update again.

If that does not help, have a look at this thread, where the same problem has been discussed. Basically some hack to add and remove the column at the start of the update... This is actually not the same problem, sorry.

Bawolff (talkcontribs)

The database query indicates you are not running the web configurations script, but actually going to the page "Mw-config/index.php" on your wiki. Possibly you have rewrite rules set up that prevent you from accessing mw-config/index.php properly. If possible try running update.php from the command line, otherwise investigate getting to the actual web updater.

1.23.179.84 (talkcontribs)

I had write permission rules in LocalSettings.php which I removed, but still had the same error. My SSH doesn't allow me to run PHP commands. It says command not found. How can I get that running?

1.23.179.84 (talkcontribs)

I read that page before too, but couldn't follow much. But again read that, inserted a column that was missing in page table. Then ran mw-config/index.php from Web, I get this error.

Mw-config/index.php There is currently no text in this page. You can search for this page title in other pages, search the related logs, or edit this page.

When I go to main page, it doesn't show data. Clicking on recent changes, it shows recent changes in pages. However trying to open any of the page, it gives this error:

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

Query: SELECT rev_id,rev_page,rev_text_id,rev_timestamp,rev_comment,rev_user_text,rev_user,rev_minor_edit,rev_deleted,rev_len,rev_parent_id,rev_sha1,rev_content_format,rev_content_model,page_namespace,page_title,page_id,page_latest,page_is_redirect,page_len,user_name FROM `jainwikirevision` INNER JOIN `jainwikipage` ON ((page_id = rev_page)) LEFT JOIN `jainwikiuser` ON ((rev_user != 0) AND (user_id = rev_user)) WHERE page_id = '4232' AND rev_id = '8256' LIMIT 1 Function: Revision::fetchFromConds Error: 1054 Unknown column 'rev_sha1' in 'field list' (jainwikiuser.db.7394013.hostedresource.com)

What should I do to update?

88.130.123.192 (talkcontribs)

When you actually end up on the page Mw-config/... with capital "M", then you have RewriteRules, which interfere with the update script. For the time of the upgrade you can try renaming the file .htaccess to something else. This will break the output of your wiki, but it should allow you to run the web updater.

I have added hints on what to do when you cannot run php update.php from the shell to the page Upgrade.

1.23.179.237 (talkcontribs)

Thanks a lot for helping with this. I renamed .htaccess and then followed the instructions. It is working well now. I somehow don't remember renaming .htaccess when I last upgrade to .18 version. I'll keep this in mind next time.

Thanks again, Vikas

88.130.123.192 (talkcontribs)

Always follow the information on page Upgrade. This is the most up to date upgrade guide and it contains all the things you need to know. I have just added the information about interfering RewriteRules there as well.

210.89.56.38 (talkcontribs)

A database query error has occurred. This may indicate a bug in the software. Query: SELECT user_claim FROM `user` WHERE user_id= Function: SkinTemplate::buildPersonalUrls Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near at line 1 (localhost) please help me

88.130.67.150 (talkcontribs)

I can only guess as the MySQL error you posted does not contain information on the actual error, but maybe the column user_claim is not present in the DB? Run update.php to fix!

Reply to "[RESOLVED] Database error in upgrading from 1.18 to 1.22"