Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh install of Docker image fails with database errors. #1703

Closed
4 of 6 tasks
PhilThurston opened this issue Feb 19, 2025 · 3 comments
Closed
4 of 6 tasks

Fresh install of Docker image fails with database errors. #1703

PhilThurston opened this issue Feb 19, 2025 · 3 comments

Comments

@PhilThurston
Copy link

This is a: Run Issue

Details

When installing a fresh version of the latest docker image on a fresh system we get various errors below.

Related Issues

  • I have searched this repository/Pi-hole forums for existing issues and pull requests that look similar

How to reproduce the issue

  1. Environment data
  • Operating System: Rasbian
  • Hardware: RasPi 3B
  • Kernel Architecture: aarch64
  • Docker Install Info and version:
    • Software source: 25.0.3, build 4debf41
    • Supplimentary Software:
  • Hardware architecture:
version: '3.8'

services:
  pihole:
    container_name: pihole
    hostname: "{{ inventory_hostname }}"
    image: pihole/pihole:latest
    restart: unless-stopped
    pull_policy: always
    ports:
      - "{{ ansible_host }}:53:53/tcp"
      - "{{ ansible_host }}:53:53/udp"
      - "80:80/tcp"
      - "443:443/tcp"
      # - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
    environment:
      TZ: "{{ local_timezone }}"
      FTLCONF_webserver_api_password: "{{ pihole_web_password }}"
      FTLCONF_dns_dnssec: "true"
      FTLCONF_dns_bogusPriv: "true"
      FTLCONF_dns_domainNeeded: "true"
      FTLCONF_webserver_interface_theme: "default-dark"
      FTLCONF_dns_listeningMode: "all"
      FTLCONF_dns_revServers: "true,{{ cut_local_subnet }}.0/24,{{ cut_local_subnet }}.1"
    volumes:
      - "/opt/pihole/etc-pihole:/etc/pihole"
      - "/opt/pihole/etc-dnsmasq.d:/etc/dnsmasq.d"
    cap_add:
      - NET_ADMIN # Recommended but not required (DHCP needs NET_ADMIN)
    dns:
      - "127.0.0.1"
    networks:
      custom_network:
        ipv4_address: 172.30.0.2

networks:
  custom_network:
    name: "{{ docker_network_name }}"
    ipam:
      driver: default
      config:
        - subnet: 172.30.0.0/24

Output from docker on fresh install:

