louislam/uptime-kuma · critical · Error

Embedded Mariadb supports only 'node' or 'root' user, but th

Error message

Embedded Mariadb supports only 'node' or 'root' user, but the current user is: ${this.username}

What it means

EmbeddedMariaDB.start() reads os.userInfo().username and only allows 'node' or 'root'. The embedded mariadbd child is spawned with --user=node and writes under /app/data, so any other OS user would either fail the daemon's privilege drop or produce files with the wrong owner. The class doc comment says explicitly 'It is only used inside the docker container', and the official image runs as the node user.

Source

Thrown at server/embedded-mariadb.js:61

    }

    /**
     * @returns {boolean} If the singleton instance is created
     */
    static hasInstance() {
        return !!EmbeddedMariaDB.instance;
    }

    /**
     * Start the embedded MariaDB
     * @throws {Error} If the current user is not "node" or "root"
     * @returns {Promise<void>|void} A promise that resolves when the MariaDB is started or void if it is already started
     */
    start() {
        // Check if the current user is "node" or "root"
        this.username = require("os").userInfo().username;
        if (this.username !== "node" && this.username !== "root") {
            throw new Error(
                "Embedded Mariadb supports only 'node' or 'root' user, but the current user is: " + this.username
            );
        }

        this.initDB();

        this.startChildProcess();

        return new Promise((resolve) => {
            let interval = setInterval(() => {
                if (this.started) {
                    clearInterval(interval);
                    resolve();
                } else {
                    log.info("mariadb", "Waiting for Embedded MariaDB to start...");
                }
            }, 1000);
        });

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Use the official Docker image, which runs as the node user — embedded-mariadb works there out of the box.
  2. If you must run another way, either run the process as root (not recommended) or rename your runtime user to 'node' so the check passes.
  3. For bare-metal/non-Docker, prefer external MariaDB (type 'mariadb') or SQLite instead of 'embedded-mariadb' — the embedded build is intentionally container-only.
  4. If building a custom image, ensure `USER node` (or root) is set before the entrypoint.

Example fix

# before — custom Dockerfile that overrides the user
USER mykuma

# after — keep the user the embedded mariadbd expects
USER node
Defensive patterns

Strategy: validation

Validate before calling

// Detect the unsupported-user condition before EmbeddedMariaDB.start()
const os = require("os");
function assertEmbeddedMariadbUser() {
    const u = os.userInfo().username;
    if (u !== "node" && u !== "root") {
        throw new Error(`embedded-mariadb requires user 'node' or 'root', running as '${u}'`);
    }
}

Type guard

function canRunEmbeddedMariaDB() {
    const u = require("os").userInfo().username;
    return u === "node" || u === "root";
}

Try / catch

try {
    await embeddedMariaDB.start();
} catch (e) {
    if (/supports only 'node' or 'root' user/.test(e.message)) {
        // switch to sqlite or external mariadb, or run inside the official image
    }
    throw e;
}

Prevention

When it happens

Trigger: Running Uptime Kuma outside the official Docker image (e.g. as your own user on bare metal, under systemd as 'kuma', inside a modified container that switched USER) and selecting db-config type 'embedded-mariadb'. The check fires before any mariadbd subprocess is spawned.

Common situations: Custom Docker images that override USER; Podman/rootless deployments where the mapped user is neither node nor root; dev environments running `npm run start:dev` as the developer's account with a hand-edited db-config.json.

Related errors


AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12). Data as JSON: /api/errors/475905fcb631214e. Report an issue: GitHub.