{"record":{"id":"370b75b6aa6c44cb","repo":"ruvnet/ruflo","slug":"config-manager-is-disabled","errorCode":null,"errorMessage":"Config manager is disabled","messagePattern":"Config manager is disabled","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ruflo/src/ruvocal/src/lib/server/config.ts","lineNumber":101,"sourceCode":"\t}\n\n\tasync updateSemaphore() {\n\t\tawait this.semaphoreCollection?.updateOne(\n\t\t\t{ key: Semaphores.CONFIG_UPDATE },\n\t\t\t{\n\t\t\t\t$set: {\n\t\t\t\t\tupdatedAt: new Date(),\n\t\t\t\t},\n\t\t\t\t$setOnInsert: {\n\t\t\t\t\tcreatedAt: new Date(),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{ upsert: true }\n\t\t);\n\t}\n\n\tasync set(key: ConfigKey, value: string) {\n\t\tif (!this.ConfigManagerEnabled) throw new Error(\"Config manager is disabled\");\n\t\tawait this.configCollection?.updateOne({ key }, { $set: { value } }, { upsert: true });\n\t\tthis.keysFromDB[key] = value;\n\t\tawait this.updateSemaphore();\n\t}\n\n\tasync delete(key: ConfigKey) {\n\t\tif (!this.ConfigManagerEnabled) throw new Error(\"Config manager is disabled\");\n\t\tawait this.configCollection?.deleteOne({ key });\n\t\tdelete this.keysFromDB[key];\n\t\tawait this.updateSemaphore();\n\t}\n\n\tasync clear() {\n\t\tif (!this.ConfigManagerEnabled) throw new Error(\"Config manager is disabled\");\n\t\tawait this.configCollection?.deleteMany({});\n\t\tthis.keysFromDB = {};\n\t\tawait this.updateSemaphore();\n\t}","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/ruflo/src/ruvocal/src/lib/server/config.ts#L83-L119","documentation":"ConfigManager.set() persists runtime config overrides to the DB-backed config collection. It refuses to write unless the config-manager feature is enabled: the ConfigManagerEnabled getter (config.ts:40) requires server env ENABLE_CONFIG_MANAGER === \"true\" exactly, and the app not running in test mode. The guard exists because self-hosted deployments treat config as read-only env vars; DB-backed overrides are opt-in.","triggerScenarios":"Awaiting config.set(key, value) from server code (admin/settings routes) when ENABLE_CONFIG_MANAGER is unset, empty, or not the exact lowercase string \"true\", or when MODE is \"test\". Reads via config.get() still work (they fall back to env), only writes throw.","commonSituations":"Self-hosted chat-ui/ruvocal deploy without ENABLE_CONFIG_MANAGER=true trying to use runtime config writes; .env.local missing the flag; setting \"True\"/\"1\"/\"yes\" instead of \"true\"; admin UI calling set() on a deployment where DB config was never enabled.","solutions":["Set ENABLE_CONFIG_MANAGER=true in the server env (.env) and restart the app","Check for exact lowercase spelling and no quotes/whitespace in the value","If writes must stay disabled, use config.get() only and remove code paths that call set/delete/clear","Ensure MONGODB_URL is set and collections initialized, since set() writes to collections.config"],"exampleFix":"// before\nawait config.set(\"PUBLIC_APP_NAME\", \"My Chat\"); // throws: Config manager is disabled\n\n// after\nif (config.ConfigManagerEnabled) {\n\tawait config.set(\"PUBLIC_APP_NAME\", \"My Chat\");\n} else {\n\t// env-only deployment: change the variable in .env and restart instead\n\tthrow new Error(\"Set ENABLE_CONFIG_MANAGER=true to allow runtime config writes\");\n}","handlingStrategy":"validation","validationCode":"import { config } from \"$lib/server/config\";\n\nif (config.ConfigManagerEnabled) {\n\tawait config.set(key, value);\n} else {\n\t// read-only deployment: persist elsewhere or reject the operation\n\tthrow error(403, \"Runtime config writes are disabled (ENABLE_CONFIG_MANAGER!=true)\");\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Gate every config write path on config.ConfigManagerEnabled at the route level","Document in deployment README that ENABLE_CONFIG_MANAGER=true (exact string) is required for admin writes","Add a startup warning when ENABLE_CONFIG_MANAGER is set to a non-\"true\" value (catches \"True\"/\"1\" typos)"],"tags":["config","feature-flag","env-var","server"],"backgroundTag":"feature-flag-disabled","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}