2025-02-18 17:47:12.149 MST [55M] INFO: FTL branch: master
2025-02-18 17:47:12.149 MST [55M] INFO: FTL version: v6.0
2025-02-18 17:47:12.149 MST [55M] INFO: FTL commit: eaa7dbb4
2025-02-18 17:47:12.149 MST [55M] INFO: FTL date: 2025-02-18 17:19:26 +0000
2025-02-18 17:47:12.149 MST [55M] INFO: FTL user: pihole
2025-02-18 17:47:12.149 MST [55M] INFO: Compiled for linux/arm64/v8 (compiled on CI) using cc (Alpine 14.2.0) 14.2.0
2025-02-18 17:47:12.464 MST [55M] INFO: 7 FTLCONF environment variables found (7 used, 0 invalid, 0 ignored)
2025-02-18 17:47:12.464 MST [55M] INFO:    [✓] FTLCONF_webserver_interface_theme is used
2025-02-18 17:47:12.464 MST [55M] INFO:    [✓] FTLCONF_dns_listeningMode is used
2025-02-18 17:47:12.464 MST [55M] INFO:    [✓] FTLCONF_webserver_api_password is used
2025-02-18 17:47:12.464 MST [55M] INFO:    [✓] FTLCONF_dns_revServers is used
2025-02-18 17:47:12.464 MST [55M] INFO:    [✓] FTLCONF_dns_domainNeeded is used
2025-02-18 17:47:12.464 MST [55M] INFO:    [✓] FTLCONF_dns_dnssec is used
2025-02-18 17:47:12.465 MST [55M] INFO:    [✓] FTLCONF_dns_bogusPriv is used
2025-02-18 17:47:12.467 MST [55M] INFO: Wrote config file:
2025-02-18 17:47:12.467 MST [55M] INFO:  - 152 total entries
2025-02-18 17:47:12.467 MST [55M] INFO:  - 144 entries are default
2025-02-18 17:47:12.467 MST [55M] INFO:  - 8 entries are modified
2025-02-18 17:47:12.467 MST [55M] INFO:  - 5 entries are forced through environment
2025-02-18 17:47:12.468 MST [55M] ERROR: Skipped invalid dns.revServers[0]: true,10.10.1.0/24,10.10.1.1
2025-02-18 17:47:12.469 MST [55M] INFO: Parsed config file /etc/pihole/pihole.toml successfully
2025-02-18 17:47:12.469 MST [55M] INFO: PID file does not exist or not readable
2025-02-18 17:47:12.469 MST [55M] INFO: No other running FTL process found.
2025-02-18 17:47:12.469 MST [55M] WARNING: Insufficient permissions to set process priority to -10 (CAP_SYS_NICE required), process priority remains at 0
2025-02-18 17:47:12.476 MST [55M] INFO: PID of FTL process: 55
2025-02-18 17:47:12.477 MST [55M] INFO: listening on 0.0.0.0 port 53
2025-02-18 17:47:12.477 MST [55M] INFO: listening on :: port 53
2025-02-18 17:47:12.481 MST [55M] INFO: PID of FTL process: 55
2025-02-18 17:47:12.481 MST [55M] WARNING: No database file found, creating new (empty) database
2025-02-18 17:47:12.597 MST [55M] INFO: Database version is 1
2025-02-18 17:47:12.597 MST [55M] INFO: Updating long-term database to version 2
2025-02-18 17:47:12.613 MST [55M] INFO: Updating long-term database to version 3
2025-02-18 17:47:12.630 MST [55M] INFO: Updating long-term database to version 4
2025-02-18 17:47:12.641 MST [55M] INFO: Updating long-term database to version 5
2025-02-18 17:47:12.662 MST [55M] INFO: Updating long-term database to version 6
2025-02-18 17:47:12.675 MST [55M] INFO: Updating long-term database to version 7
2025-02-18 17:47:12.687 MST [55M] INFO: Updating long-term database to version 8
2025-02-18 17:47:12.713 MST [55M] INFO: Updating long-term database to version 9
2025-02-18 17:47:12.729 MST [55M] INFO: Updating long-term database to version 10
2025-02-18 17:47:12.755 MST [55M] INFO: Updating long-term database to version 11
2025-02-18 17:47:12.774 MST [55M] INFO: Updating long-term database to version 12
2025-02-18 17:47:12.787 MST [55M] INFO: Updating long-term database to version 13
2025-02-18 17:47:12.799 MST [55M] INFO: Updating long-term database to version 14
2025-02-18 17:47:12.808 MST [55M] INFO: Updating long-term database to version 15
2025-02-18 17:47:12.824 MST [55M] INFO: Updating long-term database to version 16
2025-02-18 17:47:12.836 MST [55M] INFO: Updating long-term database to version 17
2025-02-18 17:47:12.849 MST [55M] INFO: Updating long-term database to version 18
2025-02-18 17:47:12.859 MST [55M] INFO: Updating long-term database to version 19
2025-02-18 17:47:12.871 MST [55M] INFO: Updating long-term database to version 20
2025-02-18 17:47:12.894 MST [55M] INFO: Updating long-term database to version 21
2025-02-18 17:47:12.903 MST [55M] INFO: Database successfully initialized
2025-02-18 17:47:12.920 MST [55M] INFO: Imported 0 queries from the on-disk database (it has 0 rows)
2025-02-18 17:47:12.920 MST [55M] INFO: Parsing queries in database
2025-02-18 17:47:12.921 MST [55M] INFO: Imported 0 queries from the long-term database
2025-02-18 17:47:12.921 MST [55M] INFO:  -> Total DNS queries: 0
2025-02-18 17:47:12.921 MST [55M] INFO:  -> Cached DNS queries: 0
2025-02-18 17:47:12.921 MST [55M] INFO:  -> Forwarded DNS queries: 0
2025-02-18 17:47:12.921 MST [55M] INFO:  -> Blocked DNS queries: 0
2025-02-18 17:47:12.921 MST [55M] INFO:  -> Unknown DNS queries: 0
2025-02-18 17:47:12.921 MST [55M] INFO:  -> Unique domains: 0
2025-02-18 17:47:12.921 MST [55M] INFO:  -> Unique clients: 0
2025-02-18 17:47:12.921 MST [55M] INFO:  -> DNS cache records: 0
2025-02-18 17:47:12.921 MST [55M] INFO:  -> Known forward destinations: 0
2025-02-18 17:47:13.171 MST [55M] WARNING: Insufficient permissions to set system time (CAP_SYS_TIME required), NTP client not available
2025-02-18 17:47:13.171 MST [55/T83] INFO: NTP server listening on 0.0.0.0:123 (IPv4)
2025-02-18 17:47:13.171 MST [55/T84] INFO: NTP server listening on :::123 (IPv6)
2025-02-18 17:47:13.172 MST [55M] INFO: FTL is running as user pihole (UID 1000)
2025-02-18 17:47:13.179 MST [55M] INFO: Created SSL/TLS certificate for pi.hole at /etc/pihole/tls.pem
2025-02-18 17:47:13.180 MST [55M] INFO: Reading certificate from /etc/pihole/tls.pem ...
2025-02-18 17:47:13.180 MST [55M] INFO: Using SSL/TLS certificate file /etc/pihole/tls.pem
2025-02-18 17:47:13.181 MST [55M] INFO: Web server ports:
2025-02-18 17:47:13.181 MST [55M] INFO:   - 80 (HTTP, IPv4, optional)
2025-02-18 17:47:13.181 MST [55M] INFO:   - 80 (HTTP, IPv6, optional)
2025-02-18 17:47:13.181 MST [55M] INFO:   - 443 (HTTPS, IPv4, optional)
2025-02-18 17:47:13.181 MST [55M] INFO:   - 443 (HTTPS, IPv6, optional)
2025-02-18 17:47:13.182 MST [55M] INFO: Restored 0 API sessions from the database
2025-02-18 17:47:13.187 MST [55M] INFO: Blocking status is enabled
2025-02-18 17:47:13.273 MST [55/T85] ERROR: gravityDB_count(SELECT value FROM info WHERE property = 'gravity_count';) - SQL error step no more rows available
2025-02-18 17:47:13.273 MST [55/T85] WARNING: Count of gravity domains not available. Please run pihole -g
2025-02-18 17:47:13.276 MST [55/T85] INFO: Compiled 0 allow and 0 deny regex for 3 clients in 0.3 msec
2025-02-18 17:47:14.085 MST [55/T85] ERROR: gravity_updated(): SELECT value FROM info WHERE property = 'updated'; - SQL error step: no more rows available
2025-02-18 17:47:15.090 MST [55/T85] ERROR: gravity_updated(): SELECT value FROM info WHERE property = 'updated'; - SQL error step: no more rows available
2025-02-18 17:47:16.099 MST [55/T85] ERROR: gravity_updated(): SELECT value FROM info WHERE property = 'updated'; - SQL error step: no more rows available
2025-02-18 17:47:17.005 MST [55/T85] ERROR: gravity_updated(): SELECT value FROM info WHERE property = 'updated'; - SQL error step: no more rows available
2025-02-18 17:47:18.013 MST [55/T85] ERROR: gravity_updated(): SELECT value FROM info WHERE property = 'updated'; - SQL error step: no more rows available
2025-02-18 17:47:19.021 MST [55/T85] ERROR: gravity_updated(): SELECT value FROM info WHERE property = 'updated'; - SQL error step: no more rows available
2025-02-18 17:47:20.024 MST [55/T85] ERROR: gravity_updated(): SELECT value FROM info WHERE property = 'updated'; - SQL error step: no more rows available
2025-02-18 17:47:21.027 MST [55/T85] ERROR: gravity_updated(): SELECT value FROM info WHERE property = 'updated'; - SQL error step: no more rows available
2025-02-18 17:47:22.030 MST [55/T85] ERROR: gravity_updated(): SELECT value FROM info WHERE property = 'updated'; - SQL error step: no more rows available

