{"record":{"id":"ad5878e71a21fc7c","repo":"sqlmapproject/sqlmap","slug":"missing-function-preprocess-req-in-preprocess-s","errorCode":null,"errorMessage":"missing function 'preprocess(req)' in preprocess script '%s'","messagePattern":"missing function 'preprocess\\(req\\)' in preprocess script '(.+?)'","errorType":"exception","errorClass":"SqlmapGenericException","httpStatus":null,"severity":"error","filePath":"lib/core/option.py","lineNumber":1032,"sourceCode":"            except Exception as ex:\n                raise SqlmapSyntaxException(\"cannot import preprocess module '%s' (%s)\" % (getUnicode(filename[:-3]), getSafeExString(ex)))\n\n            for name, function in inspect.getmembers(module, inspect.isfunction):\n                try:\n                    if name == \"preprocess\" and inspect.getargspec(function).args and all(_ in inspect.getargspec(function).args for _ in (\"req\",)):\n                        found = True\n\n                        kb.preprocessFunctions.append(function)\n                        function.__name__ = module.__name__\n\n                        break\n                except ValueError:  # Note: https://github.com/sqlmapproject/sqlmap/issues/4357\n                    pass\n\n            if not found:\n                errMsg = \"missing function 'preprocess(req)' \"\n                errMsg += \"in preprocess script '%s'\" % script\n                raise SqlmapGenericException(errMsg)\n            else:\n                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)","sourceCodeStart":1014,"sourceCodeEnd":1050,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/core/option.py#L1014-L1050","documentation":"Error \"missing function 'preprocess(req)' in preprocess script '%s'\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/core/option.py:1032 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"}