Page MenuHomePhabricator

SocialProfile Database Error
Closed, ResolvedPublic

Description

SocialProfile throws a database error on MW 1.33 when attempting to access a user's profile. It appears to be coming from the activity module.

Product Version
MediaWiki 1.33.0-alpha (df519cc)
22:53, 26 February 2019
PHP 7.3.2-3+ubuntu18.10.1+deb.sury.org+1 (fpm-fcgi)
MariaDB 10.2.22-MariaDB-1:10.2.22+maria~bionic
ICU 60.2
Lua 5.1.5

[1bea50b491dbde038b26f4a6] /w/index.php?title=User:Therofl98 Wikimedia\Rdbms\DBQueryError from line 1506 of /var/www/html/wiki/w/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: SELECT rc_timestamp,rc_title,rc_user,rc_user_text,rc_comment,rc_id,rc_minor,rc_new,rc_namespace,rc_cur_id,rc_this_oldid,rc_last_oldid,rc_log_action FROM `recentchanges` WHERE rc_user = '1' ORDER BY rc_id DESC LIMIT 8

Function: UserActivity::setEdits

Error: 1054 Unknown column 'rc_comment' in 'field list' (localhost)

Backtrace:
#0 /var/www/html/wiki/w/includes/libs/rdbms/database/Database.php(1476): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
#1 /var/www/html/wiki/w/includes/libs/rdbms/database/Database.php(1236): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /var/www/html/wiki/w/includes/libs/rdbms/database/Database.php(1703): Wikimedia\Rdbms\Database->query(string, string)
#3 /var/www/html/wiki/w/extensions/SocialProfile/UserActivity/includes/UserActivity.php(116): Wikimedia\Rdbms\Database->select(string, array, array, string, array)
#4 /var/www/html/wiki/w/extensions/SocialProfile/UserActivity/includes/UserActivity.php(1009): UserActivity->setEdits()
#5 /var/www/html/wiki/w/extensions/SocialProfile/UserProfile/includes/UserProfilePage.php(1330): UserActivity->getActivityList()
#6 /var/www/html/wiki/w/extensions/SocialProfile/UserProfile/includes/UserProfilePage.php(151): UserProfilePage->getActivity()
#7 /var/www/html/wiki/w/includes/actions/ViewAction.php(68): UserProfilePage->view()
#8 /var/www/html/wiki/w/includes/MediaWiki.php(501): ViewAction->show()
#9 /var/www/html/wiki/w/includes/MediaWiki.php(294): MediaWiki->performAction(UserProfilePage, Title)
#10 /var/www/html/wiki/w/includes/MediaWiki.php(867): MediaWiki->performRequest()
#11 /var/www/html/wiki/w/includes/MediaWiki.php(517): MediaWiki->main()
#12 /var/www/html/wiki/w/index.php(42): MediaWiki->run()
#13 {main}

Event Timeline

Change 493772 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/extensions/SocialProfile@master] Use CommentStore instead of directly reading recentchanges.rc_comment to avoid a DB error in MW 1.33+

https://gerrit.wikimedia.org/r/493772

@TheROFL98 Thank you for taking the time to report this. As per social tools' compatibility policy, social tools target the latest stable release of MediaWiki and are guaranteed only to work with that, and the branched versions of the extensions are unmaintained. Basically, latest stable MW + master of the social tools extensions = works, everything else = unmaintained/not supported.

That being said, I've submitted a patch which should fix this issue, hopefully, without any adverse effects when running under MW 1.32 (i.e. the version of MW we actually care about the most as of now). Please do test it out and see if it works as it should under 1.33.

@Reedy Thanks for tracking down the precise commit, much appreciated!

