FTL magic byte is 0

Expected Behaviour:

No error... not sure what the error means. Pihole boots as it should but has massive amount of this error at boot. I have tried to remediate with backing up pihole-FTL.db and following the instructions in FTL broken - Trying to access query ID 0, but magic byte is 0; found in findQueryID() - #16 by DL6ER but it still persists.

  • Operating System: Fedora 44
  • Hardware: i7/32GB
  • Docker compose file
  •   pihole:
        image: pihole/pihole:latest
        container_name: pihole
        hostname: pihole
        networks:
          dnet:
            ipv4_address: '172.22.0.153'
          dvpn:
            ipv4_address: '172.200.0.153'
        dns: 127.0.0.1
        ports:
          - "53:53/tcp"
          - "53:53/udp"
        cap_add:  - CAP_SYS_NICE
        environment:
          TZ: 'America/New_York'
          FTLCONF_dns_dnssec: 'True'
          PIHOLE_UID: 1000
          PIHOLE_GID: 1000
          DNSMASQ_USER: pihole
          FTLCONF_dns_upstreams: 'unbound#5335'
          FTLCONF_dns_listeningMode: all
          FTLCONF_webserver_api_temp_unit: 'F'
          #FTLCONF_webserver_tls_rev_proxy: true
          FTLCONF_dns_reply_host_IPv4: 192.168.9.52
          FTLCONF_webserver_domain: 'pihole.domain.dev'
          FTLCONF_debug_performance: true
          TAIL_FTL_LOG: 1
          SKIPGRAVITYONBOOT: 1
          #IPv6: false
        shm_size: '1g'
        volumes:
          - '$DOCKER_DIR/pihole/pihole:/etc/pihole'
          - '$DOCKER_DIR/pihole/dnsmasqd:/etc/dnsmasq.d'
          - '$DOCKER_DIR/pihole/log:/var/log/pihole'
        restart: unless-stopped
        depends_on:
          - unbound
    
  • Docker engine version: Docker version 29.8.2, build 7fc2dff
  • Core version is v6.4.3 (Latest: v6.4.3)
  • Web version is v6.6 (Latest: v6.6)
  • FTL version is v6.7.1 (Latest: v6.7.1)

Actual Behaviour:

2026-10-03 11:22:53.695 EDT [53M] INFO: FTL is running as user pihole (UID 1000)
2026-10-03 11:22:53.696 EDT [53/T87] INFO: Reading certificate from /etc/pihole/tls.pem ...
2026-10-03 11:22:53.696 EDT [53M] INFO: Blocking status is enabled
2026-10-03 11:22:53.696 EDT [53/T87] INFO: Using SSL/TLS certificate file /etc/pihole/tls.pem
2026-10-03 11:22:53.697 EDT [53/T87] INFO: Web server ports:
2026-10-03 11:22:53.697 EDT [53/T87] INFO:   - 0.0.0.0:80 (HTTP, IPv4, OK)
2026-10-03 11:22:53.697 EDT [53M] ERROR: Trying to access query ID 1313, but magic byte is 0
2026-10-03 11:22:53.697 EDT [53/T87] INFO:   - 0.0.0.0:443 (HTTPS, IPv4, OK)
2026-10-03 11:22:53.697 EDT [53M] ERROR: found in findQueryID() (src/datastructure.c:179)
2026-10-03 11:22:53.697 EDT [53/T87] DEBUG_ANY: Generated 32 bytes of secure randomness
2026-10-03 11:22:53.697 EDT [53M] ERROR: Trying to access query ID 1312, but magic byte is 0
2026-10-03 11:22:53.697 EDT [53M] ERROR: found in findQueryID() (src/datastructure.c:179)
2026-10-03 11:22:53.697 EDT [53M] ERROR: Trying to access query ID 1311, but magic byte is 0
2026-10-03 11:22:53.697 EDT [53M] ERROR: found in findQueryID() (src/datastructure.c:179)
2026-10-03 11:22:53.697 EDT [53M] ERROR: Trying to access query ID 1310, but magic byte is 0
2026-10-03 11:22:53.697 EDT [53M] ERROR: found in findQueryID() (src/datastructure.c:179)
2026-10-03 11:22:53.697 EDT [53M] ERROR: Trying to access query ID 1309, but magic byte is 0
2026-10-03 11:22:53.697 EDT [53M] ERROR: found in findQueryID() (src/datastructure.c:179)
2026-10-03 11:22:53.697 EDT [53M] ERROR: Trying to access query ID 1308, but magic byte is 0
2026-10-03 11:22:53.697 EDT [53M] ERROR: found in findQueryID() (src/datastructure.c:179)
2026-10-03 11:22:53.697 EDT [53M] ERROR: Trying to access query ID 1307, but magic byte is 0
2026-10-03 11:22:53.697 EDT [53M] ERROR: found in findQueryID() (src/datastructure.c:179)
2026-10-03 11:22:53.697 EDT [53M] ERROR: Trying to access query ID 1306, but magic byte is 0
2026-10-03 11:22:53.697 EDT [53M] ERROR: found in findQueryID() (src/datastructure.c:179)

Debug Token:

pihole:/var/log/pihole# tail -n1000 FTL.log | pihole tricorder
Upload successful, your token is: https://tricorder.pi-hole.net/O9gEaYkG/
NOTE: In this output I initially had FTLCONF_debug_performance: true but removed it and used DEBUG_ALL: true. Once I remove the performance debug I do not see the error. Is this normal?

This is a rare edge case: rows in the long-term database that FTL considers invalid are skipped when the history is imported at startup, but the space for them was already reserved, and every scan over that empty space logged one of these errors. Fix GC processing queries twice after import gaps and during a log flush by 010011110 · Pull Request #3173 · pi-hole/FTL · GitHub fixes it, the fix will be in the next FTL release. Your log should also contain a line like Expected to import X queries, but found only Y from the same restart.