Topic on Project:Support desk/Flow

Upgrade error regarding OAUth database

14
TolimMcLugen (talkcontribs)

Hi,

I am upgrading mediawiki from 1.33.1 to 1.42.1. I used a 1.35 version to upgrade DB without error. But now I get an error logging in

[eb40b7f6f59133a091c0fa4a] /index.php/Speciale:Entra 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 <nowiki>https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Upgrading</nowiki> and <nowiki>https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:How_to_debug</nowiki> for more information.

Error 1146: Table 'my_wiki.oathauth_devices' doesn't exist

Function: MediaWiki\Extension\OATHAuth\OATHUserRepository::loadKeysFromDatabase

Query: SELECT oad_id,oad_data,oat_name FROM `oathauth_devices` JOIN `oathauth_types` ON ((oat_id = oad_type)) WHERE oad_user = 1

So i tried the web-version of the upgrader. and I get this error.

Running /var/www/html/mediawiki/extensions/OATHAuth/maintenance/UpdateForMultipleDevicesSupport.php...

An error occurred:

Error 1049: Unknown database 'virtual'

Function: Wikimedia\Rdbms\DatabaseMySQL::doSelectDomain

Query: USE `virtual`

Any clue? I think that the upgrading script it's getting stucked in that part. Oauth is not something I need I think

Bawolff (talkcontribs)

Multiple people have reported this, however we are having trouble seeing the error ourselves and haven't been able to figure out the cause. If there is anything special about your install please let us know.

Yes, a work around is to disable the oathAuth extension if you dont need 2fa.

TolimMcLugen (talkcontribs)

Thanks for reply We are testing if we can use it as a company repository for guides and internal know how. If you need some file to track the bug I can send it to you

If I'll need oauth maybe I'll export the few pages and put it into a new fresh install

Best

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

SyncmasterN (talkcontribs)

I am experiencing the same problem after upgrading from v1.40 to 1.42.1.

Running php maintenance/run.php update does not solve the problem.

Only workaround for now was to disable the extension.

88.103.181.198 (talkcontribs)

the same issue. going from the 1.35.4 to 1.42.1


wa used

DenverChess (talkcontribs)

I also ran into this issue yesterday. After further reviewing the sources for both the 1_41 and 1_42 branch's extensions (not MediaWiki itself) I discovered that the errors we're all reporting here were due to changes those extensions (AbuseFilter and OATHAuth) made in the database schema when upgrading from 1_41 to 1_42 that weren't accounted for by the extensions in 1_42 (they expected those changes to already be there).


I had to upgrade from 1_40 to 1_41 first and then dump my database and import it into 1_42, run the maintenance run update.php and now all seems to be correct and fully functional right off the bat.

If you try to upgrade from 1_40 to 1_42 without getting those extension's database changes that were included in 1_41 and you just disable them as a workaround, those core extensions could potentially never work again (unless the authors of the extensions include checks for the work they did in 1_41 in later versions).

TerryDuchastel (talkcontribs)

I have the same problem. I updated from 1.36 to 1.42.3 directly.


Now I get this error:


[1d3af140767aa7e702b0db4b] /wiki/Special:SpecialPages 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 1146: Table 'my_wiki.oathauth_devices' doesn't exist

Function: MediaWiki\Extension\OATHAuth\OATHUserRepository::loadKeysFromDatabase

Query: SELECT oad_id,oad_data,oat_name FROM `oathauth_devices` JOIN `oathauth_types` ON ((oat_id = oad_type)) WHERE oad_user = 1

Backtrace:

from /var/lib/mediawiki-1.42/includes/libs/rdbms/database/Database.php(1203)

#0 /var/lib/mediawiki-1.42/includes/libs/rdbms/database/Database.php(1187): Wikimedia\Rdbms\Database->getQueryException()

#1 /var/lib/mediawiki-1.42/includes/libs/rdbms/database/Database.php(1161): Wikimedia\Rdbms\Database->getQueryExceptionAndLog()

#2 /var/lib/mediawiki-1.42/includes/libs/rdbms/database/Database.php(652): Wikimedia\Rdbms\Database->reportQueryError()

#3 /var/lib/mediawiki-1.42/includes/libs/rdbms/database/Database.php(1350): Wikimedia\Rdbms\Database->query()

#4 /var/lib/mediawiki-1.42/includes/libs/rdbms/database/DBConnRef.php(119): Wikimedia\Rdbms\Database->select()

#5 /var/lib/mediawiki-1.42/includes/libs/rdbms/database/DBConnRef.php(351): Wikimedia\Rdbms\DBConnRef->__call()

#6 /var/lib/mediawiki-1.42/includes/libs/rdbms/querybuilder/SelectQueryBuilder.php(729): Wikimedia\Rdbms\DBConnRef->select()

#7 /var/lib/mediawiki-1.42/extensions/OATHAuth/src/OATHUserRepository.php(342): Wikimedia\Rdbms\SelectQueryBuilder->fetchResultSet()

#8 /var/lib/mediawiki-1.42/extensions/OATHAuth/src/OATHUserRepository.php(79): MediaWiki\Extension\OATHAuth\OATHUserRepository->loadKeysFromDatabase()

