From 9c4c60e2700ec00dcb9e4146a2bdefd942d8f2b1 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sat, 6 Jul 2024 23:56:56 +0800 Subject: [PATCH] Check NFS --- server/database.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/database.js b/server/database.js index 3374aff9..bfce64e2 100644 --- a/server/database.js +++ b/server/database.js @@ -223,6 +223,15 @@ class Database { fs.copyFileSync(Database.templatePath, Database.sqlitePath); } + // Check if Database.sqlitePath is on NFS + if (fs.existsSync(Database.sqlitePath)) { + let stats = fs.statSync(Database.sqlitePath); + log.debug("server", "SQLite database inode: " + stats.ino); + if (stats.ino === 0) { + log.error("server", "It seems that the database is on a network drive (NFS). Uptime Kuma will be UNSTABLE and the database will be CORRUPTED. Please use a local disk."); + } + } + const Dialect = require("knex/lib/dialects/sqlite3/index.js"); Dialect.prototype._driver = () => require("@louislam/sqlite3");