Jump to content

Topic on Project:Support desk/Flow

Summary last edited by Theo SVV 11:22, 6 February 2022 2 years ago

Thanks again to User:Ciencia Al Poder for helping me big time.

To summarize: I probably went too fast in updating from an old wiki version, without checking prereqs and checking for errors. The solution was not too difficult, but out of my league, so I was happy to rely on the support desk.

Theo SVV (talkcontribs)

A while ago I updated my Wiki to 1.34.1 and since I have problems.

MediaWiki 1.34.1
PHP 7.3.33 (litespeed)
MariaDB 10.3.28-MariaDB-cll-lve
ICU 63.1


Whenever I try to create a new page, or upload a new image I get the error:

"/wiki/index.php?title=Test&action=edit&redlink=1 Wikimedia\Rdbms\DBQueryError from line 1603 of /home/someblabla/domains/mydomain.org/public_html/wiki/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?"


So I tried to run the updater from the browser, since I had no access to a command line. The updater gives no response at all, just a still..


So I moved the entire website to another provider, now I have command line. Today ran the updater from the command line. It runs for a short while until:


Adding log_actor field to table logging ...Wikimedia\Rdbms\DBQueryError from line 1603 of /home/someblabla/domains/mydomain.org/public_html/wiki/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: ALTER TABLE `logging`

ADD COLUMN log_actor bigint unsigned NOT NULL DEFAULT 0 AFTER log_user_text

Function: Wikimedia\Rdbms\Database::sourceFile( /home/someblabla/domains/mydomain.org/public_html/wiki/maintenance/archives/patch-logging-log_actor.sql )

Error: 1054 Unknown column 'log_user_text' in 'logging' (localhost)


Checked the database and yes, the log_user_text field is missing, explaining the above result.


So now I am kind of lost in how to proceed from here. I could probably alter the database manually with phpMyAdmin but I fear that it might explode in my face...


So, suggestions are appreciated! Thanks in advance.

Ciencia Al Poder (talkcontribs)

This is a weird situation. Does the log_actor field exists in the logging table? And does it contain data (i.e., not filled with nulls or zeroes)?

Old mediawiki versions had the log_user and log_user_text, but those fields have been replaced with log_actor. MediaWiki is trying to apply this update by adding the new log_actor field relative to the old fields that are no longer used, but failing because it doesn't exist.

Theo SVV (talkcontribs)

Thanks for responding. No it is not there. The existing columns are:

  • log_action
  • log_comment
  • log_comment_id
  • log_deleted
  • log_id
  • log_namespace
  • log_params
  • log_timestamp
  • log_title
  • log_type
  • log_user
Theo SVV (talkcontribs)

O and sorry for slow responding... Job takes a lot of time... :)

Ciencia Al Poder (talkcontribs)
Theo SVV (talkcontribs)

Thanks, I checked my logs. The upgrades from the past were:

  1. mediawiki 1.16.1
  2. mediawiki 1.19.4
  3. mediawiki 1.28
  4. mediawiki 1.34.1


I will try your suggested solutions and be back. Would you anticipate more problems in other tables?

Theo SVV (talkcontribs)

So, I made a backup of the database and ran the suggested patch. That went well. Then I ran the populateLogUsertext.php and it said:

...log_user_text column of logging table already populated.


Now the update.php results in this error:


Table logging contains log_user field. Dropping ...Wikimedia\Rdbms\DBQueryError from line 1603 of /home/someblabla/domains/mydomain.org/public_html/wiki/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: ALTER TABLE `archive`

DROP COLUMN ar_user,

DROP COLUMN ar_user_text,

ALTER COLUMN ar_actor DROP DEFAULT

Function: Wikimedia\Rdbms\Database::sourceFile( /home/someblabla/domains/mydomain.org/public_html/wiki/maintenance/archives/patch-drop-user-fields.sql )

Error: 1091 Can't DROP COLUMN `ar_user`; check that it exists (localhost)

Theo SVV (talkcontribs)

But: The symptoms are solved. I can create new pages, and upload new images... So the only question remaining is: is everything ok now...?

Ciencia Al Poder (talkcontribs)

I'd do similar checks:

See if the archive table has the ar_actor column populated with non-zero and non-null values. In that case, you can edit the maintenance/archives/patch-drop-user-fields.sql file manually and remove the DROP COLUMN ar_user and/or DROP COLUMN ar_user_text lines from it, and run update.php again, so it registers it as being run.

Theo SVV (talkcontribs)

ok so the ar_actor column was there and seems to be populated with integer values. So I did the thing you suggested.

Next error is in the ipblocks table:


Query: ALTER TABLE `ipblocks`

DROP COLUMN ipb_by,

DROP COLUMN ipb_by_text,

ALTER COLUMN ipb_by_actor DROP DEFAULT

Function: Wikimedia\Rdbms\Database::sourceFile( /home/someblabla/domains/mydomain.org/public_html/wiki/maintenance/archives/patch-drop-user-fields.sql )

Error: 1091 Can't DROP COLUMN `ipb_by`; check that it exists (localhost)


I checked the structure of the table and columns ipb_by and ipb_by_text are missing...

Ciencia Al Poder (talkcontribs)

You can manually edit the file and remove those lines:

  • DROP COLUMN ipb_by,
  • DROP COLUMN ipb_by_text,

and let the script continue

Theo SVV (talkcontribs)

Well it took me a little time to figure it out by your examples, and I literally had to delete all DROP statements from the patch-drop-user-fields.sql script. Now the update.php has completed to a normal end, so I suppose that the installation is OK now.

Thanks big time for your help. I will leave this ticket open for some time in case you (or anybody for that matter) like to leave me another comment or advice..