kubernetes mariadb fails to start on create database - docker

I am trying to deploy mariadb to my local kubernetes cluster. I'm building the image with the following Dockerfile:
FROM mariadb:10.2
ENV MYSQL_DATABASE=k8_demo \
MYSQL_ROOT_PASSWORD=***** \
MYSQL_ROOT_HOST=%
ADD mysql.cnf /etc/mysql/conf.d
ADD startup.sql /docker-entrypoint-initdb.d
EXPOSE 3306
startup.sql:
GRANT USAGE ON *.* TO 'root'#'%' IDENTIFIED BY '*****';
GRANT ALL PRIVILEGES ON *.* TO 'root'#'%';
FLUSH PRIVILEGES;
mysql.cnf:
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
# Where the database files are stored inside the container
datadir = /var/lib/mysql
# My application special configuration
max_allowed_packet = 256M
sql-mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'
# Accept connections from any IP address
bind-address = 0.0.0.0
Deploying the following deployment.yaml file:
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysqldb
labels:
app: mysqldb
spec:
replicas: 1
template:
metadata:
name: mysqldb
labels:
app: mysqldb
spec:
containers:
- name: mysqldb
image: manuel/mysqldb
ports:
- containerPort: 3306
env:
- name: MYSQL_DATABASE
valueFrom:
configMapKeyRef:
name: mysqldb
key: db-name
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysqldb
key: db-password
imagePullPolicy: Never
restartPolicy: Always
selector:
matchLabels:
app: mysqldb
---
apiVersion: v1
kind: Service
metadata:
name: mysqldb
spec:
selector:
app: mysqldb
ports:
- port: 3307
The pod log as follows is not really helpful:
2020-05-19 15:13:17+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.2.31+maria~bionic started.
2020-05-19 15:13:17+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-05-19 15:13:17+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.2.31+maria~bionic started.
2020-05-19 15:13:18+00:00 [Note] [Entrypoint]: Initializing database files
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h password 'new-password'
Alternatively you can run:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.
Please report any problems at http://mariadb.org/jira
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
2020-05-19 15:13:20+00:00 [Note] [Entrypoint]: Database files initialized
2020-05-19 15:13:20+00:00 [Note] [Entrypoint]: Starting temporary server
2020-05-19 15:13:20+00:00 [Note] [Entrypoint]: Waiting for server startup
2020-05-19 15:13:20 139865539991232 [Note] mysqld (mysqld 10.2.31-MariaDB-1:10.2.31+maria~bionic) starting as process 124 ...
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Uses event mutexes
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Using Linux native AIO
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Number of pools: 1
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Using SSE2 crc32 instructions
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Completed initialization of buffer pool
2020-05-19 15:13:20 139864817927936 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Highest supported file format is Barracuda.
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: Waiting for purge to start
2020-05-19 15:13:20 139865539991232 [Note] InnoDB: 5.7.29 started; log sequence number 1615502
2020-05-19 15:13:20 139864578180864 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-05-19 15:13:20 139864578180864 [Note] InnoDB: Buffer pool(s) load completed at 200519 15:13:20
2020-05-19 15:13:20 139865539991232 [Note] Plugin 'FEEDBACK' is disabled.
2020-05-19 15:13:20 139865539991232 [Warning] 'user' entry 'root#mysqldb-5fcbfd4df8-qdpfq' ignored in --skip-name-resolve mode.
2020-05-19 15:13:20 139865539991232 [Warning] 'proxies_priv' entry '#% root#mysqldb-5fcbfd4df8-qdpfq' ignored in --skip-name-resolve mode.
2020-05-19 15:13:20 139865539991232 [Note] Reading of all Master_info entries succeeded
2020-05-19 15:13:20 139865539991232 [Note] Added new Master_info '' to hash table
2020-05-19 15:13:20 139865539991232 [Note] mysqld: ready for connections.
Version: '10.2.31-MariaDB-1:10.2.31+maria~bionic' socket: '/var/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution
2020-05-19 15:13:21+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
2020-05-19 15:13:24 139864904218368 [Warning] 'proxies_priv' entry '#% root#mysqldb-5fcbfd4df8-qdpfq' ignored in --skip-name-resolve mode.
2020-05-19 15:13:24+00:00 [Note] [Entrypoint]: Creating database mysqldb
mysql: unknown option '--"'
I'm now looking into https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/ since it might have something to do with the volume...
https://github.com/docker-library/mariadb/issues/76
What option is it referring to? Is there a way to get more information, since opening a shell is not possible since the container keeps crashing.
edit: added content of startup.sql and mysql.cnf
edit: typo

