Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: run ensure_db_init before start server (#19423)

Lynnc5d9295cbb62
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index 2135fbf0f2..62cba47a80 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -278,6 +278,12 @@ run_with_restart() {
done
}
+# Initialize the database schema before any of the services below start.
+# This used to run inside the web server block only, so hosts that ran e.g.
+# just the admin server, data sync, MCP server, or task executors never
+# initialized the schema.
+ensure_db_init
+
if [[ "${INIT_MODEL_PROVIDER_TABLES}" -eq 1 ]]; then
DB_TYPE_NORMALIZED="${DB_TYPE:-mysql}"
DB_TYPE_NORMALIZED="${DB_TYPE_NORMALIZED,,}"
@@ -305,7 +311,6 @@ fi
if [[ "${ENABLE_WEBSERVER}" -eq 1 ]]; then
ensure_docling
- ensure_db_init
echo "Starting nginx..."
/usr/sbin/nginx -c /etc/nginx/nginx.conf