Page MenuHomePhabricator

Unable to create table cu_useragent on labtestwiki
Closed, ResolvedPublic

Description

When running the command foreachwiki sql.php ~/T359312.sql on production, the table was not created on labtestwiki because sql.php exited with the error:

-----------------------------------------------------------------
labtestwiki
-----------------------------------------------------------------
Wikimedia\Rdbms\DBConnectionError from line 1138 of /srv/mediawiki/php-1.42.0-wmf.25/includes/libs/rdbms/loadbalancer/LoadBalancer.php: Cannot access the database: Access denied for user 'wikiadmin2023'@'mwmaint1002.eqiad.wmnet' (using password: YES) (clouddb2002-dev)
#0 /srv/mediawiki/php-1.42.0-wmf.25/includes/libs/rdbms/loadbalancer/LoadBalancer.php(794): Wikimedia\Rdbms\LoadBalancer->reportConnectionError()
#1 /srv/mediawiki/php-1.42.0-wmf.25/includes/libs/rdbms/loadbalancer/LoadBalancer.php(782): Wikimedia\Rdbms\LoadBalancer->getServerConnection(0, 'labtestwiki', 8)
#2 /srv/mediawiki/php-1.42.0-wmf.25/includes/libs/rdbms/database/DBConnRef.php(103): Wikimedia\Rdbms\LoadBalancer->getConnectionInternal(-2, Array, 'labtestwiki', 8)
#3 /srv/mediawiki/php-1.42.0-wmf.25/includes/libs/rdbms/database/DBConnRef.php(117): Wikimedia\Rdbms\DBConnRef->ensureConnection()
#4 /srv/mediawiki/php-1.42.0-wmf.25/includes/libs/rdbms/database/DBConnRef.php(227): Wikimedia\Rdbms\DBConnRef->__call('setFlag', Array)
#5 /srv/mediawiki/php-1.42.0-wmf.25/includes/installer/DatabaseUpdater.php(155): Wikimedia\Rdbms\DBConnRef->setFlag(128)
#6 /srv/mediawiki/php-1.42.0-wmf.25/includes/installer/DatabaseUpdater.php(254): MediaWiki\Installer\DatabaseUpdater->__construct(Object(Wikimedia\Rdbms\DBConnRef), true, Object(MwSql))
#7 /srv/mediawiki/php-1.42.0-wmf.25/maintenance/sql.php(93): MediaWiki\Installer\DatabaseUpdater::newForDB(Object(Wikimedia\Rdbms\DBConnRef), true, Object(MwSql))
#8 /srv/mediawiki/php-1.42.0-wmf.25/maintenance/includes/MaintenanceRunner.php(698): MwSql->execute()
#9 /srv/mediawiki/php-1.42.0-wmf.25/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#10 /srv/mediawiki/multiversion/MWScript.php(158): require_once('/srv/mediawiki/...')
#11 {main}

T359312.sql was defined as the following and is a copy (with a modification to add IF NOT EXISTS) of the SQL file in the repo that added the table:

CREATE TABLE IF NOT EXISTS /*_*/cu_useragent (
  cuua_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
  cuua_text VARBINARY(255) NOT NULL,
  INDEX cuua_text (cuua_text),
  PRIMARY KEY(cuua_id)
) /*$wgDBTableOptions*/;

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
OpenFeatureNone
Resolved TBolliger
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
Resolved Marostegui
OpenNone

Event Timeline

I cannot also connect to that wiki using sql labtestwiki.

This seems to be the same issue as T339958.

Marostegui claimed this task.
Marostegui subscribed.

Fixed

# sql labtestwiki
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 177084
Server version: 10.4.25-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

wikiadmin2023@10.192.20.6(labtestwiki)>