{"record":{"id":"c923331a4f88739e","repo":"sqlmapproject/sqlmap","slug":"option-crawl-exclude-requires-usage-of-switch","errorCode":null,"errorMessage":"option '--crawl-exclude' requires usage of switch '--crawl'","messagePattern":"option '--crawl-exclude' requires usage of switch '--crawl'","errorType":"exception","errorClass":"SqlmapSyntaxException","httpStatus":null,"severity":"error","filePath":"lib/core/option.py","lineNumber":2976,"sourceCode":"        except Exception as ex:\n            errMsg = \"invalid regular expression '%s' ('%s')\" % (conf.scope, getSafeExString(ex))\n            raise SqlmapSyntaxException(errMsg)\n\n    if conf.dumpTable and conf.dumpAll:\n        errMsg = \"switch '--dump' is incompatible with switch '--dump-all'\"\n        raise SqlmapSyntaxException(errMsg)\n\n    if conf.threads > MAX_NUMBER_OF_THREADS and not conf.get(\"skipThreadCheck\"):\n        errMsg = \"maximum number of used threads is %d avoiding potential connection issues\" % MAX_NUMBER_OF_THREADS\n        raise SqlmapSyntaxException(errMsg)\n\n    if conf.forms and not any((conf.url, conf.googleDork, conf.bulkFile)):\n        errMsg = \"switch '--forms' requires usage of option '-u' ('--url'), '-g' or '-m'\"\n        raise SqlmapSyntaxException(errMsg)\n\n    if conf.crawlExclude and not conf.crawlDepth:\n        errMsg = \"option '--crawl-exclude' requires usage of switch '--crawl'\"\n        raise SqlmapSyntaxException(errMsg)\n\n    if conf.safePost and not conf.safeUrl:\n        errMsg = \"option '--safe-post' requires usage of option '--safe-url'\"\n        raise SqlmapSyntaxException(errMsg)\n\n    if conf.safeFreq and not any((conf.safeUrl, conf.safeReqFile)):\n        errMsg = \"option '--safe-freq' requires usage of option '--safe-url' or '--safe-req'\"\n        raise SqlmapSyntaxException(errMsg)\n\n    if conf.safeReqFile and any((conf.safeUrl, conf.safePost)):\n        errMsg = \"option '--safe-req' is incompatible with option '--safe-url' and option '--safe-post'\"\n        raise SqlmapSyntaxException(errMsg)\n\n    if conf.csrfUrl and not conf.csrfToken:\n        errMsg = \"option '--csrf-url' requires usage of option '--csrf-token'\"\n        raise SqlmapSyntaxException(errMsg)\n\n    if conf.csrfMethod and not conf.csrfToken:","sourceCodeStart":2958,"sourceCodeEnd":2994,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/core/option.py#L2958-L2994","documentation":"Startup option-dependency guard in _basicOptionValidation: --crawl-exclude is a regex filter for URLs found during crawling, so it only makes sense with crawling enabled. Fires when conf.crawlExclude is set but conf.crawlDepth (--crawl) is not.","triggerScenarios":"Thrown at lib/core/option.py:2976 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable crawling with --crawl=N alongside --crawl-exclude","Remove --crawl-exclude if crawling is not used"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}