docker4drupal icon indicating copy to clipboard operation
docker4drupal copied to clipboard

Unknown MySQL server host 'mariadb'

Open Vacilando opened this issue 8 years ago • 7 comments

With the latest docker-compose.yml on Windows 10 I am getting "Unknown MySQL server host 'mariadb'" when I try to install a fresh D7.

I solved it by replacing image: wodby/mariadb:10.1-2.3.3 with image: wodby/mariadb:10.1-2.1.0

This is to report that there's probably some problem with image wodby/mariadb:10.1-2.3.3 in situations similar to mine.

Here's the output of: docker-compose logs mariadb

Attaching to d7dockerlocalhost_mariadb_1 mariadb_1 | 2017-08-24 9:58:35 139674609146696 [Note] mysqld (mysqld 10.1.22-MariaDB) starting as process 1 ... mariadb_1 | 2017-08-24 9:58:36 139674609146696 [Note] InnoDB: Using mutexes to ref count buffer pool pages mariadb_1 | 2017-08-24 9:58:36 139674609146696 [Note] InnoDB: The InnoDB memory heap is disabled mariadb_1 | 2017-08-24 9:58:36 139674609146696 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins mariadb_1 | 2017-08-24 9:58:36 139674609146696 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier mariadb_1 | 2017-08-24 9:58:36 139674609146696 [Note] InnoDB: Compressed tables use zlib 1.2.8 mariadb_1 | 2017-08-24 9:58:36 139674609146696 [Note] InnoDB: Using Linux native AIO mariadb_1 | 2017-08-24 9:58:36 139674609146696 [Note] InnoDB: Using SSE crc32 instructions mariadb_1 | 2017-08-24 9:58:36 139674609146696 [Note] InnoDB: Initializing buffer pool, size = 1.0G mariadb_1 | 2017-08-24 9:58:36 139674609146696 [Note] InnoDB: Completed initialization of buffer pool mariadb_1 | 2017-08-24 9:58:36 139674609146696 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 0 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages ! mariadb_1 | 2017-08-24 9:58:36 139674609146696 [ERROR] InnoDB: Could not open or create the system tablespace. If yo u tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote th ose files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data! mariadb_1 | 2017-08-24 9:58:36 139674609146696 [ERROR] Plugin 'InnoDB' init function returned error. mariadb_1 | 2017-08-24 9:58:36 139674609146696 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. mariadb_1 | 2017-08-24 9:58:36 139674609146696 [Note] Plugin 'FEEDBACK' is disabled. mariadb_1 | 2017-08-24 9:58:36 139674609146696 [ERROR] Could not open mysql.plugin table. Some plugins may be not lo aded mariadb_1 | 2017-08-24 9:58:36 139674609146696 [ERROR] Unknown/unsupported storage engine: InnoDB mariadb_1 | 2017-08-24 9:58:36 139674609146696 [ERROR] Aborting mariadb_1 |

Vacilando avatar Aug 24 '17 10:08 Vacilando

Try to clean up your volumes and run again

csandanov avatar Aug 28 '17 05:08 csandanov

Tested again:

docker-compose down

#image: wodby/mariadb:10.1-2.1.0 image: wodby/mariadb:10.1-2.3.3

docker-compose up -d

-> Same problem.

docker-compose down

image: wodby/mariadb:10.1-2.1.0 #image: wodby/mariadb:10.1-2.3.3

docker-compose up -d

-> Works fine.

Vacilando avatar Aug 28 '17 10:08 Vacilando

Try tag 2.3.5, it comes with mariadb 10.1.26

csandanov avatar Aug 28 '17 10:08 csandanov

Did docker-compose down, kill, rm ... then:

#image: wodby/mariadb:10.1-2.1.0 #image: wodby/mariadb:10.1-2.3.3 image: wodby/mariadb:10.1-2.3.5

docker-compose up -d

-> same error: MySQL said: #2005 - Unknown MySQL server host 'mariadb' (-2)

Log:

2017-09-15 21:10:14 140586204699464 [Note] mysqld (mysqld 10.1.26-MariaDB) starting as process 1 ... 2017-09-15 21:10:14 140586204699464 [Note] InnoDB: Using mutexes to ref count buffer pool pages 2017-09-15 21:10:14 140586204699464 [Note] InnoDB: The InnoDB memory heap is disabled 2017-09-15 21:10:14 140586204699464 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-09-15 21:10:14 140586204699464 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2017-09-15 21:10:14 140586204699464 [Note] InnoDB: Compressed tables use zlib 1.2.11 2017-09-15 21:10:14 140586204699464 [Note] InnoDB: Using Linux native AIO 2017-09-15 21:10:14 140586204699464 [Note] InnoDB: Using SSE crc32 instructions 2017-09-15 21:10:14 140586204699464 [Note] InnoDB: Initializing buffer pool, size = 1.0G 2017-09-15 21:10:14 140586204699464 [Note] InnoDB: Completed initialization of buffer pool 2017-09-15 21:10:14 140586204699464 [ERROR] InnoDB: Tried to read 16384 bytes at offset 81920. Was only able to read 0. 2017-09-15 21:10:14 7fdcc6ca9b48 InnoDB: Operating system error number 22 in a file operation. InnoDB: Error number 22 means 'Invalid argument'. InnoDB: Some operating system error numbers are described at InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html InnoDB: Operation read to file /home/buildozer/aports/main/mariadb/src/mariadb-10.1.26/storage/xtradb/os/os0file.cc and at line 3174 2017-09-15 21:10:14 140586204699464 [ERROR] InnoDB: File (unknown): 'read' returned OS error 222. Cannot continue operation 170915 21:10:14 [ERROR] mysqld got signal 6 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see https://mariadb.com/kb/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail.

Server version: 10.1.26-MariaDB key_buffer_size=33554432 read_buffer_size=131072 max_used_connections=0 max_threads=102 thread_count=0 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 152354 K bytes of memory Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... Cannot determine thread, fp=0x48400, backtrace may not be correct. Bogus stack limit or frame pointer, fp=0x48400, stack_bottom=0x7fff04ad0000, thread_stack=295936, aborting backtrace. The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash.

When I switch back to: image: wodby/mariadb:10.1-2.1.0 then it's fine.

Vacilando avatar Sep 15 '17 21:09 Vacilando

I have the same problem as @Vacilando under Windows 10 Pro with docker version 17.06.2-ce, build cec0b72 and docker-compose version 1.14.0, build c7bdf9e3. I use the image wodby/mariadb:10.1-2.3.3.

The same image (respectively the same docker-compose / project configuration) under Mac OS X and Linux there is no problem. If I go back to image version wodby/mariadb:10.1-2.0.0, under Windows 10 all works again.

With wodby/mariadb:10.1-2.3.5, I get the same mysql error:

[ERROR] InnoDB: Tried to read 16384 bytes at offset 81920. Was only able to read 0. InnoDB: Operating system error number 22 in a file operation.

It seems that the problem is a windows only problem and is related to the filesystem (file layer in docker): https://github.com/docker-library/mariadb/issues/58

If I delete the database files from volume and mariadb creates the db new, the following error occurs:

InnoDB: Completed initialization of buffer pool InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created! InnoDB: Setting file ./ibdata1 size to 10 MB InnoDB: Error: Write to file ./ibdata1 failed at offset 0. InnoDB: 1048576 bytes should have been written, only 0 were written. InnoDB: Operating system error number 22. InnoDB: Check that your OS and file system support files of this size. InnoDB: Check also that the disk is not full or a disk quota exceeded. InnoDB: Error number 22 means 'Invalid argument'.

cbeier avatar Sep 23 '17 14:09 cbeier

I am experiencing a similar problem, mariadb won't stay up (Status: Exit 1 when checking with docker-compose ps) I checked the logs with portainer (http://portainer.drupal.docker.localhost:8000 ) and ran across the following errors [Note] Recovering after a crash using tc.log 2017-11-26 13:33:41 140056255667016 [ERROR] Can't init tc log 2017-11-26 13:33:41 140056255667016 [ERROR] Aborting

I tried commenting out the volumes section of the mariadb service as suggested in https://github.com/wodby/docker4drupal/issues/37 , no luck there.

As @csandanov suggested in https://github.com/wodby/mariadb/issues/2 recreating the containers worked for me. So running docker system prune might work for someone else too.

f1rf1n avatar Nov 26 '17 15:11 f1rf1n

If you run MariaDB on windows with a bind mount from host see https://github.com/wodby/docker4drupal/issues/222#issuecomment-376823130

csandanov avatar Mar 28 '18 10:03 csandanov