Docker container not working

Steps to reproduce

  1. Brand new installation of Ubuntu 18.04
  2. Followed the official instructions on to set up docker and docker-compose
  3. Followed instructions here to set up the yaml and .env file
  4. Run docker-compose up -d

Expected behaviour

ownCloud starts normally

Actual behaviour

ownCloud remains inaccessible after a while. docker ps shows the following:

fa2fe7d547eb owncloud/server:10.3 “/usr/bin/entrypoint…” 14 minutes ago Up 2 minutes (health: starting)>8080/tcp owncloud-docker-server_owncloud_1
27875de54373 webhippie/mariadb:latest “/usr/bin/entrypoint…” 14 minutes ago Up 14 minutes (unhealthy) 3306/tcp owncloud-docker-server_db_1
e0f7ae9bdcde webhippie/redis:latest “/usr/bin/entrypoint…” 14 minutes ago Up 14 minutes (healthy) 6379/tcp owncloud-docker-server_redis_1`

In addition, the following log entries seems to be suspicious

db_1 | > finished mysql_install_db
db_1 | > starting mariadb service
db_1 | 191208 22:02:33 mysqld_safe Logging to ‘/var/lib/mysql/27875de54373.err’.
db_1 | 191208 22:02:33 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
db_1 | > writing mariadb config
db_1 | gomplate version 3.1.0, build 2f357bd5 (2018-11-30T02:51:11Z)
db_1 | config is:
db_1 | input: /etc/templates/my.cnf.tmpl
db_1 | output: /etc/mysql/my.cnf
db_1 |
db_1 | rendered 1 template(s) with 0 error(s) in 1.106613ms
db_1 | > chown data directory
db_1 | > running mysql_install_db…
db_1 | Installing MariaDB/MySQL system tables in ‘/var/lib/mysql’ …
db_1 | 2019-12-08 22:02:35 0 [ERROR] InnoDB: The Auto-extending innodb_system data file ‘/var/lib/mysql/ibdata1’ is of a different size 0 pages than specified in the .cnf file: initial 640 pages, max 0 (relevant if non-zero) pages!
db_1 | 2019-12-08 22:02:35 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
db_1 | 2019-12-08 22:02:36 0 [ERROR] Plugin ‘InnoDB’ init function returned error.
db_1 | 2019-12-08 22:02:36 0 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
db_1 | 2019-12-08 22:02:36 0 [ERROR] Unknown/unsupported storage engine: InnoDB
db_1 | 2019-12-08 22:02:36 0 [ERROR] Aborting
db_1 | cat: write error: Broken pipe
db_1 | cat: write error: Broken pipe
db_1 | cat: write error: Broken pipe
db_1 | cat: write error: Broken pipe
db_1 |
db_1 | Installation of system tables failed! Examine the logs in
db_1 | /var/lib/mysql for more information.
db_1 |
db_1 | The problem could be conflicting information in an external
db_1 | my.cnf files. You can ignore these by doing:
db_1 |
db_1 | shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf
db_1 |
db_1 | You can also try to start the mysqld daemon with:
db_1 |
db_1 | shell> /usr/bin/mysqld --skip-grant-tables --general-log &
db_1 |
db_1 | and use the command line tool /usr/bin/mysql
db_1 | to connect to the mysql database and look at the grant tables:
db_1 |
db_1 | shell> /usr/bin/mysql -u root mysql
db_1 | mysql> show tables;
db_1 |
db_1 | Try ‘mysqld --help’ if you have problems with paths. Using
db_1 | --general-log gives you a log in /var/lib/mysql that may be helpful.`

The docker-compose.yml file and .env file is untouched.
Any help would be appreciated!

I’m not able to reproduce this behavior, however I’m on Ubuntu 19.10.
Which versions of docker did you end up installing?

dpkg -l | grep docker
ii  docker-compose                                1.21.0-3                                                                    all          Punctual, lightweight development environments using Docker
ii                                     19.03.2-0ubuntu1                                                            amd64        Linux container runtime

docker --version
Docker version 19.03.2, build 6a30dfca03

docker-compose --version
docker-compose version 1.21.0, build unknown

Have you tried restarting the mariadb-container? Though I doubt this will change anything.

What I believe happened is that something took too long during the installation and it ran into a timeout.

How much RAM and how many cores does your machine have?
Do you have enough disk space?

I guess there is no data in your containers yet, so you should be able to just try over and run it again.
Make sure to remove the volumes, when you do.

1 Like

Thanks for the help. My docker version is of the following:

$ dpkg -l | grep docker
ii docker-ce 5:19.03.5~3-0~ubuntu-bionic amd64 Docker: the open-source application container engine
ii docker-ce-cli 5:19.03.5~3-0~ubuntu-bionic amd64 Docker CLI: the open-source application container engine

$ docker --version
Docker version 19.03.5, build 633a0ea838

I tried restarting the containers but the db is still failing

I’m trying to run it on a VPS and the following is its specs

$ lshw

description: CPU
product: QEMU Virtual CPU version (cpu64-rhel6)
vendor: Intel Corp.
physical id: 400
bus info: cpu@0
version: RHEL 7.6.0 PC (i440FX + PIIX, 1996)
slot: CPU 0
size: 2GHz
capacity: 2GHz
width: 64 bits

configuration: cores=4 enabledcores=4 threads=1
description: System Memory
physical id: 1000
size: 4114MiB
capabilities: ecc

I reinstalled the system just to make sure it’s not a fluke and unfortunately the same error happened.

Thanks for your assistance!

Run a docker-compose down -v to bring the stack down and remove the volumes.

EDIT: This is a dangerous command if you don’t know what you are doing. END EDIT

Then you can try to start it again with docker-compose up -d

1 Like

Thanks for your help. Still no luck after removing the volumes. The same db error occurred on this run too. :frowning:


I just tried reproducing your error again, without any luck.
I used a cloud VM with Ubuntu 18.04.
I used the following instructions to install docker:

curl -fsSL | apt-key add -
add-apt-repository "deb [arch=amd64] bionic stable"
apt-get update; apt-get install docker-ce -y


To install docker-compose:

curl -L`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Check the latest docker-compose version:

Afterwards I copy pasted the instructions from the owncloud documentation and it worked flawlessly.

# Create a new project directory
mkdir owncloud-docker-server

cd owncloud-docker-server

# Copy docker-compose.yml from the GitHub repository

# Create the environment configuration file
cat << EOF > .env

# Build and start the container
docker-compose up -d

So if you take a fresh VM, this should work by just copy pasting all the commands from this post it should just work (I’ve tried it twice).

1 Like

Thank you so much for walking the extra mile to help. Did you execute all the command with root user? Because I did it all with normal user and sudo.

My personal opinion: As an admin, the first thing you do is run sudo -i and forget about the sudo in front of every single command

1 Like

Hi @l19980623 , I have the exact same problem with my instance of OwnCloud. After some research, I found that the problem is related with the docker volume spaces. You can check this by using df -h and you will see a disk usage more than 90%. You have to clean up some files and try to compose up again.

1 Like