{"record":{"id":"09747837e6185da2","repo":"sqlmapproject/sqlmap","slug":"function-preprocess-req-in-preprocess-script","errorCode":null,"errorMessage":"function 'preprocess(req)' in preprocess script '%s' had issues in a test run ('%s'). You can find a template script at '%s'","messagePattern":"function 'preprocess\\(req\\)' in preprocess script '(.+?)' had issues in a test run \\('(.+?)'\\)\\. You can find a template script at '(.+?)'","errorType":"exception","errorClass":"SqlmapGenericException","httpStatus":null,"severity":"error","filePath":"lib/core/option.py","lineNumber":1052,"sourceCode":"                try:\n                    function(_urllib.request.Request(\"http://localhost\"))\n                except Exception as ex:\n                    tbMsg = traceback.format_exc()\n\n                    if conf.debug:\n                        dataToStdout(tbMsg)\n\n                    handle, filename = tempfile.mkstemp(prefix=MKSTEMP_PREFIX.PREPROCESS, suffix=\".py\")\n                    os.close(handle)\n\n                    openFile(filename, \"w+\").write(\"#!/usr/bin/env\\n\\ndef preprocess(req):\\n    pass\\n\")\n                    openFile(os.path.join(os.path.dirname(filename), \"__init__.py\"), \"w+\").write(\"pass\")\n\n                    errMsg = \"function 'preprocess(req)' \"\n                    errMsg += \"in preprocess script '%s' \" % script\n                    errMsg += \"had issues in a test run ('%s'). \" % getSafeExString(ex)\n                    errMsg += \"You can find a template script at '%s'\" % filename\n                    raise SqlmapGenericException(errMsg)\n\ndef _setPostprocessFunctions():\n    \"\"\"\n    Loads postprocess function(s) from given script(s)\n    \"\"\"\n\n    if conf.postprocess:\n        for script in re.split(PARAMETER_SPLITTING_REGEX, conf.postprocess):\n            found = False\n            function = None\n\n            script = safeFilepathEncode(script.strip())\n\n            try:\n                if not script:\n                    continue\n\n                if not os.path.exists(script):","sourceCodeStart":1034,"sourceCodeEnd":1070,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/core/option.py#L1034-L1070","documentation":"Error \"function 'preprocess(req)' in preprocess script '%s' had issues in a test run ('%s'). You can find a template script at '%s'\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/core/option.py:1052 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}