Skip to content

Unknown MySQL server host 'mariadb' #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Vacilando opened this issue Aug 24, 2017 · 7 comments
Open

Unknown MySQL server host 'mariadb' #179

Vacilando opened this issue Aug 24, 2017 · 7 comments

Comments

@Vacilando
Copy link

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 |

@csandanov
Copy link
Member

Try to clean up your volumes and run again

@Vacilando
Copy link
Author

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.

@csandanov
Copy link
Member

Try tag 2.3.5, it comes with mariadb 10.1.26

@Vacilando
Copy link
Author

Vacilando commented Sep 15, 2017

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.

@cbeier
Copy link

cbeier commented Sep 23, 2017

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): MariaDB/mariadb-docker#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'.

@f1rf1n
Copy link

f1rf1n commented Nov 26, 2017

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 #37 , no luck there.

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

@csandanov
Copy link
Member

If you run MariaDB on windows with a bind mount from host see #222 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants