Jump to content

Topic on Project:Support desk

Problem with updating from 1.40 to 1.42.1

15
Monocero (talkcontribs)

Hi. I want to update MediaWiki from version 1.40 to 1.42.1 and during the update I get this error:

Updating category collations... Selecting next 100 pages from cl_from = 0... processing... 0 done. Selecting next 100 pages from cl_from = 100... processing... 0 done. Selecting next 100 pages from cl_from = 200... processing... 0 done. Selecting next 100 pages from cl_from = 300... processing... 0 done. Selecting next 100 pages from cl_from = 400... processing... 0 done. Selecting next 100 pages from cl_from = 500... processing... 0 done. Selecting next 100 pages from cl_from = 600... processing... 0 done. Selecting next 100 pages from cl_from = 700... processing... 0 done. Selecting next 100 pages from cl_from = 800... processing... 0 done. Selecting next 100 pages from cl_from = 900... processing... 0 done. Selecting next 100 pages from cl_from = 1000... processing... 0 done. Selecting next 100 pages from cl_from = 1100... processing... 0 done. Selecting next 100 pages from cl_from = 1200... processing... 0 done. Selecting next 100 pages from cl_from = 1300... processing... 0 done. Selecting next 100 pages from cl_from = 1400... processing... 0 done. Selecting next 100 pages from cl_from = 1500... processing... 0 done. Selecting next 100 pages from cl_from = 1600... processing... 0 done. Selecting next 100 pages from cl_from = 1700... processing... 0 done. 0 rows processed ...done. ...have rev_actor field in revision table. ...watchlist_expiry table already exists. ...page_restrictions field does not exist in page table, skipping modify field patch. ...index ipb_address_unique already set on ipblocks table. ...archive table does not contain ar_text_id field. ...lc_lang is up-to-date. ...ll_lang is up-to-date. ...site_language is up-to-date. ...index ipb_address_unique on table ipblocks has no field ipb_anon_only; added. ...ipb_address_unique index up-to-date. ...actor_name in table actor already modified by patch patch-actor-actor_name-varbinary.sql. ...site_global_key in table sites already modified by patch patch-sites-site_global_key.sql. ...iwl_prefix in table iwlinks already modified by patch patch-extend-iwlinks-iwl_prefix.sql. ...rd_title in table redirect already modified by patch patch-redirect-rd_title-varbinary.sql. ...pl_title in table pagelinks already modified by patch patch-pagelinks-pl_title-varbinary.sql. ...tl_title field does not exist in templatelinks table, skipping modify field patch. ...il_to in table imagelinks already modified by patch patch-imagelinks-il_to-varbinary.sql. ...ll_title in table langlinks already modified by patch patch-langlinks-ll_title-varbinary.sql. ...iwl_title in table iwlinks already modified by patch patch-iwlinks-iwl_title-varbinary.sql. ...cat_title in table category already modified by patch patch-category-cat_title-varbinary.sql. ...qc_title in table querycache already modified by patch patch-querycache-qc_title-varbinary.sql. ...qcc_title in table querycachetwo already modified by patch patch-querycachetwo-qcc_title-varbinary.sql. ...wl_title in table watchlist already modified by patch patch-watchlist-wl_title-varbinary.sql. ...user_last_timestamp in table user_newtalk already modified by patch patch-user_newtalk-user_last_timestamp-binary.sql. ...pt_title in table protected_titles already modified by patch patch-protected_titles-pt_title-varbinary.sql. ...ir_type in table ipblocks_restrictions already modified by patch patch-ipblocks_restrictions-ir_type.sql. ...index wl_namespace_title already set on watchlist table. ...job_title in table job already modified by patch patch-job-job_title-varbinary.sql. ...job_timestamp in table job already modified by patch patch-job_job_timestamp.sql. ...job_token_timestamp in table job already modified by patch patch-job_job_token_timestamp.sql. ...wl_notificationtimestamp in table watchlist already modified by patch patch-watchlist-wl_notificationtimestamp.sql. ...role_id in table slot_roles already modified by patch patch-slot_roles-role_id.sql. ...model_id in table content_models already modified by patch patch-content_models-model_id.sql. ...cl_to in table categorylinks already modified by patch patch-categorylinks-cl_to-varbinary.sql. ...log_title in table logging already modified by patch patch-logging-log_title-varbinary.sql. ...us_timestamp in table uploadstash already modified by patch patch-uploadstash-us_timestamp.sql. ...index up_property already set on user_properties table. ...index site_global_key already set on sites table. ...index log_type_time already set on logging table. ...fa_name in table filearchive already modified by patch patch-filearchive-fa_name.sql. ...oi_name in table oldimage already modified by patch patch-oldimage-oi_name-varbinary.sql. ...exptime in table objectcache already modified by patch patch-objectcache-exptime-notnull.sql. ...index ar_name_title_timestamp already set on archive table. ...img_name in table image already modified by patch patch-image-img_name-varbinary.sql. ...img_timestamp in table image already modified by patch patch-image-img_timestamp.sql. ...index si_key already set on site_identifiers table. ...rc_title in table recentchanges already modified by patch patch-recentchanges-rc_title-varbinary.sql. ...rc_timestamp in table recentchanges already modified by patch patch-recentchanges-rc_timestamp.sql. ...rc_id in table recentchanges already modified by patch patch-recentchanges-rc_id.sql. ...index rc_new_name_timestamp already set on recentchanges table. ...ar_title in table archive already modified by patch patch-archive-ar_title-varbinary.sql. ...page_title in table page already modified by patch patch-page-page_title-varbinary.sql. ...user_name in table user already modified by patch patch-user_table-updates.sql. ...index rev_page_timestamp already set on revision table. ...have modtoken field in objectcache table. ...index oi_timestamp already set on oldimage table. ...index page_name_title already set on page table. ...index ct_rc_tag_id already set on change_tag table. ...page_restrictions table does not contain pr_user field. ...fa_id in table filearchive already modified by patch patch-filearchive-fa_id.sql. ...img_major_mime in table image already modified by patch patch-image-img_major_mime-default.sql. ...linktarget table already exists. ...rev_page_id key doesn't exist. ...pr_page in table page_restrictions already modified by patch patch-page_restrictions-pr_page.sql. ...pp_page in table page_props already modified by patch patch-page_props-pp_page.sql. ...ir_value in table ipblocks_restrictions already modified by patch patch-ipblocks_restrictions-ir_value.sql. ...have tl_target_id field in templatelinks table. ...user_autocreate_serial table already exists. ...ir_ipb_id in table ipblocks_restrictions already modified by patch patch-ipblocks_restrictions-ir_ipb_id.sql. ...ipb_id in table ipblocks already modified by patch patch-ipblocks-ipb_id.sql. ...user_editcount in table user already modified by patch patch-user-user_editcount.sql. Running maintenance/migrateRevisionActorTemp.php... ...Update 'MigrateRevisionActorTemp' already logged as completed. Use --force to run it again. done. ...revision_actor_temp doesn't exist. Running maintenance/updateRestrictions.php... Migration is not needed. done. ...page table does not contain page_restrictions field. ...templatelinks table has already been migrated. ...tl_namespace field does not exist in templatelinks table, skipping modify field patch. ...templatelinks table does not contain tl_title field. ...have el_to_path field in externallinks table. ...have user_is_temp field in user table. Running maintenance/migrateRevisionCommentTemp.php... ...Update 'MigrateRevisionCommentTemp' already logged as completed. Use --force to run it again. done. ...revision_comment_temp doesn't exist. Running maintenance/migrateExternallinks.php... ...Update 'MigrateExternallinks' already logged as completed. Use --force to run it again. done. ...el_to field does not exist in externallinks table, skipping modify field patch. ...have pl_target_id field in pagelinks table. ...externallinks table does not contain el_to field. Running maintenance/fixInconsistentRedirects.php... ...Update 'FixInconsistentRedirects' already logged as completed. Use --force to run it again. done. ...img_size in table image already modified by patch patch-image-img_size_to_bigint.sql. ...fa_size in table filearchive already modified by patch patch-filearchive-fa_size_to_bigint.sql. ...oi_size in table oldimage already modified by patch patch-oldimage-oi_size_to_bigint.sql. ...us_size in table uploadstash already modified by patch patch-uploadstash-us_size_to_bigint.sql. Adding uas_year field to table user_autocreate_serial...done. Creating block_target table...done. Dropping cl_collation_ext index from table categorylinks...done. Running maintenance/populateUserIsTemp.php... done. Dropping site_type index from table sites...done. Dropping iwl_prefix_from_title index from table iwlinks...done. Running /home/xx/xx/x/wiki/extensions/OATHAuth/maintenance/updateTOTPScratchTokensToArray.php...

