microsoft/garnet · error · GarnetException
RI.DEL: invalid arguments.
Error message
RI.DEL: invalid arguments.
What it means
RI.DEL (RangeIndex DEL) throws when BfTreeService.DeleteByPtr returns any result other than Success. Unlike SET/GET which distinguish InvalidArguments from other results, DEL treats all non-success results as invalid arguments. This indicates the field span was structurally invalid or the tree handle was corrupted.
Source
Thrown at libs/server/Storage/Session/MainStore/RangeIndexOps.cs:438
{
if (status != GarnetStatus.OK)
{
result = RangeIndexResult.Error;
return status == GarnetStatus.WRONGTYPE ? GarnetStatus.WRONGTYPE : GarnetStatus.OK;
}
var treePtr = ExtractTreePtr(stubSpan);
if (treePtr == 0)
{
result = RangeIndexResult.Error;
return GarnetStatus.OK;
}
var deleteResult = BfTreeService.DeleteByPtr(treePtr, field);
if (deleteResult != BfTreeDeleteResult.Success)
{
logger?.LogError("RI.DEL: invalid arguments for a {fieldLen}-byte field.", field.Length);
throw new GarnetException("RI.DEL: invalid arguments.");
}
result = RangeIndexResult.OK;
functionsState.rangeIndexManager.ReplicateRangeIndexDel(
key, field, functionsState.appendOnlyFile,
stringBasicContext.Session.Version, stringBasicContext.Session.ID,
functionsState.StoredProcMode);
return GarnetStatus.OK;
}
}
/// <summary>
/// RI.SCAN — scan entries starting at a key with a count limit.
/// Acquires shared lock, reads stub, writes complete RESP array response into output while lock is held.
/// </summary>
/// <param name="key">The Garnet key of the RangeIndex.</param>View on GitHub (pinned to 951b0fc683)
Solutions
- Ensure the field argument to RI.DEL is non-empty.
- If the error persists with valid input, recreate the range index.
- Check server logs for the logged field length to confirm the input.
Example fix
// before RI.DEL myindex "" // after RI.DEL myindex "field1"
Defensive patterns
Strategy: validation
Validate before calling
if (field == null || field.Length == 0)
throw new ArgumentException("RI.DEL field must be non-empty."); Prevention
- Validate field is non-empty before calling RI.DEL.
- Ensure the range index tree handle is valid before deletion.
- Log field length in error context for diagnosis.
When it happens
Trigger: Calling the RI.DEL operation when BfTreeService.DeleteByPtr returns anything other than BfTreeDeleteResult.Success. Occurs with an empty/null field span or a corrupted tree pointer.
Common situations: Client sending RI.DEL with an empty field; argument parsing bug; corrupted range index state after unclean shutdown.
Related errors
- RI.SET: invalid arguments.
- RI.GET: invalid arguments.
- ERR bit offset is not an integer or out of range
- Object store is disabled
- invalid failover status
AI-assisted analysis of microsoft/garnet@951b0fc683 (2026-08-13).
Data as JSON: /api/errors/e4ad127a7ef13f7d.
Report an issue: GitHub.