#9 /var/lib/mediawiki-1.42/extensions/OATHAuth/src/Special/OATHManage.php(77): MediaWiki\Extension\OATHAuth\OATHUserRepository->findByUser()

#10 /var/lib/mediawiki-1.42/vendor/wikimedia/object-factory/src/ObjectFactory.php(240): MediaWiki\Extension\OATHAuth\Special\OATHManage->__construct()

#11 /var/lib/mediawiki-1.42/vendor/wikimedia/object-factory/src/ObjectFactory.php(149): Wikimedia\ObjectFactory\ObjectFactory::getObjectFromSpec()

#12 /var/lib/mediawiki-1.42/includes/specialpage/SpecialPageFactory.php(1501): Wikimedia\ObjectFactory\ObjectFactory->createObject()

#13 /var/lib/mediawiki-1.42/includes/specialpage/SpecialPageFactory.php(1539): MediaWiki\SpecialPage\SpecialPageFactory->getPage()

#14 /var/lib/mediawiki-1.42/includes/specials/SpecialSpecialPages.php(64): MediaWiki\SpecialPage\SpecialPageFactory->getUsablePages()

#15 /var/lib/mediawiki-1.42/includes/specials/SpecialSpecialPages.php(53): MediaWiki\Specials\SpecialSpecialPages->getPageGroups()

#16 /var/lib/mediawiki-1.42/includes/specialpage/SpecialPage.php(719): MediaWiki\Specials\SpecialSpecialPages->execute()

#17 /var/lib/mediawiki-1.42/includes/specialpage/SpecialPageFactory.php(1669): MediaWiki\SpecialPage\SpecialPage->run()

#18 /var/lib/mediawiki-1.42/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath()

#19 /var/lib/mediawiki-1.42/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()

#20 /var/lib/mediawiki-1.42/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()

#21 /var/lib/mediawiki-1.42/index.php(58): MediaWiki\MediaWikiEntryPoint->run()

#22 {main}

TerryDuchastel (talkcontribs)

And perhaps not too surprisingly, that table does not exist:


MariaDB [(none)]> show tables from my_wiki;

+------------------------+

| Tables_in_my_wiki      |

+------------------------+

| actor                  |

| archive                |

| block                  |

| block_target           |

| bot_passwords          |

| category               |

| categorylinks          |

| change_tag             |

| change_tag_def         |

| comment                |

| content                |

| content_models         |

| externallinks          |

| filearchive            |

| image                  |

| imagelinks             |

| interwiki              |

| ip_changes             |

| ipblocks               |

| ipblocks_restrictions  |

| iwlinks                |

| job                    |

| l10n_cache             |

| langlinks              |

| linktarget             |

| log_search             |

| logging                |

| module_deps            |

| oathauth_users         |

| objectcache            |

| oldimage               |

| page                   |

| page_props             |

| page_restrictions      |

| pagelinks              |

| protected_titles       |

| querycache             |

| querycache_info        |

| querycachetwo          |

| recentchanges          |

| redirect               |

| revision               |

| searchindex            |

| site_identifiers       |

| site_stats             |

| sites                  |

| slot_roles             |

| slots                  |

| templatelinks          |

| text                   |

| updatelog              |

| uploadstash            |

| user                   |

| user_autocreate_serial |

| user_former_groups     |

| user_groups            |

| user_newtalk           |

| user_properties        |

| watchlist              |

| watchlist_expiry       |

+------------------------+

60 rows in set (0.001 sec)

TerryDuchastel (talkcontribs)

This should hopefully make it *much* easier to fix (and reproduce). Combined with the infro from @DenverChess, it seems that the update.php script isn't correctly creating this table and creating or migrating the data (if appropriate).

2001:1C03:F08:400:D9AE:DBC9:5AE2:DE63 (talkcontribs)

As "Tockdom46" describes in the following thread: "https://phabricator.wikimedia.org/T371849":

"As Denver mentioned in https://www.mediawiki.org/wiki/Topic:Yakailc03f0u43c0 , upgrading a wiki from 1.39.10 to 1.43.0 requires that you add the OATHAuth from 1.41.X to the extension folder, update the database with

$ php maintenance/run.php update.php

Afterwards I ran it again with the OATHauth for 1.43.0 though it did not seem to be required."

Tried the above and can confirm this works.

Alongaks (talkcontribs)

Thank you to the above comment pointer. Installing the 1.41.x version of OATHAuth fixed an upgrade from 1.39.x to 1.43 that was using this extension.

하늘토끼 (talkcontribs)

Hello, I think that I've probably found solution about this. (maybe?) Before run update.php, run (wiki folder)/extensions/OATHAuth/sql/sqlite/tables-generated.sql manually. I tested it when upgrading MediaWiki from 1.40.2 to 1.43.0 directly, not installing 1.41.x version of OATHAuth.

Jukeboksi (talkcontribs)

I'm upgrading from 1.39.11 to 1.43 and ran into a similar issue of the OATHAuth database tables not being up-to-date.

Running extensions/OATHAuth/sql/mysql/tables-generated.sql manually allowed me to upgrade to 1.43 directly with OATHAuth intact. Thank you @하늘토끼 for the tip