Issue with the "Use a MySQL Database" doc
renhyl opened this issue · 1 comments
I found an issue with this document.
Title: Use a MySQL Database
Location: /docs/app-guides/mysql-on-fly/
Source: https://github.com/superfly/docs/blob/main/app-guides/mysql-on-fly.html.markerb
following a documentation for deploying mysql db and it keeps crashing.
❯ fly deploy
==> Verifying app config
Validating /home/damian/work/spark-db/fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
Searching for image 'mysql:8' remotely...
image found: img_rj5yv1jjwrj7vdwq
Watch your deployment at https://fly.io/apps/spark-db-1/monitoring
Updating existing machines in 'spark-db-1' with rolling strategy
Smoke checks for 178151d2b42608 failed: the app appears to be crashing
Check its logs: here's the last lines below, or run 'fly logs -i 178151d2b42608':
Successfully prepared image docker-hub-mirror.fly.io/library/mysql:8 (635.770181ms)
Setting up volume 'mysqldata'
Opening encrypted volume
Configuring firecracker
2024-05-16T22:25:53.952696490 [01HY1R617A5QN6JGTT9BZNEVGE:main] Running Firecracker v1.7.0
[ 0.069724] PCI: Fatal: No config space access function found
INFO Starting init (commit: d772ddd9)...
INFO Mounting /dev/vdc at /data w/ uid: 0, gid: 0 and chmod 0755
INFO Resized /data to 1056964608 bytes
INFO Preparing to run: docker-entrypoint.sh --datadir /data/mysql --default-authentication-plugin mysql_native_password
as root
INFO [fly api proxy] listening at /.fly/api
2024/05/16 22:25:54 INFO SSH listening listen_address=[fdaa:9:3dd3:a7b:15d:24cf:bea7:2]:22 dns_server=[fdaa::3]:53
Machine created and started in 1.552s
2024-05-16 22:25:54+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
2024-05-16 22:25:54+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-05-16 22:25:54+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-05-16T22:25:55.074351Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-05-16T22:25:55.437374Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 322
2024-05-16T22:25:55.450772Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-16T22:25:55.597721Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files.
2024-05-16T22:25:55.597846Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2024-05-16T22:25:56.015228Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2024-05-16T22:25:56.015489Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-05-16T22:25:56.015502Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-05-16T22:25:56.016713Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL.
2024-05-16T22:25:56.016722Z 0 [System] [MY-015016] [Server] MySQL Server - end.
INFO Main child exited normally with code: 1
INFO Starting clean up.
INFO Umounting /dev/vdc from /data
WARN could not unmount /rootfs: EINVAL: Invalid argument
[ 2.429852] reboot: Restarting system
machine did not have a restart policy, defaulting to restart
2024-05-16T22:25:56.816333276 [01HY1R617A5QN6JGTT9BZNEVGE:main] Running Firecracker v1.7.0
[ 0.070298] PCI: Fatal: No config space access function found
INFO Starting init (commit: d772ddd9)...
INFO Mounting /dev/vdc at /data w/ uid: 0, gid: 0 and chmod 0755
INFO Resized /data to 1056964608 bytes
INFO Preparing to run: docker-entrypoint.sh --datadir /data/mysql --default-authentication-plugin mysql_native_password
as root
INFO [fly api proxy] listening at /.fly/api
2024/05/16 22:25:57 INFO SSH listening listen_address=[fdaa:9:3dd3:a7b:15d:24cf:bea7:2]:22 dns_server=[fdaa::3]:53
2024-05-16 22:25:57+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
Machine started in 621ms
2024-05-16 22:25:57+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-05-16 22:25:57+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-05-16T22:25:57.932978Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-05-16T22:25:58.289354Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 322
2024-05-16T22:25:58.302144Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-16T22:25:58.450922Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files.
2024-05-16T22:25:58.451048Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2024-05-16T22:25:58.868123Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2024-05-16T22:25:58.868372Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-05-16T22:25:58.868385Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-05-16T22:25:58.869522Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL.
2024-05-16T22:25:58.869529Z 0 [System] [MY-015016] [Server] MySQL Server - end.
✖ Machine 178151d2b42608 [app] update failed: smoke checks for 178151d2b42608 failed: the app appears to be crashing
Error: smoke checks for 178151d2b42608 failed: the app appears to be crashing
~/work/spark-db 9s 23:26:02
❯ fly deploy
==> Verifying app config
Validating /home/damian/work/spark-db/fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
Searching for image 'mysql:8' remotely...
image found: img_rj5yv1jjwrj7vdwq
Watch your deployment at https://fly.io/apps/spark-db-1/monitoring
Updating existing machines in 'spark-db-1' with rolling strategy
Smoke checks for 178151d2b42608 failed: the app appears to be crashing
Check its logs: here's the last lines below, or run 'fly logs -i 178151d2b42608':
Successfully prepared image docker-hub-mirror.fly.io/library/mysql:8 (553.146642ms)
Setting up volume 'mysqldata'
Opening encrypted volume
Configuring firecracker
2024-05-16T22:26:40.765661424 [01HY1R7F0BVWRAFTR9BC2J38ER:main] Running Firecracker v1.7.0
[ 0.068724] PCI: Fatal: No config space access function found
INFO Starting init (commit: d772ddd9)...
INFO Mounting /dev/vdc at /data w/ uid: 0, gid: 0 and chmod 0755
INFO Resized /data to 1056964608 bytes
INFO Preparing to run: docker-entrypoint.sh --datadir /data/mysql --default-authentication-plugin mysql_native_password
as root
INFO [fly api proxy] listening at /.fly/api
2024/05/16 22:26:41 INFO SSH listening listen_address=[fdaa:9:3dd3:a7b:15d:24cf:bea7:2]:22 dns_server=[fdaa::3]:53
Machine created and started in 1.5s
2024-05-16 22:26:41+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
2024-05-16 22:26:41+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-05-16 22:26:41+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-05-16T22:26:41.870549Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-05-16T22:26:42.212348Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 322
2024-05-16T22:26:42.225411Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-16T22:26:42.373868Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files.
2024-05-16T22:26:42.374012Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2024-05-16T22:26:42.791121Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2024-05-16T22:26:42.791434Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-05-16T22:26:42.791453Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-05-16T22:26:42.793109Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL.
2024-05-16T22:26:42.793121Z 0 [System] [MY-015016] [Server] MySQL Server - end.
INFO Main child exited normally with code: 1
INFO Starting clean up.
INFO Umounting /dev/vdc from /data
WARN could not unmount /rootfs: EINVAL: Invalid argument
[ 2.434231] reboot: Restarting system
machine did not have a restart policy, defaulting to restart
2024-05-16T22:26:43.652232752 [01HY1R7F0BVWRAFTR9BC2J38ER:main] Running Firecracker v1.7.0
[ 0.072350] PCI: Fatal: No config space access function found
INFO Starting init (commit: d772ddd9)...
INFO Mounting /dev/vdc at /data w/ uid: 0, gid: 0 and chmod 0755
INFO Resized /data to 1056964608 bytes
INFO Preparing to run: docker-entrypoint.sh --datadir /data/mysql --default-authentication-plugin mysql_native_password
as root
INFO [fly api proxy] listening at /.fly/api
2024/05/16 22:26:44 INFO SSH listening listen_address=[fdaa:9:3dd3:a7b:15d:24cf:bea7:2]:22 dns_server=[fdaa::3]:53
2024-05-16 22:26:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
Machine started in 623ms
2024-05-16 22:26:44+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-05-16 22:26:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
✖ Machine 178151d2b42608 [app] update failed: smoke checks for 178151d2b42608 failed: the app appears to be crashing
Error: smoke checks for 178151d2b42608 failed: the app appears to be crashing
so it appears that mysql image now requires different configuration
[processes]
app = """--datadir /data/mysql \
--default-authentication-plugin mysql_native_password"""
change to:
[processes]
app = '--datadir /data/mysql --mysql-native-password=ON'
fixed the issue.