You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ERR wrong number of arguments for 'setnx' command #2751
When calling IDatabase.StringSet with when=When.NotExists and keepTtl=true, you are calling the "SETNX" command and also passing the KEEPTTL option, which is not supported. This should be updated to use the "SET" command with the "NX" and "KEEPTTL" options instead.
Example call:
IDatabase db = ...;
bool result = db.StringSet("key", "value", null, true, When.NotExists);
Fixed in StackExchange.Redis 2.10.1 (#2977): StringSet with When.NotExists + keepTtl:true no longer emits an invalid SETNX … KEEPTTL; it issues a plain SETNX (equivalent — a non-existent key has no TTL). Closing as completed.
Activity
mgravell commentedon Jul 22, 2026
Fixed in StackExchange.Redis 2.10.1 (#2977):
StringSetwithWhen.NotExists+keepTtl:trueno longer emits an invalidSETNX … KEEPTTL; it issues a plainSETNX(equivalent — a non-existent key has no TTL). Closing as completed.