Page MenuHomePhabricator

commonswiki_p database does not exist (due to using wrong host)
Closed, InvalidPublic

Description

hi

I've been using commonswiki_p for this tool: https://glamwikidashboard.org/
I see now that it is not longer exist. I'm connecting through an ssh tunnel.
Is there any other database that I can use for this purpose?

Thanks
Yoantan

Event Timeline

How are you connecting to the databases? The old cluster was recently decomissioned and there is a new one that has slightly different constraints.

See https://wikitech.wikimedia.org/wiki/News/Wiki_Replicas_2020_Redesign for more information.

In your case, this may be what is happening:

you Can only query a database if you are connected to it explicitly, you should utilize the database hostnames in the form of <db_name>.<web or analytics>.db.svc.wikimedia.cloud.

Don't connect to enwiki and then query against frwiki for example. Instead connect to frwiki.web.db.svc.wikimedia.cloud, then execute the query.

Make sure you are connecting to the URL commonswiki.analytics.db.svc.wikimedia.cloud to use commonswiki_p.

If all of this is right, then the problem may be something else. In that case, please share more information about how you are connecting and what error messages you are seeing.

Thank you for the quick reply.
I'm connecting though nodejs mariadb pacakge, it looks like this:

const mariadb = require('mariadb');
mariadb.createConnection({
  host: 'locahost',
  port: 3306,
  user: 'uXXXXX',
  password: 'XXXXXXXXXXXX',
  database: 'commonswiki_p'
});

I'm opening an ssh tunnel to before, with the following config:

Host wmflabs
   HostName      tools-dev.wmflabs.org
   User          my_user
   Port          22
   IdentityFile  path_to_key
   LocalForward  3306 commonswiki.analytics.db.svc.wikimedia.cloud:3306

my_user and path_to_key are not the actual values.

when querying the db using nodejs I get: SqlError: (conn=16231239, no: 1049, SQLState: 42000) Unknown database 'commonswiki_p'

I also connected to the sql database in the ssh host with mysql cli, and did SHOW DATABASES and didn't see the wanted database there
It worked until a few days ago, so don't think it is caused by a change from my side (but I keep investigating it)

Hmm that is very strange, here is what I see (from both user and tool accounts):

$ mysql --defaults-file=$HOME/replica.my.cnf -h commonswiki.analytics.db.svc.wikimedia.cloud
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 19151496
Server version: 10.4.18-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.

MariaDB [(none)]> show databases;
+----------------------+
| Database             |
+----------------------+
| commonswiki_p        |
| heartbeat_p          |
| information_schema   |
| information_schema_p |
| testcommonswiki_p    |
+----------------------+
5 rows in set (0.00 sec)

Your URL seems right.

It is now working, thank you :)
The ssh port forwarding was something else, changed it to your suggested host and it works
I guess in my second run I didn't restart the ssh connection
thanks!

Aklapper renamed this task from commonswiki_p database does not exsit to commonswiki_p database does not exist (due to using wrong host).May 11 2021, 4:08 PM
Aklapper closed this task as Invalid.

host: 'locahost',

Also note that there is a typo here

It is a copying typo, in the code it is written correctly

Is there a way to query the commonswiki_p database without ssh tunneling or without running the code on the VPS?
We are doing it through aws ec2 instance
thanks

Hi, please ask support forums in support places instead. Thanks a lot!

@Yonatan.Bendahan You can use the API, it is very widely used and has almost all features.