sqlmapproject/sqlmap · error · SqlmapSystemException

unable to write to the results file

Error message

unable to write to the results file '%s' ('%s'). 

What it means

Raised inside _saveToResultsFile when the CSV file named by --output / conf.resultsF cannot be written; the write to conf.resultsFile raised an exception (IOError/OSerror, e.g. permission denied, read-only media or a missing output directory), and the '%s' placeholders carry the file path and the OS error string.

Solutions

  1. Check that the output directory (default ~/.local/share/sqlmap/output/<host>) exists and is writable
  2. Free disk space and disable read-only locks/antivirus interference on the results CSV
  3. Re-run with an explicit writable location via --output / -o settings, and retry the scan to regenerate the results file
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at lib/controller/controller.py:341 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/5127c630614433b4. Report an issue: GitHub.

Appendix: source

Thrown at lib/controller/controller.py:341

        if injection.place is None or injection.parameter is None:
            continue

        key = (injection.place, injection.parameter, ';'.join(injection.notes))
        if key not in results:
            results[key] = []

        results[key].extend(list(injection.data.keys()))

    try:
        for key, value in results.items():
            place, parameter, notes = key
            line = "%s,%s,%s,%s,%s%s" % (safeCSValue(kb.originalUrls.get(conf.url) or conf.url), place, parameter, "".join(techniques[_][0].upper() for _ in sorted(value)), notes, os.linesep)
            conf.resultsFP.write(line)

        conf.resultsFP.flush()
    except IOError as ex:
        errMsg = "unable to write to the results file '%s' ('%s'). " % (conf.resultsFile, getSafeExString(ex))
        raise SqlmapSystemException(errMsg)

@stackedmethod
def start():
    """
    This function calls a function that performs checks on both URL
    stability and all GET, POST, Cookie and User-Agent parameters to
    check if they are dynamic and SQL injection affected
    """

    if conf.hashFile:
        crackHashFile(conf.hashFile)

    if conf.direct:
        initTargetEnv()
        setupTargetEnv()
        action()
        return True

View on GitHub (pinned to 0a35b20e39)