Related

docker desktop run automatically a container into an docker compose structure

Each time I start my docker desktop application into Windows 11 OS,
It launch automatically a container into a docker-compose structure.
But not the others containers into this docker-compose.
I dealing with a MariaDB container...
My Apache container and my PHP container not run automatically. Just MariaDB
This is my docker-compose.yml file :
version: '3'
services:
apache:
build: ./docker/apache
container_name: projectx_apache
tty: true
ports:
- '443:443'
depends_on:
- php
- mariadb
volumes:
- ./:/var/www/projectx/
php:
build: ./docker/php
container_name: projectx_php
tty: true
volumes:
- ./:/var/www/projectx/
mariadb:
build: ./docker/mariadb
container_name: projectx_mariadb
restart: always
tty: true
environment:
MYSQL_ROOT_PASSWORD: docker
MYSQL_DATABASE: projectx
MYSQL_USER: docker
MYSQL_PASSWORD: docker
ports:
- '3306:3306'
this is my Dockerfile for MariaDB container :
FROM mariadb:latest
ENV MYSQL_ROOT_PASSWORD docker
ENV MYSQL_DATABASE projectx
ENV MYSQL_USER root
ENV MYSQL_PASSWORD docker
RUN apt-get -y update
RUN apt-get -y install vim
EXPOSE 3310
CMD ["mysqld"]
And this is my log container when It start automatically :
2022-11-15 14:16:33+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.4+maria~ubu2204 started.
2022-11-15 14:16:33+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-11-15 14:16:33+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.4+maria~ubu2204 started.
2022-11-15 14:16:34+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
2022-11-15 14:16:34 0 [Note] mysqld (server 10.9.4-MariaDB-1:10.9.4+maria~ubu2204) starting as process 1 ...
2022-11-15 14:16:34 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-11-15 14:16:34 0 [Note] InnoDB: Number of transaction pools: 1
2022-11-15 14:16:34 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-11-15 14:16:34 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2022-11-15 14:16:34 0 [Warning] mysqld: io_uring_queue_init() failed with ENOMEM: try larger memory locked limit, ulimit -l, or https://mariadb.com/kb/en/systemd/#configuring-limitmemlock under systemd (262144 bytes required)
2022-11-15 14:16:34 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
2022-11-15 14:16:34 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2022-11-15 14:16:34 0 [Note] InnoDB: Completed initialization of buffer pool
2022-11-15 14:16:34 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
2022-11-15 14:16:34 0 [Note] InnoDB: 128 rollback segments are active.
2022-11-15 14:16:34 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2022-11-15 14:16:34 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2022-11-15 14:16:34 0 [Note] InnoDB: log sequence number 1489638494; transaction id 8288
2022-11-15 14:16:34 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-11-15 14:16:34 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-11-15 14:16:34 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-11-15 14:16:34 0 [Note] Server socket created on IP: '0.0.0.0'.
2022-11-15 14:16:34 0 [Note] Server socket created on IP: '::'.
2022-11-15 14:16:34 0 [Note] mysqld: ready for connections.
Version: '10.9.4-MariaDB-1:10.9.4+maria~ubu2204' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
2022-11-15 14:16:34 0 [Note] InnoDB: Buffer pool(s) load completed at 221115 14:16:34
Do you have an idea why this container start automatically ?
The reason for automatic start here is restart: always on MariaDB container,
It will start the container when the docker daemon restart. See
restart policy

pymysql.err.OperationalError: (1130, '172.18.0.3' is not allowed to connect to this MariaDB server)

