Skip to content

sqlite3.DatabaseError: database disk image is malformed #3420

Closed

Description

@bolt2658

Describe the bug

Zenmap 7.99 throws an unhandled exception when closing the application. During the shutdown process, Zenmap attempts to access its SQLite database, but fails with the following error:

sqlite3.DatabaseError: database disk image is malformed

The traceback indicates that the exception originates from zenmapCore/UmitDB.py while executing a SQL query against the local SQLite database. As a result, the application does not exit cleanly.


To Reproduce

  1. Install Zenmap 7.99 on Windows 10.
  2. Launch Zenmap.
  3. (Optional) Perform any scan or simply open the application.
  4. Close the Zenmap window.
  5. Observe that a Python traceback is displayed instead of the application closing normally.

Expected behavior

Zenmap should close normally without displaying any exception or traceback, even if the local database is corrupted. Ideally, the application should detect database corruption, notify the user, and recreate or repair the database automatically.


Actual behavior

The application terminates with the following traceback:

Version: 7.99

Traceback (most recent call last):
  File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.14\site-packages\zenmapGUI\App.py", line 120, in _destroy_callback
    from zenmapCore.UmitDB import UmitDB

  File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.14\site-packages\zenmapCore\UmitDB.py", line 301, in <module>
    verify_db()

  File "C:\Program Files (x86)\Nmap\zenmap\lib\python3.14\site-packages\zenmapCore\UmitDB.py", line 297, in verify_db
    cursor.execute("SELECT scans_id FROM scans WHERE date = 0")

sqlite3.DatabaseError: database disk image is malformed

Version info

  • OS: Windows 10
  • Zenmap version: 7.99
  • Nmap version: (Output of nmap --version)

Example:

Nmap version 7.99
Platform: x86_64-pc-windows

Additional context

  • The issue appears to be related to corruption of Zenmap's local SQLite database.
  • The error occurs during application shutdown while Zenmap verifies or accesses the scan database.
  • No network scan is required to trigger the exception (if applicable).
  • Reinstalling Zenmap does not necessarily resolve the issue if the existing database remains corrupted.

Possible cause

The SQLite database used by Zenmap appears to be corrupted (database disk image is malformed). The application currently does not appear to handle this condition gracefully and instead raises an unhandled exception during shutdown.

A recovery mechanism (for example, recreating the database after detecting corruption) could improve the user experience.

Activity

  1. Bugbuster2004 commented on Jul 29, 2026

    @Bugbuster2004

    Hello, i understood the issue and would like to contribute to this issue?
    regards

  2. added a commit that references this issue on Aug 21, 2026
    db4aefd
  3. bolt2658 commented on Sep 5, 2026

    @bolt2658
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions