{"record":{"id":"bf7ceab50c739aac","repo":"sqlmapproject/sqlmap","slug":"error-occurred-while-running-preprocess-function","errorCode":null,"errorMessage":"error occurred while running preprocess function '%s' ('%s')","messagePattern":"error occurred while running preprocess function '(.+?)' \\('(.+?)'\\)","errorType":"exception","errorClass":"SqlmapGenericException","httpStatus":null,"severity":"error","filePath":"lib/request/connect.py","lineNumber":682,"sourceCode":"                    else:\n                        post = urldecode(post, convall=True)\n                        post = encodeBase64(post, safe=conf.base64Safe)\n\n                if target and cmdLineOptions.method or method and method not in (HTTPMETHOD.GET, HTTPMETHOD.POST):\n                    req = MethodRequest(url, post, headers)\n                    req.set_method(cmdLineOptions.method or method)\n                elif url is not None:\n                    req = _urllib.request.Request(url, post, headers)\n                else:\n                    return None, None, None\n\n                for function in kb.preprocessFunctions:\n                    try:\n                        function(req)\n                    except Exception as ex:\n                        errMsg = \"error occurred while running preprocess \"\n                        errMsg += \"function '%s' ('%s')\" % (function.__name__, getSafeExString(ex))\n                        raise SqlmapGenericException(errMsg)\n                    else:\n                        post, headers = req.data, req.headers\n\n                requestHeaders += \"\\r\\n\".join([\"%s: %s\" % (u\"-\".join(_.capitalize() for _ in getUnicode(key).split(u'-')) if hasattr(key, \"capitalize\") else getUnicode(key), getUnicode(value)) for (key, value) in req.header_items()])\n\n                if not getRequestHeader(req, HTTP_HEADER.COOKIE) and conf.cj:\n                    conf.cj._policy._now = conf.cj._now = int(time.time())\n                    with conf.cj._cookies_lock:\n                        cookies = conf.cj._cookies_for_request(req)\n                    requestHeaders += \"\\r\\n%s\" % (\"Cookie: %s\" % \";\".join(\"%s=%s\" % (getUnicode(cookie.name), getUnicode(cookie.value)) for cookie in cookies))\n\n                if post is not None:\n                    if not getRequestHeader(req, HTTP_HEADER.CONTENT_LENGTH) and not chunked:\n                        requestHeaders += \"\\r\\n%s: %d\" % (string.capwords(HTTP_HEADER.CONTENT_LENGTH), len(post))\n\n                if not getRequestHeader(req, HTTP_HEADER.CONNECTION):\n                    requestHeaders += \"\\r\\n%s: %s\" % (HTTP_HEADER.CONNECTION, \"close\" if not conf.keepAlive else \"keep-alive\")\n","sourceCodeStart":664,"sourceCodeEnd":700,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/request/connect.py#L664-L700","documentation":"Error \"error occurred while running preprocess function '%s' ('%s')\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/request/connect.py:682 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"}