As a general note, I gotta say I'm somewhat disappointed in that stuff gets broken in core and it seems that no-one's bothering to patch extensions or even notify their authors (e.g. via a Phab ticket -- that happened with AuthManager for it was a big & breaking change, but I don't think changes need to be that big to warrant the same treatment). Back when SVN was used for version control it was common to see people patch stuff that would have broken, but now it doesn't seem to be as common as it was back then, and that's a real shame.

It appears it's now giving me a new error.

[574140f4f18921f47a1b9566] /w/index.php?title=User:Therofl98 InvalidArgumentException from line 336 of /var/www/html/wiki/w/includes/CommentStore.php: $row does not contain fields needed for comment rc_comment

Backtrace:

#0 /var/www/html/wiki/w/includes/CommentStore.php(413): CommentStore->getCommentInternal(NULL, string, array, boolean)
#1 /var/www/html/wiki/w/extensions/SocialProfile/UserActivity/includes/UserActivity.php(140): CommentStore->getComment(string, stdClass)
#2 /var/www/html/wiki/w/extensions/SocialProfile/UserActivity/includes/UserActivity.php(1011): UserActivity->setEdits()
#3 /var/www/html/wiki/w/extensions/SocialProfile/UserProfile/includes/UserProfilePage.php(1330): UserActivity->getActivityList()
#4 /var/www/html/wiki/w/extensions/SocialProfile/UserProfile/includes/UserProfilePage.php(151): UserProfilePage->getActivity()
#5 /var/www/html/wiki/w/includes/actions/ViewAction.php(68): UserProfilePage->view()
#6 /var/www/html/wiki/w/includes/MediaWiki.php(501): ViewAction->show()
#7 /var/www/html/wiki/w/includes/MediaWiki.php(294): MediaWiki->performAction(UserProfilePage, Title)
#8 /var/www/html/wiki/w/includes/MediaWiki.php(867): MediaWiki->performRequest()
#9 /var/www/html/wiki/w/includes/MediaWiki.php(517): MediaWiki->main()
#10 /var/www/html/wiki/w/index.php(42): MediaWiki->run()
#11 {main}

I've already run the update.php file to update the database.

It appears it's now giving me a new error.

Thanks for testing and letting me know -- I was hoping that it'd just work as I copied and adapted the logic from a core file, but seems that's not all you need. Please give the new patchset (PS2, can be found at the same URL posted above by @gerritbot) a try and see if that fixes it.

It appears it's now giving me a new error.

[574140f4f18921f47a1b9566] /w/index.php?title=User:Therofl98 InvalidArgumentException from line 336 of /var/www/html/wiki/w/includes/CommentStore.php: $row does not contain fields needed for comment rc_comment

Backtrace:

#0 /var/www/html/wiki/w/includes/CommentStore.php(413): CommentStore->getCommentInternal(NULL, string, array, boolean)
#1 /var/www/html/wiki/w/extensions/SocialProfile/UserActivity/includes/UserActivity.php(140): CommentStore->getComment(string, stdClass)
#2 /var/www/html/wiki/w/extensions/SocialProfile/UserActivity/includes/UserActivity.php(1011): UserActivity->setEdits()
#3 /var/www/html/wiki/w/extensions/SocialProfile/UserProfile/includes/UserProfilePage.php(1330): UserActivity->getActivityList()
#4 /var/www/html/wiki/w/extensions/SocialProfile/UserProfile/includes/UserProfilePage.php(151): UserProfilePage->getActivity()
#5 /var/www/html/wiki/w/includes/actions/ViewAction.php(68): UserProfilePage->view()
#6 /var/www/html/wiki/w/includes/MediaWiki.php(501): ViewAction->show()
#7 /var/www/html/wiki/w/includes/MediaWiki.php(294): MediaWiki->performAction(UserProfilePage, Title)
#8 /var/www/html/wiki/w/includes/MediaWiki.php(867): MediaWiki->performRequest()
#9 /var/www/html/wiki/w/includes/MediaWiki.php(517): MediaWiki->main()
#10 /var/www/html/wiki/w/index.php(42): MediaWiki->run()
#11 {main}

I've already run the update.php file to update the database.

It appears it's now giving me a new error.

[574140f4f18921f47a1b9566] /w/index.php?title=User:Therofl98 InvalidArgumentException from line 336 of /var/www/html/wiki/w/includes/CommentStore.php: $row does not contain fields needed for comment rc_comment

Backtrace:

#0 /var/www/html/wiki/w/includes/CommentStore.php(413): CommentStore->getCommentInternal(NULL, string, array, boolean)
#1 /var/www/html/wiki/w/extensions/SocialProfile/UserActivity/includes/UserActivity.php(140): CommentStore->getComment(string, stdClass)
#2 /var/www/html/wiki/w/extensions/SocialProfile/UserActivity/includes/UserActivity.php(1011): UserActivity->setEdits()
#3 /var/www/html/wiki/w/extensions/SocialProfile/UserProfile/includes/UserProfilePage.php(1330): UserActivity->getActivityList()
#4 /var/www/html/wiki/w/extensions/SocialProfile/UserProfile/includes/UserProfilePage.php(151): UserProfilePage->getActivity()
#5 /var/www/html/wiki/w/includes/actions/ViewAction.php(68): UserProfilePage->view()
#6 /var/www/html/wiki/w/includes/MediaWiki.php(501): ViewAction->show()
#7 /var/www/html/wiki/w/includes/MediaWiki.php(294): MediaWiki->performAction(UserProfilePage, Title)
#8 /var/www/html/wiki/w/includes/MediaWiki.php(867): MediaWiki->performRequest()
#9 /var/www/html/wiki/w/includes/MediaWiki.php(517): MediaWiki->main()
#10 /var/www/html/wiki/w/index.php(42): MediaWiki->run()
#11 {main}

I've already run the update.php file to update the database.

Are you sure you downloaded the patch correctly? The line numbers in this error message don't line up with what they're supposed to be.

Change 493772 merged by jenkins-bot:
[mediawiki/extensions/SocialProfile@master] Use CommentStore instead of directly reading recentchanges.rc_comment to avoid a DB error in MW 1.33+

https://gerrit.wikimedia.org/r/493772

Are you sure you downloaded the patch correctly? The line numbers in this error message don't line up with what they're supposed to be.

I redownloaded the patch after it was merged. Everything works now! Thanks!

ashley claimed this task.
ashley removed a project: Patch-For-Review.