krenair@tin:~$ sql labswiki
ERROR 2003 (HY000): Can't connect to MySQL server on 'silver' (110)
Description
Details
Related Objects
- Mentioned In
- T282074: Audit labswiki grants
rOPUPc0c696907ae4: Adding grants for queries from terbium to labswiki
rOPUP75db4587900c: silver/wikitech: also allow mysql from terbium
rOPUPd09bad1a2342: Add extra grants for labswiki from tin
rOPUPb91777180879: silver/wikitech: allow mysql connection from tin
T107547: Figure out what to do about maintenance scripts on silver/wikitech
T72311: [Regression] foreachwiki should not run on labswiki (wikitech.wm.o) - Mentioned Here
- T89548: labswiki isn't replicated on Labs
Event Timeline
We have two problems here: First of all (as noted above) it's not possible to open a tcp connection to silver on that port (mysql -h silver is failing at connect(3, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("208.80.154.136")}, 16) = -1 ETIMEDOUT (Connection timed out)).
On top of that, the wikiadmin/wikiuser logins wont work from anything but silver itself:
mysql:root@localhost [(none)]> SELECT Host, User FROM mysql.user WHERE User = 'wikiadmin' OR User = 'wikiuser'; +----------------+-----------+ | Host | User | +----------------+-----------+ | 208.80.154.136 | wikiadmin | | 208.80.154.136 | wikiuser | +----------------+-----------+ 2 rows in set (0.01 sec)
Maybe dumps of labswiki are failing, too. Can you confirm it @ArielGlenn?
I just saw :real_connect(): (HY000/2003): Can't connect to MySQL server on '208.80.154.136' (4) (labswiki from snapshot1003) on the error logs.
This also prevents us from being able to add silver to the list of DB hosts which get QueryPages like Special:Wantedpages automatically updated
So we may want it to be accessible from certain other DB hosts (T89548), maybe snapshot hosts too (for dumps)?
I think this would technically grant the restricted group access to the DB. I don't know if you guys consider that an issue or not.
Change 232529 had a related patch set uploaded (by Dzahn):
silver/wikitech: allow mysql connection from tin
There are 2 steps here: a) allow connection per firewall rules b) grant permission in mysql itself
a) needs an "srange". this would ideally be a list of all servers that need to be able to connect or it can just be $INTERNAL which allows all of 10.0.0.0/8 Here's an example to allow just tin: https://gerrit.wikimedia.org/r/#/c/232529/1/manifests/role/mariadb.pp
b) i'd leave that to the DBA to decide
b) Depends on knowing a), as users in MySQL have an srange, too. I suppose you want the standard production users.
merged the change above. watched on silver. can now do this from tin:
[tin:~] $ mysql -u wikiadmin -h silver.wikimedia.org labswiki
ERROR 2003 (HY000): Can't connect to MySQL server on 'silver.wikimedia.org' (110)
normal, because of the GRANTs, just to show the firewall is open for it now.
ACCEPT tcp -- db1011.eqiad.wmnet anywhere tcp dpt:mysql ACCEPT tcp -- tin.eqiad.wmnet anywhere tcp dpt:mysql
@jcrespo let's do 'wikiadmin'@'tin.eqiad.wmnet' and 'wikiuser'@'tin.eqiad.wmnet' for now?
me neither. i said it only because T98682#1285179 shows there is an existing grant for it to connect from silver itself.
let's do the minimal approach then and only allow wikiadmin and see
I will add the user on puppet. Just for the record- on our configuration, users with hosts using dns entries are ignored, ips have to be used.
Change 232750 had a related patch set uploaded (by Jcrespo):
Add extra grants for labswiki from tin
Yep, "labswiki" is the exact name of the correct database. Nothing else is necessary.
So, I added wikiadmin to puppet from tin, and that should work and resolve the issue. Ariel also told me to ignore shanpshot1003 errors.
Change 232763 had a related patch set uploaded (by Dzahn):
silver/wikitech: also allow mysql from terbium