I have a dockerized app and use the following docker-compose.yml file:
version: '3.7'
services:
app:
restart: always
build: ./app
ports:
- "8501:8501"
env_file:
- .env
command: streamlit run Main.py
networks:
- streamlit_network
mariadb:
image: mariadb:10.5.17
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
- db_conf:/etc/mysql/conf.d
environment:
MYSQL_ROOT_PASSWORD: "root"
MYSQL_DATABASE: "db"
MYSQL_USER: "user"
MYSQL_PASSWORD: "password"
networks:
- streamlit_network
nginx:
restart: always
build: ./nginx
ports:
- "80:80"
depends_on:
- app
- mariadb
networks:
- streamlit_network
volumes:
db_data:
db_conf:
networks:
streamlit_network:
driver: bridge
I am able to access mysql using the following commands:
mysql -h <ip-address where database is hosted> -p -u username database
inside of my ubuntu machine which has a host IP of
How do I achieve the same within docker container
I believe '172.18.0.3' is a randomly generated ip address by docker as the IP address did change to '172.18.0.2' on another occasion.
The .env file is:
host="mariadb"
user="user"
password="password"
database="db"
port="3306"
This is the trace for mariadb when I am running docker-compose up:
mariadb_1 | 2022-10-27 12:20:24+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.3+maria~ubu2204 started.
mariadb_1 | 2022-10-27 12:20:25+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
mariadb_1 | 2022-10-27 12:20:25+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.3+maria~ubu2204 started.
mariadb_1 | 2022-10-27 12:20:26+00:00 [Note] [Entrypoint]: MariaDB upgrade information missing, assuming required
mariadb_1 | 2022-10-27 12:20:26+00:00 [Note] [Entrypoint]: MariaDB upgrade (mariadb-upgrade) required, but skipped due to $MARIADB_AUTO_UPGRADE setting
mariadb_1 | 2022-10-27 12:20:26 0 [Note] mariadbd (server 10.9.3-MariaDB-1:10.9.3+maria~ubu2204) starting as process 1 ...
mariadb_1 | 2022-10-27 12:20:26 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mariadb_1 | 2022-10-27 12:20:26 0 [Note] InnoDB: Number of transaction pools: 1
mariadb_1 | 2022-10-27 12:20:26 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
mariadb_1 | 2022-10-27 12:20:26 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
mariadb_1 | 2022-10-27 12:20:26 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
mariadb_1 | 2022-10-27 12:20:26 0 [Note] InnoDB: Completed initialization of buffer pool
mariadb_1 | 2022-10-27 12:20:26 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
mariadb_1 | 2022-10-27 12:20:27 0 [Note] InnoDB: 128 rollback segments are active.
mariadb_1 | 2022-10-27 12:20:27 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
mariadb_1 | 2022-10-27 12:20:27 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
mariadb_1 | 2022-10-27 12:20:27 0 [Note] InnoDB: log sequence number 35204; transaction id 8
mariadb_1 | 2022-10-27 12:20:27 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mariadb_1 | 2022-10-27 12:20:27 0 [Note] Plugin 'FEEDBACK' is disabled.
mariadb_1 | 2022-10-27 12:20:27 0 [Note] InnoDB: Buffer pool(s) load completed at 221027 12:20:27
mariadb_1 | 2022-10-27 12:20:27 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
mariadb_1 | 2022-10-27 12:20:28 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
mariadb_1 | 2022-10-27 12:20:28 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
mariadb_1 | 2022-10-27 12:20:28 0 [Note] Server socket created on IP: '0.0.0.0'.
mariadb_1 | 2022-10-27 12:20:28 0 [Note] Server socket created on IP: '::'.
mariadb_1 | 2022-10-27 12:20:28 0 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it
mariadb_1 | 2022-10-27 12:20:28 0 [ERROR] Missing system table mysql.roles_mapping; please run mysql_upgrade to create it
mariadb_1 | 2022-10-27 12:20:28 0 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
mariadb_1 | 2022-10-27 12:20:28 0 [ERROR] Can't open the mysql.func table. Please run mysql_upgrade to create it.
mariadb_1 | 2022-10-27 12:20:28 0 [ERROR] Cannot open mysql.event
mariadb_1 | 2022-10-27 12:20:28 0 [ERROR] mariadbd: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
mariadb_1 | 2022-10-27 12:20:28 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
mariadb_1 | 2022-10-27 12:20:28 0 [Note] mariadbd: ready for connections.
mariadb_1 | Version: '10.9.3-MariaDB-1:10.9.3+maria~ubu2204' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
mariadb_1 | 2022-10-27 12:27:27 3 [Warning] Aborted connection 3 to db: 'unconnected' user: 'unauthenticated' host: '172.18.0.2' (This connection closed normally without authentication)
mariadb_1 | 2022-10-27 12:35:05 4 [Warning] Aborted connection 4 to db: 'unconnected' user: 'unauthenticated' host: '172.18.0.2' (This connection closed normally without authentication)

