microsoft/garnet · error · Exception
LogDir specified without enabling tiered storage (UseStorage
Error message
LogDir specified without enabling tiered storage (UseStorage)
What it means
LogDir specifies the on-disk directory for tiered (hybrid-log) records. If LogDir is set but storage tiering is disabled, GetSettings treats it as a contradictory config and throws, because without tiering the store uses a NullDevice and the directory would never be used. The message references the legacy flag name UseStorage.
Source
Thrown at libs/server/Servers/GarnetServerOptions.cs:809
logger?.LogInformation("[Store] No Read cache log memory size limit will be enforced");
}
}
if (EnableStorageTier)
{
if (LogDir is null or "")
LogDir = Directory.GetCurrentDirectory();
logFactory = GetInitializedDeviceFactory(LogDir);
// These must match GetInitializedSegmentFileDevice.GetStoreHLogDevice
kvSettings.LogDevice = logFactory.Get(new FileDescriptor("Store", "hlog"));
if (!DisableObjects)
kvSettings.ObjectLogDevice = logFactory.Get(new FileDescriptor("Store", "hlog_objs"));
}
else
{
if (LogDir != null)
throw new Exception("LogDir specified without enabling tiered storage (UseStorage)");
kvSettings.LogDevice = new NullDevice();
logFactory = null;
}
if (CopyReadsToTail)
kvSettings.ReadCopyOptions = new(ReadCopyFrom.AllImmutable, ReadCopyTo.MainLog);
if (RevivInChainOnly)
{
logger?.LogInformation("[Store] Using Revivification in-chain only");
kvSettings.RevivificationSettings = RevivificationSettings.InChainOnly.Clone();
}
else if (UseRevivBinsPowerOf2)
{
logger?.LogInformation("[Store] Using Revivification with power-of-2 bins");
kvSettings.RevivificationSettings = RevivificationSettings.PowerOf2Bins.Clone();
kvSettings.RevivificationSettings.NumberOfBinsToSearch = RevivNumberOfBinsToSearch;
kvSettings.RevivificationSettings.RevivifiableFraction = RevivifiableFraction;View on GitHub (pinned to 951b0fc683)
Solutions
- Enable storage tiering so LogDir is honored: add --storage-tier.
- If you truly want an in-memory-only store (NullDevice), remove --logdir.
- Review the config so LogDir and --storage-tier are always paired.
Example fix
# before (fails) garnet-server --logdir /data/garnet # after garnet-server --storage-tier --logdir /data/garnet
Defensive patterns
Strategy: validation
Validate before calling
if (!options.EnableStorageTier && !string.IsNullOrEmpty(options.LogDir)) {
throw new InvalidOperationException("LogDir requires EnableStorageTier (--storage-tier)");
} Prevention
- Pair --logdir with --storage-tier, or omit both for an in-memory store.
- Validate that persistence flags imply tiering in config checks.
When it happens
Trigger: Starting with --logdir/-l set but --storage-tier not enabled. Thrown at GarnetServerOptions.cs:808-809 (the else-branch taken when EnableStorageTier is false).
Common situations: Setting a log directory intending to persist data while forgetting to enable the storage tier; stale config from a version where tiering was implied; misunderstanding that LogDir alone does not enable persistence.
Related errors
- MutablePercent must be between 10 and 95
- Store Log Memory size or PageCount must be specified
- Index size {IndexMemorySize} should not be less than index m
- Read cache requires storage tiering to be enabled
- Read Cache Log Memory size or PageCount must be specified
AI-assisted analysis of microsoft/garnet@951b0fc683 (2026-08-13).
Data as JSON: /api/errors/71e0ba860b02fb1a.
Report an issue: GitHub.