Unknown MySQL server host 'db' (2)

I was just trying to update our self-hosted installation from DE 3.1 to 3.2 and get the following error when trying to update the database according to the upgrade manual:

ERROR 2005 (HY000): Unknown MySQL server host 'db' (2)

I did this step many times before and never ran into any issues here.

This is the command the causes the error message:
mysql -h$DB_HOST -p$DB_ROOT_PASSWD dtable_db </opt/seatable/seatable-server-latest/sql/mysql/upgrade/3.2/dtable.sql

Can you please advice what might be the problem!?

TIA

Hey pueblo,

the db is usually defined in your docker-compose. If you changed the name of the service to something different, then you have to use this name in the update command.

Here is how the docker-compose looks in most cases…

version: '2.0'
services:
  db:
    ...

  memcached:
    ...

  redis:
    ...

  seatable:
    image: seatable/seatable-enterprise:latest
    container_name: seatable
    ...

Hmm, I haven’t changed anything. I just ran the same update procedure as always (except the extras steps where needed along the way according to the manual).

But even looking into the docker-compose.yml I can see:

environment:
- DB_HOST=db

I’m really lost here and our installation is down. Is it possible to run Seatable without the DB upgrade our will this cause problems?

Has the db container properly started? Do you run update command in the seatable container?

Can you check the environment variables in the seatable container? You should find a line DB_HOST = db and you should also be able to ping the db container using ping db (you’ll have to install iputils-ping in the seatable container).

As a last resort, In

you can replace -h$DB_HOST by -h<IP_ADDRESS_DB_CONTAINER> with <IP_ADRESS_DB_CONTAINER> being the IP address of the container ‘db’.

But seatable in the seatable container needs to communicate with mariadb in the db container. And apparently it cannot. So even if you succeed in running the db update, you’ll probably encounter problems running SeaTable.

Container has started properly afaik (Creating seatable-mysql ... done). The command is run in the container. I just repeated those steps to be sure.

Unfortunately I have no idea how to check environment variables or how to install iputils-ping in a container. Really nothing has changed with any configuration on our side.

Does it help if I post my config files (with sensible date redacted ofc)?

I was able to get this regarding the variables:

root@Seatable:/opt/seatable# docker exec seatable printenv DB_HOST
db

Is this what you were asking for?

Switch into the seatable-docker container with "docker exec -it seatable bash" and then execute the following commands inside the container. Please post the output:

apt update
apt install iputils-ping
ping db
ping $DB_HOST
root@Seatable:/opt/seatable# docker exec -it seatable bash
root@f2c5cdf37a0e:/opt/seatable# apt update
Hit:1 http://nginx.org/packages/ubuntu bionic InRelease
Hit:2 http://deb.nodesource.com/node_12.x bionic InRelease                                       
Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease                                    
Hit:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease          
Get:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease [88.7 kB]
Get:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease [88.7 kB]
Get:7 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed InRelease [242 kB]
Get:8 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease [83.3 kB]
Get:9 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe Sources [378 kB]
Get:10 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/restricted Sources [33.0 kB]
Get:11 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main Sources [354 kB]
Get:12 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/restricted amd64 Packages [1,187 kB]
Get:13 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main amd64 Packages [3,009 kB]                                                                   
Get:14 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main Sources [667 kB]                                                                             
Get:15 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 Packages [3,442 kB]                                                                    
Get:16 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed/main amd64 Packages [169 kB]                                                                     
Fetched 9,239 kB in 9s (996 kB/s)                                                                                                                                  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
root@f2c5cdf37a0e:/opt/seatable# apt install iputils-ping
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libcap2-bin libidn11 libpam-cap
The following NEW packages will be installed:
  iputils-ping libcap2-bin libidn11 libpam-cap
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 129 kB of archives.
After this operation, 489 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 libidn11 amd64 1.33-2.1ubuntu1.2 [46.6 kB]
Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 iputils-ping amd64 3:20161105-1ubuntu3 [54.2 kB]
Get:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/main amd64 libcap2-bin amd64 1:2.25-1.2 [20.6 kB]
Get:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/main amd64 libpam-cap amd64 1:2.25-1.2 [7,268 B]
Fetched 129 kB in 3s (41.7 kB/s)      
Selecting previously unselected package libidn11:amd64.
(Reading database ... 42532 files and directories currently installed.)
Preparing to unpack .../libidn11_1.33-2.1ubuntu1.2_amd64.deb ...
Unpacking libidn11:amd64 (1.33-2.1ubuntu1.2) ...
Selecting previously unselected package iputils-ping.
Preparing to unpack .../iputils-ping_3%3a20161105-1ubuntu3_amd64.deb ...
Unpacking iputils-ping (3:20161105-1ubuntu3) ...
Selecting previously unselected package libcap2-bin.
Preparing to unpack .../libcap2-bin_1%3a2.25-1.2_amd64.deb ...
Unpacking libcap2-bin (1:2.25-1.2) ...
Selecting previously unselected package libpam-cap:amd64.
Preparing to unpack .../libpam-cap_1%3a2.25-1.2_amd64.deb ...
Unpacking libpam-cap:amd64 (1:2.25-1.2) ...
Setting up libpam-cap:amd64 (1:2.25-1.2) ...
Setting up libcap2-bin (1:2.25-1.2) ...
Setting up libidn11:amd64 (1.33-2.1ubuntu1.2) ...
Setting up iputils-ping (3:20161105-1ubuntu3) ...
Processing triggers for libc-bin (2.27-3ubuntu1.6) ...
root@f2c5cdf37a0e:/opt/seatable# ping db
ping: db: Name or service not known
root@f2c5cdf37a0e:/opt/seatable# ping $DB_HOST
ping: db: Name or service not known
root@f2c5cdf37a0e:/opt/seatable# 

OK. Out of desperation, I did what we did back in the 80s and 90s when things were going south…I rebooted the server. And guess what, after the reboot the update went through smoothly without any error messages and the installation is now back up and running with the newest and shiniest version of Seatable 3.2. I have no idea what happened and apologize for the trouble. But at the same time want to thank you sooo very much for trying to help out so quickly and patiently. This is really more than rare and very impressive!!! :clap:t2:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.