[Question]: dependency failed to start: container ragflow-mysql is unhealthy
Self Checks
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (Language Policy).
- [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
- [x] Please do not modify this template :) and fill in all the required fields.
Describe your problem
when i run docker compose ,mysql can't start.
✘ Container ragflow-mysql Error 10.9s ✔ Container ragflow-server Created 0.0s dependency failed to start: container ragflow-mysql is unhealthy
my OS: [appuser@uatlxedillm1 ~]$ uname -a Linux uatlxedillm1.iris.cl.sh.cos 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Tue May 21 03:13:04 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux
mysql log:
2025-05-07T02:36:45.905292Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist 2025-05-07T02:36:45.905318Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition. 2025-05-07T02:36:45.905695Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 2025-05-07T02:36:45.905746Z 0 [ERROR] [MY-010952] [Server] The privilege system failed to initialize correctly. For complete instructions on how to upgrade MySQL to a new version please see the 'Upgrading MySQL' section from the MySQL manual. 2025-05-07T02:36:45.905838Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-05-07T02:36:47.446420Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.39) MySQL Community Server - GPL
Hello @liuxh613! I'm Dosu, a friendly bot here to help you solve bugs, answer questions, and guide you on your journey as a contributor. I'm here while you wait for a human maintainer. Let's tackle this issue together!
There are two similar closed issues related to the "ragflow-mysql" container being unhealthy:
-
One suggested solution is to wait for 1-2 minutes and try again. You can run
docker compose -f docker/docker-compose.yml startrepeatedly without stopping RAGFlow. Alternatively, you can first stop the service withdocker compose -f docker/docker-compose.yml stopand then start it again. If the issue persists, check the MySQL logs, as MySQL 8 may start slowly [1]. -
Another solution points to a migration problem where the MySQL container has issues due to pre-existing data [2].
In your case, the error messages indicate that the MySQL data directory might not be properly initialized, leading to missing tables such as 'mysql.component' and 'mysql.user'. To resolve this, you should:
- Delete the automatically created MySQL data directory by removing the
./volumes/mysql_datadirectory. - Restart the service with the same startup command.
This should allow MySQL to initialize the data directory correctly and create the necessary tables [3].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
i am try Modify Timeout in compose-base.yaml。also delete volumes. it doesn't work
@liuxh613
Thank you for your questions about our product!
According to your question, it is recommended that you pull new code and images for deployment.
I pulled the latest code from the main branch, but it still reports an error
@airfight Thanks for the feedback — and sorry for the delayed response! 🕐
To help troubleshoot your issue, here are a few things to double-check based on the logs you provided:
🐳 It looks like the MySQL service didn't start properly — the client session error might suggest a container conflict. When pulling the latest image, did you also remove old containers/images and associated volumes?
🧹 Please ensure your Docker environment for MySQL is clean — especially if you've set it up previously.
📄 Could you share more logs from the ragflow-server? This will help us dig deeper into the root cause.
Let us know if you're still stuck — we're happy to help! And feel free to keep sharing feedback and ideas with us. 💡
Thanks again! 🙌
@airfight I had a similar issue, mysql kept restarting. I wound up having to add ":z" to each volume-mounted file due to selinux blocking access to them.
i.e.
- ./init.sql:/data/application/init.sql:z
@airfight I had a similar issue, mysql kept restarting. I wound up having to add ":z" to each volume-mounted file due to selinux blocking access to them.
i.e.
- ./init.sql:/data/application/init.sql:z
thanks! - ./init.sql:/data/application/init.sql -> - ./init.sql:/data/application/init.sql:z it works, but i wonder why SELinux only blocking this file?
我尝试在 compose-base.yaml 中修改超时。同时删除卷。它不起作用
Hello, I'm encountering the same issue. May I ask if you've resolved it now?