Topic on Project:Support desk

Extension:OpenBadges's Special:BadgeView not working.

7
Tang Empire (talkcontribs)

I ran the update script but it still says database error...

/index.php/Special:BadgeView 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 'u585674696_3tRFj.bqyo_openbadges_assertion' doesn't exist

Function: MediaWiki\Pager\IndexPager::buildQueryInfo (BadgesPager)

Query: SELECT obl_name,obl_badge_image,assertion.obl_badge_id AS `badge_id`,obl_badge_evidence FROM `bqyo_openbadges_assertion` `assertion`,`bqyo_openbadges_class` `class` WHERE obl_receiver = 1 ORDER BY obl_name LIMIT 51

Backtrace:

from /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/libs/rdbms/database/Database.php(1236)

#0 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/libs/rdbms/database/Database.php(1220): Wikimedia\Rdbms\Database->getQueryException()

#1 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/libs/rdbms/database/Database.php(1194): Wikimedia\Rdbms\Database->getQueryExceptionAndLog()

#2 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/libs/rdbms/database/Database.php(679): Wikimedia\Rdbms\Database->reportQueryError()

#3 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/libs/rdbms/database/Database.php(1383): Wikimedia\Rdbms\Database->query()

#4 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/libs/rdbms/database/DBConnRef.php(119): Wikimedia\Rdbms\Database->select()

#5 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/libs/rdbms/database/DBConnRef.php(351): Wikimedia\Rdbms\DBConnRef->__call()

#6 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/pager/IndexPager.php(467): Wikimedia\Rdbms\DBConnRef->select()

#7 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/pager/IndexPager.php(289): MediaWiki\Pager\IndexPager->reallyDoQuery()

#8 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/pager/IndexPager.php(839): MediaWiki\Pager\IndexPager->doQuery()

#9 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/pager/TablePager.php(308): MediaWiki\Pager\IndexPager->isNavigationBarShown()

#10 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/extensions/OpenBadges/includes/specials/SpecialBadgeView.php(26): MediaWiki\Pager\TablePager->getNavigationBar()

#11 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/specialpage/SpecialPage.php(728): SpecialBadgeView->execute()

#12 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/specialpage/SpecialPageFactory.php(1621): MediaWiki\SpecialPage\SpecialPage->run()

#13 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/MediaWiki.php(357): MediaWiki\SpecialPage\SpecialPageFactory->executePath()

#14 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/MediaWiki.php(960): MediaWiki->performRequest()

#15 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/MediaWiki.php(613): MediaWiki->main()

#16 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/index.php(50): MediaWiki->run()

#17 /home/u585674696/domains/heterodontosaurus-balls.com/public_html/index.php(46): wfIndexMain()

#18 {main}

I hope I didn't just dox myself, but please help, I've been trying to figure this out for so long and I don't know what to do...

TheDJ (talkcontribs)

You likely installed Extension:OpenBadges. But after installing this, you need to run the maintenance update.php script, to create the database tables this extension needs, and likely this was not done (or it failed for some reason). What does the update script end with ? Can you find a reference to "openbadges" in its output ? The extension also hasn't been updated by it's author for a while, so possibly it simply lost compatibility with the current version of MediaWiki.

Tang Empire (talkcontribs)

I think it might have just lost compatibility, because I ran the update script 3 times and still it doesn’t work. But I will try again.

Edit: I tried it again and it still didn't work. I found some refernces to OpenBadges in the script output, here it is.


...openbadges_class table already exists.

Creating openbadges_assertion table...Wikimedia\Rdbms\DBQueryError from line 123 6 of /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/l ibs/rdbms/database/Database.php: Error 1005: Can't create table `u585674696_3tRF j`.`bqyo_openbadges_assertion` (errno: 150 "Foreign key constraint is incorrectl y formed")

Function: Wikimedia\Rdbms\Database::sourceFile( /home/u585674696/domains/heterod ontosaurus-balls.com/public_html/extensions/OpenBadges/includes/../sql/OpenBadge sAssertion.sql )

Query: CREATE TABLE `bqyo_openbadges_assertion` (

obl_id int NOT NULL PRIMARY KEY auto_increment,

obl_timestamp binary(14) NOT NULL,

obl_receiver int(10) unsigned NOT NULL REFERENCES user(user_id),

obl_badge_id int NOT NULL REFERENCES openbadges_class(obl_badge_id),

obl_badge_evidence varchar(255),

obl_expiration binary(14)

) /*wgDBTableOptions*/

TheDJ (talkcontribs)

Right. So this is from OpenBadges/sql/OpenBadgesAssertion.sql. It says that the reference to the user table or the reference to the open badges class table is incorrect

I suspect that in that file, user() and openbadges_class() need to be prefixed with /*_*/ This ensures that MediaWiki will apply the table prefix when doing that table lookup. So I would suggest modifying that file like that, rerun the update.php and then please report back if that works, and then I'll modify that extension with that change. The extension has not seen much support in the last 5 years it seems, so even if the DB update works after this, it might be that other parts are still broken.

Tang Empire (talkcontribs)

alright, I ran the update script again and this time with modifications, and it said

...openbadges_class table already exists.

Creating openbadges_assertion table...Wikimedia\Rdbms\DBQueryError from line 1236 of /home/u585674696/domains/heterodontosaurus-balls.com/public_html/includes/libs/rdbms/database/Database.php: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '

obl_badge_id int NOT NULL REFERENCES /*openbadges_class(obl_badge_id)*/,

o...' at line 4

Function: Wikimedia\Rdbms\Database::sourceFile( /home/u585674696/domains/heterodontosaurus-balls.com/public_html/extensions/OpenBadges/includes/../sql/OpenBadgesAssertion.sql )

Query: CREATE TABLE `bqyo_openbadges_assertion` (

obl_id int NOT NULL PRIMARY KEY auto_increment,

obl_timestamp binary(14) NOT NULL,

obl_receiver int(10) unsigned NOT NULL REFERENCES /*user(user_id)*/,

obl_badge_id int NOT NULL REFERENCES /*openbadges_class(obl_badge_id)*/,

obl_badge_evidence varchar(255),

obl_expiration binary(14)

) /*wgDBTableOptions*/

TheDJ (talkcontribs)

I said prefix, you wrapped it.

NOT NULL REFERENCES /*_*/user(user_id),

NOT NULL REFERENCES /*_*/openbadges_class(obl_badge_id),

Tang Empire (talkcontribs)

My apologies. Thank you so much, the Special:BadgeView page now works

Reply to "Extension:OpenBadges's Special:BadgeView not working."