An error occurred: Error 1044: Access denied for user '12345_wiki'@'%' to database 'virtual' Function: Wikimedia\Rdbms\DatabaseMySQL::doSelectDomain Query: USE `virtual`

Please help.

TheDJ (talkcontribs)

Do you run a separate wgOATHAuthDatabase (and/or what is the current setting) or do you use wgSharedTables ?

Monocero (talkcontribs)

I downloaded the 1.42.1 package from the MediaWiki website, sent the contents of the files from this package to the FTP server, overwriting the current ones. I started the update process.

Example:

mysite.pl/wiki/mw-config

I entered the $wgUpgradeKey from LocalSettings.php on the update page and then I get these errors.

And I don't understand why I have a connection error:

An error occurred: Error 1044: Access denied for user '12345_wiki'@'%' to database 'virtual' Function: Wikimedia\Rdbms\DatabaseMySQL::doSelectDomain Query: USE `virtual`

And I don't understand why I have this error:

/home/xx/xx/x/wiki/extensions/OATHAuth/maintenance/updateTOTPScratchTokensToArray.php...

I don't have anything like $wgOATHAuthDatabase or wgSharedTables in the LocalSettings.php file

TheDJ (talkcontribs)

Ah.

> overwriting the current ones

But that doesn't delete the files that have been removed, which can cause issues when loading the site. Please read again Manual:Upgrading.

