Repository navigation
Description
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
- Install Zenmap 7.99 on Windows 10.
- Launch Zenmap.
- (Optional) Perform any scan or simply open the application.
- Close the Zenmap window.
- 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
Bugbuster2004 commentedon Jul 29, 2026
Hello, i understood the issue and would like to contribute to this issue?
regards
Catch a base class of sqlite3 exceptions, not only a specific one. Fixes
bolt2658 commentedon Sep 5, 2026