yubiuser/pihole_adlist_tool

Receiving an error "database disk image is malformed"

maheshc opened this issue · 1 comments

Hi

I recently installed this tool to check the efficiency of the adlists I have on my PiHole. When I ran the tool for the first time, this is the output:

*** Pihole Adlist Tool ***

++++++++ Info ++++++++

[i] PIHOLE_DNSMASQ_VERSION: 2.84
[i] SQLITE_VERSION: 3.34.0
[i] DAYS_REQUESTED: 30
[i] TOP: Not shown
[i] SORT_ORDER: id ASC
[i] UNIQUE: Not shown
[i] REGEX_MODE: Disabled

++++++++++++++++++++++

Error: database disk image is malformed
Would you like to analyze your current adlist configuration or first enable all adlists (current can be restored later)?

  1. Current adlist configuration
  2. Enable all adlists (runs pihole -g)

Please select: 1

[i] Keeping current adlist configuration

[i] There is a mismatch between your enabled adlists and the data found in the gravity database.
You have 47 adlists enabled, but data from 46 (patially different) adlists in your gravity database.
You're likely disabled/enabled adlist without running gravity afterwards.
It's highly recommended to run gravity now to solve the differences, otherwise this tool will analyze the available data.

Would you like to run gravity now?

  1. Yes
  2. No

Please select: 2

[i] Not running gravity, keeping mismatch between enabled adlists and the data found in the gravity database.

[i] Calculating.....
[i] This might take some time - please be patient.
Error: near line 4: database disk image is malformed
Error: near line 14: database disk image is malformed

As it says, your database (pihole-FTL.db or gravity.db or both) is malformed. You can try to fix this, but there might be underlying file system corruptions. Usually this happens after a non-graceful shutdown e.g. power loss. Usually best is to start with a fresh flashed SD card.

For more info see
https://discourse.pi-hole.net/search?context=topic&context_id=45858&q=Database%20malformed&skip_context=true