{"record":{"id":"b53f384d31f5ec04","repo":"sqlmapproject/sqlmap","slug":"scan-requires-either-url-or-requestfile","errorCode":null,"errorMessage":"scan() requires either 'url' or 'requestFile'","messagePattern":"scan\\(\\) requires either 'url' or 'requestFile'","errorType":"validation","errorClass":"SqlmapError","httpStatus":null,"severity":"error","filePath":"lib/utils/library.py","lineNumber":92,"sourceCode":"    output directory (so parallel scans of the same target can not collide on session/dump files and\n    nothing accumulates on disk), engine output streamed to a temporary file rather than buffered in\n    memory, and - when 'timeout' is set - the whole subprocess group is torn down on expiry. Pass\n    'outputDir' to keep the run's files.\n\n    Example:\n        import sqlmap\n        result = sqlmap.scan(\"http://target/vuln.php?id=1\", dumpTable=True, tbl=\"users\")\n    \"\"\"\n\n    import shutil\n    import subprocess\n    import time\n\n    from lib.core.common import saveConfig\n    from lib.core.optiondict import optDict\n\n    if not (url or requestFile):\n        raise SqlmapError(\"scan() requires either 'url' or 'requestFile'\")\n\n    if not os.path.isfile(SQLMAP_FILE):\n        raise SqlmapError(\"could not locate the sqlmap engine ('%s')\" % SQLMAP_FILE)\n\n    knownOptions = set()\n    for family in optDict.values():\n        knownOptions.update(family)\n\n    config = {}\n    if url:\n        config[\"url\"] = url\n    if requestFile:\n        config[\"requestFile\"] = requestFile\n    config.update(options)\n\n    unknown = [_ for _ in config if _ not in knownOptions]\n    if unknown:\n        raise SqlmapError(\"unknown option(s) %s - scan() expects sqlmap option names as used in a configuration file (e.g. getBanner, dumpTable, tbl, technique, level), not command line switches\" % \", \".join(repr(_) for _ in sorted(unknown)))","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/utils/library.py#L74-L110","documentation":"Error \"scan() requires either 'url' or 'requestFile'\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/utils/library.py:92 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"}