MagicMirrorOrg/MagicMirror · warning
WARNING! Your custom css file is currently located in the cs
Error message
WARNING! Your custom css file is currently located in the css folder. Please move it to the config folder!
What it means
During MagicMirror startup, App checks for the deprecated css/custom.css location and tries to auto-migrate it to the config folder (config/custom.css). If fs.renameSync fails — typically a permissions problem or the file being open/locked — the app cannot move it and logs this warning telling the user to move it manually.
Source
Thrown at js/app.js:207
global.config = configObj.fullConf;
// Keep a copy of the redacted config to later verify module secret permissions
global.configRedacted = configObj.redactedConf;
const config = global.config;
Utils.checkConfigFile(configObj);
global.defaultModulesDir = config.defaultModulesDir;
defaultModules = require(`${global.root_path}/${global.defaultModulesDir}/defaultmodules`);
Log.setLogLevel(config.logLevel);
env = getEnvVarsAsObj();
// check for deprecated css/custom.css and move it to new location
if ((!fs.existsSync(`${global.root_path}/${env.customCss}`)) && (fs.existsSync(`${global.root_path}/css/custom.css`))) {
try {
fs.renameSync(`${global.root_path}/css/custom.css`, `${global.root_path}/${env.customCss}`);
Log.warn(`WARNING! Your custom css file was moved from ${global.root_path}/css/custom.css to ${global.root_path}/${env.customCss}`);
} catch {
Log.warn("WARNING! Your custom css file is currently located in the css folder. Please move it to the config folder!");
}
}
// get the used module positions
Utils.getModulePositions();
let modules = [];
for (const module of config.modules) {
if (module.disabled) continue;
if (module.module) {
if (Utils.moduleHasValidPosition(module.position) || typeof (module.position) === "undefined") {
// Only add this module to be loaded if it is not a duplicate (repeated instance of the same module)
if (!modules.includes(module.module)) {
modules.push(module.module);
}
} else {
Log.warn("Invalid module position found for this configuration:" + `\n${JSON.stringify(module, null, 2)}`);
}View on GitHub (pinned to 4b4a59534f)
Solutions
- Manually move the file: mv css/custom.css config/custom.css
- Fix permissions on the css/ and config/ directories (chown to the user running MagicMirror, chmod u+w).
- If you intentionally keep it in css/, set customCss in config.js (env CUSTOMCSS) to point at css/custom.css so the check passes.
- Re-run MagicMirror as the correct non-root user instead of sudo so future migrations succeed.
Example fix
// before (shell) css/custom.css owned by root, server runs as 'pi' // after (shell) sudo chown pi:pi css/custom.css && mv css/custom.css config/custom.css
Defensive patterns
Strategy: fallback
Validate before calling
const fs = require("fs");
if (fs.existsSync("css/custom.css")) {
try { fs.accessSync("css/custom.css", fs.constants.W_OK); fs.accessSync("config/", fs.constants.W_OK); }
catch { console.warn("Move css/custom.css to config/custom.css manually (permissions issue)"); }
} Type guard
function canMigrate(src, destDir) {
try { fs.accessSync(src, fs.constants.W_OK); fs.accessSync(destDir, fs.constants.W_OK); return true; }
catch { return false; }
} Try / catch
try {
fs.renameSync("css/custom.css", "config/custom.css");
} catch (err) {
Log.warn("Auto-migration failed (" + err.code + "); move css/custom.css manually");
} Prevention
- After upgrading, proactively check whether css/custom.css exists and move it yourself.
- Run MagicMirror as a user with write access to the css/ and config/ directories.
- Avoid sudo-running the server, which leaves root-owned files behind.
When it happens
Trigger: config.customCss points to config/custom.css (default), css/custom.css exists, and the fs.renameSync migration throws (e.g. EACCES on the css/ or config/ directory, read-only filesystem, or the file is locked by another process).
Common situations: Users upgrading MagicMirror from versions where custom.css lived in css/; Docker/container or hosted installs where the user running the server lacks write permission to css/ or config/; the old file owned by root after a sudo install.
Related errors
- WARNING! Your custom css file was moved from ${global.root_p
- [calendar] Your are using the deprecated config values 'colo
- [calendar] Your are using the deprecated config values 'colo
- [calendar] Deprecation warning: Please update your calendar
- https://docs.magicmirror.builders/modules/calendar.html#conf
AI-assisted analysis of MagicMirrorOrg/MagicMirror@4b4a59534f (2026-08-31).
Data as JSON: /api/errors/d2ae801146ea0065.
Report an issue: GitHub.