Additionally, you didn't update your extensions yet and therefor your OathAuth extension is not compatible with this newer MediaWiki version. You can either choose to update all your extensions, or a bit easier / less confusing, can be to

  1. first disable all your extension in LocalSettings.php
  2. upgrade the core with the updater
  3. install the newer versions of extensions
  4. re-enable the extensions in your LocalSettings.php
  5. run the updater again to ensure the extensions can run all their updates
Monocero (talkcontribs)

Hi. I left only the images directory and the LocalSettings.php file on the server, then I uploaded new content from the mediawiki-1.42.1 package and the latest versions of the extensions I use. I started the MediaWiki update process and I get the same error:

...site_type key doesn't exist. ...iwl_prefix_from_title key doesn't exist. Running /home/xx/xx/mysite.pl/wiki/extensions/OATHAuth/maintenance/updateTOTPScratchTokensToArray.php...

An error occurred: Error 1044: Access denied for user '12345_wiki'@'%' to database 'virtual' Function: Wikimedia\Rdbms\DatabaseMySQL::doSelectDomain Query: USE `virtual`

Bawolff (talkcontribs)

You are like the fourth person to report this. Would you be able to post your LocalSettings.php (redacting passwords)

80.108.171.42 (talkcontribs)

Can u provide working OATHAuth config please

wfLoadExtension( 'OATHAuth' );

but using according to Extension:OATHAuth#Configuration

$wgVirtualDomainsMapping['virtual-oathauth'] = [ 'db' => 'centraloath' ];

throws

An error occurred:

Error 1044: Access denied for user 'user'@'localhost' to database 'virtual'

Function: Wikimedia\Rdbms\DatabaseMySQL::doSelectDomain

Query: USE `virtual`

Monocero (talkcontribs)

Which data do you want to see? Do you mean the entire contents of this file? How did those people solve this problem? These are the extensions I have installed:

CreatePageUw DarkMode PageForms TinyMCE

This is the skin I have installed:

Citizen

Bawolff (talkcontribs)

None of them did (afaik). I was just hoping that the LocalSettings.php file would reveal some difference in configuration that might hint at what the issue is.

Monocero (talkcontribs)

I uploaded MediaWiki 1.41.0 files and when updating I have the following error:

...oathauth_types table already exists. ...have module field in oathauth_users table. ...oathauth_users table does not contain secret field. Running /home/xx/xx/mysite.pl/wiki/extensions/OATHAuth/maintenance/UpdateForMultipleDevicesSupport.php...

An error occurred: No such service: OATHAuthDatabase

Buran Biggest Fan (talkcontribs)

I had the same problem. The problem lies solely in the extension OATHAuth and it was solved after removing it from the extensions folder and copying it back from a backup.


In short, having the newest mediawiki with an old version of the extension.

Monocero (talkcontribs)

@Bawolff

This bug with the 1.42.1 update comes from MediaWiki, probably from the OATHAuth extension. I did as @Buran Biggest Fan mentioned, I removed the OATHAuth extension from the 'extensions' directory on the server, in the LocalSettings.php file I removed the code wfLoadExtension( 'OATHAuth' ); that loads this extension and I was able to successfully update MediaWiki from 1.40 to 1.41.0. Then I uploaded this extension from the 1.41 package. I am not going to upgrade to 1.42.1 because there is bug:

/home/xx/xx/x/wiki/extensions/OATHAuth/maintenance/updateTOTPScratchTokensToArray.php... An error occurred: Error 1044: Access denied for user '12345_wiki'@'%' to database 'virtual' Function: Wikimedia\Rdbms\DatabaseMySQL::doSelectDomain Query: USE `virtual`

When version 1.43 comes out, I will update MediaWiki.

@Buran Biggest Fan

Thank you for your post. You helped me.

Bawolff (talkcontribs)

Yes, but we still have no idea why, as most people do not seem to experience this bug, so devs haven't been able to figure out what is going on. If there is anything different about your setup compared to the average mediawiki setup, please let us know.