Invoice Ninja with docker compose - Error 500

I have setup Invoice ninja with docker-compose behind a nginx reverse proxy, which also manages the TLS certificate.
As far as I can see from the logs, everything initializes correct, but when I navigate to the site, I can only see a 500 Server error.
I provided my docker-compose and the logs until the first 500 error below.
Thanks in advance!
docker-compose.yml
version: '3.7'
services:
server:
image: caddy:alpine
restart: always
environment:
- APP_URL=http://ninja.example.de
volumes:
# Vhost configuration
- ./config/caddy/Caddyfile:/etc/caddy/Caddyfile
- ./public:/var/www/app/public
- ./storage:/var/www/app/storage
depends_on:
- app
# Run webserver nginx on port 80
# Feel free to modify depending what port is already occupied
ports:
- "127.0.0.1:4301:80"
# - "443:443"
networks:
- invoiceninja
app:
image: invoiceninja/invoiceninja:5
restart: always
environment:
- APP_URL=ninja.example.de
- APP_KEY=base64:mykeyxzy
- MULTI_DB_ENABLED=false
- DB_HOST1=db
volumes:
- ./public:/var/www/app/public
- ./storage:/var/www/app/storage
depends_on:
- db
networks:
- invoiceninja
db:
image: mysql:5
restart: always
environment:
- MYSQL_ROOT_PASSWORD=mypassword
- MYSQL_USER=ninja
- MYSQL_PASSWORD=ninja
- MYSQL_DATABASE=db-ninja-01
volumes:
- ./mysql/data:/var/lib/mysql
networks:
- invoiceninja
# cron:
# cron is commented out by me
volumes:
mysql-data:
public:
storage:
networks:
invoiceninja:
docker log
server_1 | {"level":"info","ts":1590774949.786359,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
server_1 | {"level":"info","ts":1590774949.7946017,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019"]}
server_1 | {"level":"info","ts":1590774949.7968726,"logger":"http","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80}
server_1 | 2020/05/29 17:55:49 [INFO][cache:0xc00075e0a0] Started certificate maintenance routine
server_1 | {"level":"info","ts":1590774949.7995124,"logger":"tls","msg":"cleaned up storage units"}
server_1 | {"level":"info","ts":1590774949.799886,"msg":"autosaved config","file":"/config/caddy/autosave.json"}
server_1 | {"level":"info","ts":1590774949.799923,"msg":"serving initial configuration"}
app_1 | Configuration cache cleared!
app_1 | Configuration cached successfully!
app_1 | Route cache cleared!
app_1 | Routes cached successfully!
app_1 | Files cached successfully!
app_1 | [29-May-2020 17:55:49] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
app_1 | [29-May-2020 17:55:49] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
app_1 | [29-May-2020 17:55:49] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
app_1 | [29-May-2020 17:55:49] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
app_1 | [29-May-2020 17:55:49] NOTICE: fpm is running, pid 1
app_1 | [29-May-2020 17:55:49] NOTICE: ready to handle connections
db_1 | 2020-05-29 17:55:48+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.30-1debian10 started.
db_1 | 2020-05-29 17:55:48+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_1 | 2020-05-29 17:55:48+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.30-1debian10 started.
db_1 | 2020-05-29T17:55:48.703457Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db_1 | 2020-05-29T17:55:48.708189Z 0 [Note] mysqld (mysqld 5.7.30) starting as process 1 ...
db_1 | 2020-05-29T17:55:48.714931Z 0 [Note] InnoDB: PUNCH HOLE support available
db_1 | 2020-05-29T17:55:48.714988Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1 | 2020-05-29T17:55:48.714995Z 0 [Note] InnoDB: Uses event mutexes
db_1 | 2020-05-29T17:55:48.714999Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db_1 | 2020-05-29T17:55:48.715002Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1 | 2020-05-29T17:55:48.715011Z 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2020-05-29T17:55:48.715701Z 0 [Note] InnoDB: Number of pools: 1
db_1 | 2020-05-29T17:55:48.716017Z 0 [Note] InnoDB: Using CPU crc32 instructions
db_1 | 2020-05-29T17:55:48.722484Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db_1 | 2020-05-29T17:55:48.741778Z 0 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2020-05-29T17:55:48.747111Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1 | 2020-05-29T17:55:48.763090Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db_1 | 2020-05-29T17:55:48.798980Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2020-05-29T17:55:48.799233Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1 | 2020-05-29T17:55:48.832312Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1 | 2020-05-29T17:55:48.834307Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db_1 | 2020-05-29T17:55:48.834434Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
db_1 | 2020-05-29T17:55:48.835099Z 0 [Note] InnoDB: Waiting for purge to start
db_1 | 2020-05-29T17:55:48.885461Z 0 [Note] InnoDB: 5.7.30 started; log sequence number 12488420
db_1 | 2020-05-29T17:55:48.886497Z 0 [Note] Plugin 'FEDERATED' is disabled.
db_1 | 2020-05-29T17:55:48.897039Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1 | 2020-05-29T17:55:48.906339Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
db_1 | 2020-05-29T17:55:48.906387Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
db_1 | 2020-05-29T17:55:48.907291Z 0 [Warning] CA certificate ca.pem is self signed.
db_1 | 2020-05-29T17:55:48.907356Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
db_1 | 2020-05-29T17:55:48.908141Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200529 17:55:48
db_1 | 2020-05-29T17:55:48.909168Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
db_1 | 2020-05-29T17:55:48.909863Z 0 [Note] IPv6 is available.
db_1 | 2020-05-29T17:55:48.909911Z 0 [Note] - '::' resolves to '::';
db_1 | 2020-05-29T17:55:48.909952Z 0 [Note] Server socket created on IP: '::'.
db_1 | 2020-05-29T17:55:48.914971Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db_1 | 2020-05-29T17:55:48.932266Z 0 [Note] Event Scheduler: Loaded 0 events
db_1 | 2020-05-29T17:55:48.932616Z 0 [Note] mysqld: ready for connections.
db_1 | Version: '5.7.30' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
app_1 | 192.168.48.5 - 29/May/2020:17:59:07 +0000 "GET /index.php" 500
This errors occurs dues to the facts that the application cannot correctly determine the passed application key APP_KEY. It seems the application cache is a bit reluctant to be refreshed - this is only a problem in the docker containers and not for the self-host option w/o docker.
I pushed an update to the for the latest and 5 tags. So first, please update your images. This fixes some permission to get proper write permissions to some cache folders.
Then after your docker-compose setup started please run
docker-compose exec app php artisan config:cache
a couple of times and refresh your page. It takes some time and a couple of calls till the cache is refreshed. The error message then changes to SQLSTATE[42S02]: Base table or view not found: this is a know problem but can be fixed (for now) by navigation to /setup which then will run the proper migrations.

Docker On windows10 Volume permissions " a STORAGE ENGINE failed."

This morning i try to install Docker on my laptop (windows10),
(My Docker use hyper-v)
I try to use this basic docker-compose
version: '2'
services:
mariadb:
image: mariadb
container_name: mariadb
ports:
- "3306:3306"
volumes:
- ./mysql1/:/var/lib/mysql
environment:
MYSQL_USER : root
MYSQL_ROOT_PASSWORD: root
I have some error on running :
docker-compose up
Creating mariadb
Attaching to mariadb
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] mysqld (mysqld 10.1.22-MariaDB-1~jessie) starting as process 1 ...
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] InnoDB: Using mutexes to ref count buffer pool pages
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] InnoDB: The InnoDB memory heap is disabled
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] InnoDB: Compressed tables use zlib 1.2.8
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] InnoDB: Using Linux native AIO
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] InnoDB: Using SSE crc32 instructions
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] InnoDB: Initializing buffer pool, size = 256.0M
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] InnoDB: Completed initialization of buffer pool
mariadb | 2017-04-04 8:29:00 140557637724096 [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 | 2017-04-04 8:29:00 140557637724096 [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!
mariadb | 2017-04-04 8:29:00 140557637724096 [ERROR] Plugin 'InnoDB' init function returned error.
mariadb | 2017-04-04 8:29:00 140557637724096 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mariadb | 2017-04-04 8:29:00 140557637724096 [Note] Plugin 'FEEDBACK' is disabled.
mariadb | 2017-04-04 8:29:00 140557637724096 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
mariadb | 2017-04-04 8:29:00 140557637724096 [ERROR] Unknown/unsupported storage engine: InnoDB
mariadb | 2017-04-04 8:29:00 140557637724096 [ERROR] Aborting
mariadb |
mariadb exited with code 1
after running my directory ./mysql1/ and subfile was created :
C:\USERS\--------\DOCUMENTS\DOCKER\MARIADB\MYSQL1
| aria_log.00000001
| aria_log_control
| ibdata1
|
\---mysql
Yes I know that it's about my volumes (something about permissions or access or ...)
I have no ideas how solve it.
I was experiencing the same issue and the only way I could figure out how to resolve this was to delete the MARIADB\MYSQL1 folder. Yes, I lost all of the database records from all of my development sites, but for me, it was all test information anyway so no real data was lost.
After I deleted the MYSQL1 folder, I ran:
docker-compose build --no-cache MariaDB
Then I started up the container:
docker-compose up -d mariadb
The error finally went away and I was able to use my MariaDB container again. Hope this helps someone in the future!

Docker-compose cannot start mysql, permission denied to /tmp

I'm trying to start a docker container from the vanilla mariadb image from docker hub using docker-compose. While everything previously worked, I'm now getting the error message Can't create/write to file '/tmp/ibLTxiq7' (Errcode: 13 "Permission denied"). Here's the full log:
139707238336448 [Note] /usr/sbin/mysqld (mysqld 10.1.14-MariaDB-1~jessie) starting as process 51 ...
139707238336448 [Note] InnoDB: Using mutexes to ref count buffer pool pages
139707238336448 [Note] InnoDB: The InnoDB memory heap is disabled
139707238336448 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
139707238336448 [Note] InnoDB: Memory barrier is not used
139707238336448 [Note] InnoDB: Compressed tables use zlib 1.2.8
139707238336448 [Note] InnoDB: Using Linux native AIO
139707238336448 [Note] InnoDB: Using SSE crc32 instructions
139707238336448 [ERROR] mysqld: Can't create/write to file '/tmp/ibLTxiq7' (Errcode: 13 "Permission denied")
7f10205047c0 InnoDB: Error: unable to create temporary file; errno: 13
139707238336448 [ERROR] Plugin 'InnoDB' init function returned error.
139707238336448 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
139707238336448 [ERROR] Unknown/unsupported storage engine: InnoDB
139707238336448 [ERROR] Aborting
I don't understand, does the /tmp folder in the log refer to the host machine or the container? How would I fix this issue?
The command I'm trying to run (as root user) is docker-compose up db. I've checked that there indeed is space on the disk. My OS Ubuntu 16.04.
Update: My docker-compose.yml-file
https-portal:
image: steveltn/https-portal
ports:
- '80:80'
- '443:443'
links:
- wordpress
restart: always
environment:
DOMAINS: 'domain.com -> http://wordpress'
STAGE: 'production'
wordpress:
image: wordpress
links:
- db:mysql
volumes:
- ~/wordpress/wp_html:/var/www/html
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: [---]
Update 2:
I seem to have (at least temporarily) solved the problem, rather surprisingly, by adding a volume mount path for the db container:
db:
image: mariadb
volumes:
- /data/maridb:/var/lib/mysql
However this does not actually affect anything, it just prints a warning that the volume mount is not used (and indeed it isn't) because the container has previously been created with a different volume and the old one is used. Still, the original problem disappears. Any thoughts on what causes this behavior?

Resources