sqlmapproject/sqlmap · error · SqlmapGenericException
an error occurred while evaluating provided code
Error message
an error occurred while evaluating provided code ('%s') What it means
Guard inside evaluateCode(): exec() of the user-supplied --eval Python snippet raised an exception (syntax error, NameError, runtime error); every exception except KeyboardInterrupt is converted into this error with the cause string.
Solutions
- Fix the Python snippet passed to --eval so it compiles and runs against the parameter dict
- Test the expression locally (python -c) before passing it to --eval
- Simplify the code to reference only the request parameters actually present
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at lib/core/common.py:5136 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/8618cb5feb2a28f3.
Report an issue: GitHub.
Appendix: source
Thrown at lib/core/common.py:5136
_reload_module(sys)
sys.setdefaultencoding("cp1256")
def evaluateCode(code, variables=None):
"""
Executes given python code given in a string form
>>> _ = {}; evaluateCode("a = 1; b = 2; c = a", _); _["c"]
1
"""
try:
exec(code, variables)
except KeyboardInterrupt:
raise
except Exception as ex:
errMsg = "an error occurred while evaluating provided code ('%s') " % getSafeExString(ex)
raise SqlmapGenericException(errMsg)
def serializeObject(object_):
"""
Serializes given object
>>> type(serializeObject([1, 2, 3, ('a', 'b')])) == str
True
"""
return serializeValue(object_)
def unserializeObject(value):
"""
Unserializes object from given serialized form
>>> unserializeObject(serializeObject([1, 2, 3])) == [1, 2, 3]
True
>>> unserializeObject(serializeObject('foobar')) == 'foobar'View on GitHub (pinned to 0a35b20e39)