akhomy / docker-compose-lamp

Docker Compose LAMP stack
MIT License
84 stars 31 forks source link

MariaDB doesn't start #4

Closed migoth closed 6 years ago

migoth commented 6 years ago

I tried to start the container via docker toolbox for windows. However, I get the following error with MariaDB:

180122 7:41:23 [Note] mysqld (mysqld 10.0.33-MariaDB-1~jessie) starting as process 1 ... 180122 7:41:23 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive 180122 7:41:23 [Note] InnoDB: Using mutexes to ref count buffer pool pages 180122 7:41:23 [Note] InnoDB: The InnoDB memory heap is disabled 180122 7:41:23 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 180122 7:41:23 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 180122 7:41:23 [Note] InnoDB: Compressed tables use zlib 1.2.8 180122 7:41:23 [Note] InnoDB: Using Linux native AIO 180122 7:41:23 [Note] InnoDB: Using CPU crc32 instructions 180122 7:41:23 [Note] InnoDB: Initializing buffer pool, size = 256.0M 180122 7:41:23 [Note] InnoDB: Completed initialization of buffer pool 180122 7:41:23 [Warning] InnoDB: Failed to set O_DIRECT on file ./ibdata1: OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs, see MySQL Bug#26662. 180122 7:41:23 [Note] InnoDB: Restoring page 0 of tablespace 0 180122 7:41:23 [Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0 180122 7:41:23 [ERROR] InnoDB: space header page consists of zero bytes in data file ./ibdata1 180122 7:41:23 [ERROR] InnoDB: Could not open or create the system tablespace. If you 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 those 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! 180122 7:41:23 [ERROR] Plugin 'InnoDB' init function returned error. 180122 7:41:23 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 180122 7:41:23 [Note] Plugin 'FEEDBACK' is disabled. 180122 7:41:23 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 180122 7:41:23 [ERROR] Unknown/unsupported storage engine: InnoDB 180122 7:41:23 [ERROR] Aborting 2018-01-22T07:41:23.558629686Z 180122 7:41:23 [Note] mysqld: Shutdown complete 2018-01-22T07:41:23.564745201Z

akhomy commented 6 years ago

@Migoth I'm not sure about Docker Toolkit for Windows, I tested it via Docker Toolbox and I recommend this in README, besides I could check this on the Docker Toolkit, but it will be near next 5-7 days.

migoth commented 6 years ago

@a-kom Sry, i meant Docker Toolbox. And I proceeded to the README.

akhomy commented 6 years ago

@Migoth, okay, I'll double check this today, could you add more info? Did you use last release of Docker Compose LAMP? Could you provide list of steps to reproduce issue?

migoth commented 6 years ago

@a-kom I just downloaded the last release of docker-compose-lamp and proceeded to the README. Im using Windows 10 Pro.

akhomy commented 6 years ago

@Migoth, okay, will check this today in 6 hours, seems this error isn't related to Docker Compose LAMP, besides as a fast solution you could change image: mariadb:10.0 to image: mysql inside docker-compose.yml.

migoth commented 6 years ago

When I change the image to mysql I get the following error:

Initializing database 2018-01-22T11:05:08.370341Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2018-01-22T11:05:08.396820Z 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive 2018-01-22T11:05:09.385622Z 0 [ERROR] InnoDB: Operating system error number 22 in a file operation. 2018-01-22T11:05:09.385751Z 0 [ERROR] InnoDB: Error number 22 means 'Invalid argument' 2018-01-22T11:05:09.385802Z 0 [ERROR] InnoDB: File ./ib_logfile101: 'aio write' returned OS error 122. Cannot continue operation 2018-01-22T11:05:09.385832Z 0 [ERROR] InnoDB: Cannot continue operation.

akhomy commented 6 years ago

@Migoth, so this apply after you run docker-compose up -d?

migoth commented 6 years ago

Yes. Or docker-compose up -d --force-recreate

akhomy commented 6 years ago

@Migoth, pls run: 1) docker-compose stop && docker-compose rm -f 2) Remove folder docker/runtime/mysql 3) Run docker-compose up -d I'm not sure if this help in this case, but you'll recreate from scratch and run on clean docker containers. Also, I'll check this on Windows today later.

migoth commented 6 years ago

@a-kom Unfortunately, I have already tried that. Does not bring anything

akhomy commented 6 years ago

@Migoth, currently, I checked this on Linux and all works fine. Wait for my reply today about Windows.

migoth commented 6 years ago

Yes, everything is running in Linux. Unfortunately not on Windows.

migoth commented 6 years ago

I got a db server up and running. I downloaded mysql:8.0.

My changes in docker-compose.yml

mysql: build: docker/images/mysql/

image: mysql

    volumes:
        - "./.data/db:/var/lib/mysql"
    environment:
        MYSQL_ROOT_PASSWORD: root
        MYSQL_USER: simplitec
        MYSQL_PASSWORD: 123
        MYSQL_DATABASE: simplitec
    # command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci # The simple way to override the mariadb config.
    networks:
        - internal

and i added innodb_use_native_aio=0 to the docker.cnf of mysql.

akhomy commented 6 years ago

@Migoth, could you provide the original docker-compose.yml file that use and that caused the issue? I want to clarify it and check in case to reproduce and understand issue.

migoth commented 6 years ago

docker-compose.txt

akhomy commented 6 years ago

@Migoth, thank you.

akhomy commented 6 years ago

@Migoth I'm not sure about the problem, I'll try to check it on the Virtual Box with the fresh install, but on my home Windows (Windows 10 PRO) it works fine, I installed successfully the last version of Drupal. Seems, it is related to your system or installation of the Docker Toolbox.

akhomy commented 6 years ago

@Migoth, could you provide the example of the docker build file for mysql?

akhomy commented 6 years ago

After all. If you want to archive your project on Linux and extract to use on Windows with Docker Toolbox just remove ibdata and ib_logfile* files in your MySQL data directory. Uncomment in docker-compose.yml section # build: docker/images/mysql/. and remove section image: mysql. Then run a command: docker-compose stop && docker-compose rm -f && docker-compose up --build -d To verify MySQL container work run a command: docker-compose ps.