sqlmapproject/sqlmap · error · SqlmapValueException
invalid choice
Error message
invalid choice
What it means
_selectInjection prompts the user to pick which of multiple detected injection points to use; the entered choice was neither a valid index into kb.injections nor 'Q' to quit, so this SqlmapValueException is raised. It is a guard around interactive menu input, not a target-side failure.
Solutions
- Re-run and enter a listed numeric choice or 'Q' to quit.
- Use -- answers or the batch mode to avoid interactive selection entirely.
- Pick the default (0) to use the first injection point.
- If indices appear wrong, re-run detection so kb.injections is rebuilt consistently.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/controller/controller.py:145 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26).
Data as JSON: /api/errors/dfce3f1030761484.
Report an issue: GitHub.
Appendix: source
Thrown at lib/controller/controller.py:145
message += "[%d] place: %s, parameter: " % (i, place)
message += "%s, type: %s" % (parameter, ptype)
if i == 0:
message += " (default)"
message += "\n"
message += "[q] Quit"
choice = readInput(message, default='0').upper()
if isDigit(choice) and int(choice) < len(kb.injections) and int(choice) >= 0:
index = int(choice)
elif choice == 'Q':
raise SqlmapUserQuitException
else:
errMsg = "invalid choice"
raise SqlmapValueException(errMsg)
kb.injection = kb.injections[index]
def _formatInjection(inj):
paramType = conf.method if conf.method not in (None, HTTPMETHOD.GET, HTTPMETHOD.POST) else inj.place
data = "Parameter: %s (%s)\n" % (inj.parameter, paramType)
for stype, sdata in inj.data.items():
title = sdata.title
vector = sdata.vector
comment = sdata.comment
payload = agent.adjustLateValues(sdata.payload)
if inj.place == PLACE.CUSTOM_HEADER:
payload = payload.split(',', 1)[1]
if stype == PAYLOAD.TECHNIQUE.UNION:
count = re.sub(r"(?i)(\(.+\))|(\blimit[^a-z]+)", "", sdata.payload).count(',') + 1
title = re.sub(r"\d+ to \d+", str(count), title)
vector = agent.forgeUnionQuery("[QUERY]", vector[0], vector[1], vector[2], None, None, vector[5], vector[6])View on GitHub (pinned to 0a35b20e39)