Monocero (talkcontribs)

I understand, I will paste you the content I added in LocalSettings.php, but I did a test before updating, I removed this content from LocalSettings.php and during the update I also got this error.

# PERSONAL CONFIGURATION:

# * - Group of guests
# user - Users group
# autoconfirmed - Confirmed users

# Restriction on creating all pages:

# Only users with accounts older than four days can create pages
# Requires MW 1.6 or later version

$wgGroupPermissions['*'            ]['createpage'] = false; // Guests cannot create pages
$wgGroupPermissions['user'         ]['createpage'] = false; // Users cannot create pages
$wgGroupPermissions['autoconfirmed']['createpage'] = true;  // Verified users can create pages

# Editing restriction

$wgGroupPermissions['*']['edit'] = false; // Guests cannot edit pages
$wgGroupPermissions['user']['edit'] = false; // Users cannot edit pages
$wgGroupPermissions['autoconfirmed']['edit'] = true; // Confirmed users can edit pages

# Allowed file types that can be uploaded

$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );

# Disallowed file types that cannot be uploaded

/**
 * Files with these extensions will not be able to be uploaded
 * An array of file extensions to blacklist
 * If you want to blacklist additional files, you should add them to this array
 */
$wgProhibitedFileExtensions = [
	# HTML may contain JavaScript that steals cookies and web errors
	'html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht',
	# PHP scripts can execute arbitrary code on the server
	'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'phar',
	# Other file types that may be interpreted by some servers
	'shtml', 'jhtml', 'pl', 'py', 'cgi',
	# It may contain malicious executable files for Windows victims
	'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl',
    # T341565
	'xml',	
];

# Allowed file upload size from computer and link

$wgMaxUploadSize = [
    '*' => 500 * 1024, // 500 KB - File size from your computer
    'url' => 500 * 1024, // 500 KB - File size from link
];

# Warning when uploading a file over 500 KB

$wgUploadSizeWarning = 500 * 1024;

# Regular users cannot upload the file

$wgGroupPermissions['user']['upload'] = false;

# Confirmed users can upload a file and resend the file to the server

$wgGroupPermissions['autoconfirmed']['upload'] = true;
$wgGroupPermissions['autoconfirmed']['reupload'] = true;

# Verified users can upload the file via the link

$wgGroupPermissions['autoconfirmed']['upload_by_url'] = true;
$wgAllowCopyUploads = true;
$wgCopyUploadsFromSpecialUpload = true;

# Enabling the CreatePageUw extension - Create a page

wfLoadExtension( 'CreatePageUw' );

# Enable the ConfirmEdit extension - CAPTCHA against spambots

wfLoadExtension( 'ConfirmEdit' );

# QuestyCaptcha

wfLoadExtensions([ 'ConfirmEdit', 'ConfirmEdit/QuestyCaptcha' ]);

# Add your questions in LocalSettings.php using this format:

$wgCaptchaQuestions = [
	'xx' => 'xx', // In response, the letter size does not matter
	'xx' => 'xx', // In response, the letter size does not matter
	'xx' => 'xx', // In response, the letter size does not matter
	'xx' => [ 16, 'xx' ], // The question may have many answers
];

$wgMainCacheType    = CACHE_ANYTHING;
$wgCaptchaTriggers['edit']          = true;
$wgCaptchaTriggers['create']        = true;
$wgCaptchaTriggers['createtalk']    = true;
$wgCaptchaTriggers['addurl']        = true;
$wgCaptchaTriggers['createaccount'] = true;
$wgCaptchaTriggers['badlogin']      = true;

# User must confirm email address before they can edit

$wgEmailConfirmToEdit = true;

# Enabling the TinyMCE extension - WYSIWYG editor

wfLoadExtension( 'TinyMCE' );
$wgTinyMCEEnabled = true;

# Displaying the TinyMCE editor when creating a new page in the CreatePageUw extension.

$wgCreatePageUwUseTMCE = true;

# Enabling the Page Forms extension

wfLoadExtension( 'PageForms' );

# Access the Edit tab using the form

$wgGroupPermissions['*']['viewedittab'] = false; // Guests do not have access to edit using the form
$wgGroupPermissions['user']['viewedittab'] = false; // Users do not have access to edit using the form
$wgGroupPermissions['sysop']['viewedittab'] = true; // Administrators have access to editing via the form

# Enabling the DarkMode extension

wfLoadExtension( 'DarkMode' );

# Enabling the Citizen skin

wfLoadSkin( 'Citizen' );
Bawolff (talkcontribs)

We believe this is a problem with the web upgrader that can be worked around by using the command line update.php script

Reply to "Problem with updating from 1.40 to 1.42.1"