These common fixes didn't work for my issue

  • I have tried removing/destroying my container, and re-creating a new container
  • I have tried fresh volume data by backing up and moving/removing the old volume data
  • I have tried running the stock docker run example(s) in the readme (removing any customizations I added)
  • I have tried a newer or older version of Docker Pi-hole (depending what version the issue started in for me)
  • I have tried running without my volume data mounts to eliminate volumes as the cause

If the above debugging / fixes revealed any new information note it here.
Add any other debugging steps you've taken or theories on root cause that may help.

@PromoFaux
Copy link
Member

Does the gravity.db file exist in /etc/pihole/?

Were there any more output lines from the container before the FTL log starts? I would have expected it to run gravity and create a new database with fresh (empty) volumes.

And what happens if you start the container with no volume mounts at all?

@PhilThurston
Copy link
Author

Yes there was an issue on fresh installation where it would hang because it couldn't resolve DNS queries and never moved on. Restarting the container led to the errors above. The solution to resolve this for future people was to add a DNS server to the docker compose file that wasn't local. The local resolver doesn't work on v6 where it once did on v5

    dns:
      - "127.0.0.1"
      - "8.8.8.8"

@Bouke
Copy link

Bouke commented Feb 19, 2025

After upgrading my container from v5 to v6, my container won't boot anymore and keeps printing this line:

[56/T97] ERROR: gravity_updated(): SELECT value FROM info WHERE property = 'updated'; - SQL error step: no more rows available

I have added the dns configuration to my compose file to no avail. I have removed gravity.db to get my network usable again, but this is not a great upgrade ux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants