{"record":{"id":"5e734b099eda6963","repo":"microsoft/FASTER","slug":"logdir-specified-without-enabling-tiered-storage-usestorage","errorCode":null,"errorMessage":"LogDir specified without enabling tiered storage (UseStorage)","messagePattern":"LogDir specified without enabling tiered storage \\(UseStorage\\)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"cs/remote/src/FASTER.server/Servers/ServerOptions.cs","lineNumber":189,"sourceCode":"\n            logger?.LogInformation($\"[Store] There are {PrettySize(1 << (logSettings.MemorySizeBits - logSettings.PageSizeBits))} log pages in memory\");\n\n            logSettings.SegmentSizeBits = SegmentSizeBits();\n            logger?.LogInformation($\"[Store] Using disk segment size of {PrettySize((long)Math.Pow(2, logSettings.SegmentSizeBits))}\");\n\n            indexSize = IndexSizeCachelines();\n            logger?.LogInformation($\"[Store] Using hash index size of {PrettySize(indexSize * 64L)} ({PrettySize(indexSize)} cache lines)\");\n\n            if (EnableStorageTier)\n            {\n                if (LogDir is null or \"\")\n                    LogDir = Directory.GetCurrentDirectory();\n                logSettings.LogDevice = Devices.CreateLogDevice(LogDir + \"/Store/hlog\");\n            }\n            else\n            {\n                if (LogDir != null)\n                    throw new Exception(\"LogDir specified without enabling tiered storage (UseStorage)\");\n                logSettings.LogDevice = new NullDevice();\n            }\n\n            if (CheckpointDir == null) CheckpointDir = LogDir;\n\n            if (CheckpointDir is null or \"\")\n                CheckpointDir = Directory.GetCurrentDirectory();\n\n            checkpointSettings = new CheckpointSettings\n            {\n                CheckpointDir = CheckpointDir + \"/Store/checkpoints\",\n                RemoveOutdated = true,\n            };\n        }\n\n        /// <summary>\n        /// Parse size from string specification\n        /// </summary>","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cs/remote/src/FASTER.server/Servers/ServerOptions.cs#L171-L207","documentation":"In ServerOptions.GetSettings, LogDir is only honored when tiered storage is enabled via UseStorage. If UseStorage is false the store uses a NullDevice (in-memory), and a leftover LogDir setting is contradictory — data would never be written there — so FASTER throws to surface the conflicting configuration.","triggerScenarios":"Setting ServerOptions.LogDir (or leaving it set from config/defaults) while UseStorage is false/unset, then calling GetSettings (invoked by GenericServer/VarlenServer construction).","commonSituations":"Using ServerSettings/ServerOptions in in-memory mode but a template config still carries LogDir; removing UseStorage=true to test in-memory mode and forgetting LogDir; environment-driven configs where LogDir is always populated.","solutions":["Set UseStorage = true if you want on-disk (tiered) storage, keeping LogDir.","Otherwise set LogDir = null when UseStorage is false.","Scrub LogDir from config files/env used for in-memory deployments."],"exampleFix":"// before\noptions.UseStorage = false;\noptions.LogDir = \"/data/logs\"; // throws\n// after\noptions.UseStorage = false;\noptions.LogDir = null;","handlingStrategy":"validation","validationCode":"if (!options.UseStorage && options.LogDir != null) options.LogDir = null; // scrub LogDir for in-memory mode","typeGuard":null,"tryCatchPattern":"try { settings = options.GetSettings(); } catch (Exception) { options.UseStorage = true; settings = options.GetSettings(); }","preventionTips":["Treat UseStorage and LogDir as a coupled pair; set them together in one place.","Strip storage paths from configs used for in-memory deployments."],"tags":["csharp","faster","server-options","config","conflicting-options"],"backgroundTag":"conflicting-config-options","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}