ug_expiry column of the user_groups table is not present on Labs
Closed, ResolvedPublic

Description

All wikis now have a ug_expiry column on the user_groups table, but it is not available in the Labs views.

MariaDB [enwiki_p]> EXPLAIN user_groups;
+----------+-----------------+------+-----+---------+-------+
| Field    | Type            | Null | Key | Default | Extra |
+----------+-----------------+------+-----+---------+-------+
| ug_user  | int(5) unsigned | NO   |     | 0       |       |
| ug_group | varbinary(255)  | NO   |     |         |       |
+----------+-----------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
TTO created this task.Mar 16 2017, 8:00 PM
Restricted Application added a project: Cloud-Services. · View Herald TranscriptMar 16 2017, 8:00 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
chasemp triaged this task as Normal priority.Mar 16 2017, 8:14 PM

I'll attempt to run the view generation when I can in the next few days

Just to clarify: Moved it in our internal DBA dashboard to the "not db team" as this is normally handled by Labs.

chasemp closed this task as Resolved.Mar 17 2017, 12:47 PM

should be good to go, let me know if not

hashar reopened this task as Open.Apr 24 2017, 1:38 PM
hashar added a subscriber: hashar.
2017-04-24 13:35:09 [1e84c583c2a7e84b019f175e] silver labswiki 1.29.0-wmf.20 exception ERROR: [1e84c583c2a7e84b019f175e] /wiki/Server_Admin_Log   DBQueryError from line 1063 of /srv/mediawiki/php-1.29.0-wmf.20/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  ug_user,ug_group,ug_expiry  FROM `user_groups`    WHERE ug_user = 'XXXX'  
Function: UserGroupMembership::getMembershipsForUser
Error: 1054 Unknown column 'ug_expiry' in 'field list' (208.80.154.136)
 {"exception_id":"1e84c583c2a7e84b019f175e","caught_by":"mwe_handler"} 
[Exception DBQueryError] (/srv/mediawiki/php-1.29.0-wmf.20/includes/libs/rdbms/database/Database.php:1063) A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: SELECT  ug_user,ug_group,ug_expiry  FROM `user_groups`    WHERE ug_user = 'XXX'  
Function: UserGroupMembership::getMembershipsForUser
Error: 1054 Unknown column 'ug_expiry' in 'field list' (208.80.154.136)

  #0 /srv/mediawiki/php-1.29.0-wmf.20/includes/libs/rdbms/database/Database.php(921): Database->reportQueryError(string, integer, string, string, boolean)
  #1 /srv/mediawiki/php-1.29.0-wmf.20/includes/libs/rdbms/database/Database.php(1257): Database->query(string, string)
  #2 /srv/mediawiki/php-1.29.0-wmf.20/includes/user/UserGroupMembership.php(326): Database->select(string, array, array, string)
  #3 /srv/mediawiki/php-1.29.0-wmf.20/includes/user/User.php(1402): UserGroupMembership::getMembershipsForUser(integer, DatabaseMysqli)
  #4 /srv/mediawiki/php-1.29.0-wmf.20/includes/user/User.php(501): User->loadGroups()
  #5 /srv/mediawiki/php-1.29.0-wmf.20/includes/libs/objectcache/WANObjectCache.php(889): User->{closure}(boolean, integer, array, NULL)
  #6 [internal function]: WANObjectCache->{closure}(boolean, integer, array, NULL)
  #7 /srv/mediawiki/php-1.29.0-wmf.20/includes/libs/objectcache/WANObjectCache.php(1009): call_user_func_array(Closure, array)
  #8 /srv/mediawiki/php-1.29.0-wmf.20/includes/libs/objectcache/WANObjectCache.php(895): WANObjectCache->doGetWithSetCallback(string, integer, Closure, array, NULL)
  #9 /srv/mediawiki/php-1.29.0-wmf.20/includes/user/User.php(515): WANObjectCache->getWithSetCallback(string, integer, Closure, array)
  #10 /srv/mediawiki/php-1.29.0-wmf.20/includes/user/User.php(445): User->loadFromCache()
  #11 /srv/mediawiki/php-1.29.0-wmf.20/includes/user/User.php(409): User->loadFromId(integer)
  #12 /srv/mediawiki/php-1.29.0-wmf.20/includes/session/UserInfo.php(88): User->load()
  #13 /srv/mediawiki/php-1.29.0-wmf.20/includes/session/CookieSessionProvider.php(119): MediaWiki\Session\UserInfo::newFromId(string)
  #14 /srv/mediawiki/php-1.29.0-wmf.20/includes/session/SessionManager.php(487): MediaWiki\Session\CookieSessionProvider->provideSessionInfo(WebRequest)
  #15 /srv/mediawiki/php-1.29.0-wmf.20/includes/session/SessionManager.php(190): MediaWiki\Session\SessionManager->getSessionInfoForRequest(WebRequest)
  #16 /srv/mediawiki/php-1.29.0-wmf.20/includes/WebRequest.php(735): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)
  #17 /srv/mediawiki/php-1.29.0-wmf.20/includes/session/SessionManager.php(129): WebRequest->getSession()
  #18 /srv/mediawiki/php-1.29.0-wmf.20/includes/Setup.php(734): MediaWiki\Session\SessionManager::getGlobalSession()
  #19 /srv/mediawiki/php-1.29.0-wmf.20/includes/WebStart.php(139): require_once(string)
  #20 /srv/mediawiki/php-1.29.0-wmf.20/index.php(40): require(string)
  #21 /srv/mediawiki/w/index.php(3): require(string)
  #22 {main}
hashar closed this task as Resolved.Apr 24 2017, 1:45 PM

labswiki has not been updated. The exception spam start when we have enable the "user group expiry" feature on all wikis via https://gerrit.wikimedia.org/r/#/c/347545/

Better to be tracked here: T155605

TTO added a comment.Apr 24 2017, 2:27 PM

Just for the record, the above errors from today relate to labswiki = wikitech.wikimedia.org, while the issue of this task relates to Tool Labs = tools.wmflabs.org. Easy to confuse!