Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

GET does not check its arity and with no arguments returns the key from the previous command

Open Beginner friendly
#2,325 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
backend, databases

Research direction

Find the GET command handler and its existing argument-count checks; the issue does not name a file or test. Compare its validation with STRLEN, then run the relevant GET command tests. Done means GET with zero or multiple arguments returns the stated wrong-number-of-arguments error and does not read a key.

Written by the indexing model from the issue text.

Description

Describe the bug

GET accepts any number of arguments. Extra arguments are ignored. With no arguments, GET does not fail: it returns the value of the key named by the previous command on the same connection, so it seems to read stale parse state. Other commands check arity, for example STRLEN k extra returns ERR wrong number of arguments for 'STRLEN' command.

Steps to reproduce the bug

On one connection:

SET k value-k     => +OK
GET               => $7 value-k        (value of the key from the previous command)

SET other value-other   => +OK
GET other x             => $11 value-other   (extra argument ignored)
GET                     => $11 value-other

On a fresh connection, GET with no arguments returns a null reply.

Expected behavior

GET takes exactly one key. GET with no arguments and GET key extra both return ERR wrong number of arguments for 'get' command, and nothing is read.

Release version

v2.2.5 (ghcr.io/microsoft/garnet:2.2.5, default options). Also seen on v2.1.8.

IDE

Not applicable. Commands sent over a raw TCP connection.

OS version

Docker on Windows 11 (Linux container).

Additional context

Found while running the integration suite of Respire, a .NET Redis client, against Garnet. I could not find an existing issue or pull request for this. The no-argument case is the more serious part: a malformed command reads data chosen by an earlier command instead of failing.

Dominant language
C#
Stars
12.1k
Forks
716
Avg merge
2d 2h
Merged PRs (30d)
65

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/garnet

All issues in microsoft/garnet

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.