FOREIGN KEY constraint failed

The issue I am facing:

I have Google'd these issues and no reasonable answers.

New debain system on a Netbook with * Pi-hole v5.17.1

OS is fully patched and updated.

Issues:

  1. Updating the gravity blocklists results in an error:
    [✓] Preparing new gravity database
    [i] Creating new gravity databases...
    [✗] Unable to copy data from /etc/pihole/gravity.db to /etc/pihole/gravity.db_temp
    Runtime error near line 16: FOREIGN KEY constraint failed (19)
    [✗] Unable to create gravity database. Please try again later. If the problem persists, please contact support.

  2. I don't know if this is a redherring or an actual issue:
    *** [ DIAGNOSING ]: contents of /etc/lighttpd/conf.d
    /etc/lighttpd/conf.d does not exist.

Details about my system:
Debain v12 fully patched and updated running on a netbook (lots of HD space and sufficient ram), connected to a highspeed modem via CAT5.

Debug: https://tricorder.pi-hole.net/D7UMKjNH/

I have run: pihole -r

There was an output error:
[✗] Unable to copy data from /etc/pihole/gravity.db to /etc/pihole/gravity.db_temp
Runtime error near line 16: FOREIGN KEY constraint failed (19)
[✗] Unable to create gravity database. Please try again later. If the problem persists, please contact support.

This post was helpful but did not fix my errors:

Uninstalled, reinstalled.

Default block list appears to be working.

I wanted to add some more blocklists.

Are you able to do so now?

ok diving back in....

I was using this page:

For block lists.

Looks like the OSID lists might have something in there which is causing a DB issue.
I was using Full: https://dbl.oisd.nl/

I am not using it now and Pi Hole appears to update fine.

Was running into the same error. Turned out to be the result of restoring a backup from a previous release of Pi-hole. Copied the adlists manually and there were no issues creating the database.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.