sqlmapproject/sqlmap · error · SqlmapGenericException
error occurred while opening log file
Error message
error occurred while opening log file ('%s') What it means
Opening the run's log file under the output directory raised an IOError, typically because of permissions, a read-only/full filesystem, or an invalid output path; logging cannot be initialized, so the run is aborted. Note the nearby flush() deliberately swallows IOErrors - only the initial open is fatal.
Solutions
- Verify the output directory exists and is writable by the current user
- Free disk space or choose another location via --output
- Disable file logging with --output-dir controls / logging options if not needed
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at lib/core/dump.py:134 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26).
Data as JSON: /api/errors/6223257f162a3bc0.
Report an issue: GitHub.
Appendix: source
Thrown at lib/core/dump.py:134
def flush(self):
if self._outputFP:
try:
self._outputFP.flush()
except IOError:
pass
def setOutputFile(self):
if conf.noLogging:
self._outputFP = None
return
self._outputFile = os.path.join(conf.outputPath, "log")
try:
self._outputFP = openFile(self._outputFile, 'a' if not conf.flushSession else 'w')
except IOError as ex:
errMsg = "error occurred while opening log file ('%s')" % getSafeExString(ex)
raise SqlmapGenericException(errMsg)
def singleString(self, data, content_type=None):
self._reportData(data, content_type)
self._write(data, content_type=content_type)
def string(self, header, data, content_type=None, sort=True):
self._reportData(data, content_type)
if conf.api:
self._write(data, content_type=content_type)
if isListLike(data) and len(data) == 1:
data = unArrayizeValue(data)
if isListLike(data):
self.lister(header, data, content_type, sort)
elif data is not None:
_ = getUnicode(data)View on GitHub (pinned to 0a35b20e39)