pihole-FTL.log - SQL error: attempt to write a readonly database

pihole-FTL.log - SQL error: attempt to write a readonly database

After updating my PiHole this morning, my logging (pihole -t) stops this evening.
I have done a 'sudo service dnsmasq restart'
No logging

Later I saw a pihole-FTL.log file of 46 MB, while my Ramdisk for logging is 60 MB. So it's full and no further logging

possible (also other loigging).
Nearly all "DB thread - SQL error: attempt to write a readonly database" loggings removed.
After that sudo service pihole-FTL restart

But still it's growing with the same logging: "SQL error: attempt to write a readonly database".

I did a reboot of the Pi, but the fault stays.

This is the pihole-FTL.log file
My actions are written between <>

[2017-06-21 00:00:01.864] NOTICE: pihole.log has been flushed
[2017-06-21 00:00:01.864] Resetting internal data structure
[2017-06-21 00:00:01.864] Queries in memory before flushing: 5663
[2017-06-21 00:00:04.658] Gravity list entries: 1596238
[2017-06-21 00:00:04.658] Blacklist entries: 22
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 0 to 1 (214.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 1 to 2 (227.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 2 to 3 (241.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 3 to 4 (257.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 4 to 5 (271.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 5 to 6 (289.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 6 to 7 (308.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 7 to 8 (328.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 8 to 9 (347.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 9 to 10 (375.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 10 to 11 (393.00 B)
[2017-06-21 00:00:04.659] Notice: Increasing wildcards struct size from 11 to 12 (406.00 B)
[2017-06-21 00:00:04.659] Wildcard blocking list entries: 12
[2017-06-21 00:00:04.659] Reading from /var/log/pihole.log.1 (rw-r--r--)
[2017-06-21 00:00:04.660] Notice: Increasing forwarded struct size from 0 to 4 (487.00 B)
[2017-06-21 00:00:04.767] New forward server: 195.241.77.58 cns2.net.telfort.nl (0/4)
[2017-06-21 00:00:04.768] Notice: Increasing overTime struct size from 0 to 100 (3.72 KB)
[2017-06-21 00:00:04.881] New forward server: 195.241.77.55 cns1.net.telfort.nl (1/4)
[2017-06-21 00:00:04.881] Notice: Increasing queries struct size from 0 to 10000 (323.76 KB)
[2017-06-21 00:00:04.882] Notice: Increasing domains struct size from 0 to 1000 (343.76 KB)
[2017-06-21 00:00:04.882] Notice: Increasing clients struct size from 0 to 10 (343.94 KB)
[2017-06-21 00:00:04.933] New client: 192.168.2.1 (0/10)
[2017-06-21 00:00:04.984] New client: 192.168.2.2 (1/10)
[2017-06-21 00:00:04.986] New client: 127.0.0.1 localhost (2/10)
[2017-06-21 00:00:05.186] Notice: Increasing overTime struct size from 100 to 200 (354.64 KB)
[2017-06-21 00:00:05.511] Reading from /var/log/pihole.log (rw-r--r--)
[2017-06-21 06:59:01.016] SQL error (5): database is locked
[2017-06-21 06:59:01.016] DB-GC error: Deleting queries due to age of entries failed!
[2017-06-21 10:54:17.468] dnsmasq process restarted
[2017-06-21 10:54:22.275] Gravity list entries: 1596238
[2017-06-21 10:54:22.275] Blacklist entries: 22
[2017-06-21 10:54:22.275] Wildcard blocking list entries: 12

[2017-06-21 11:24:29.460] FATAL: FTL received SIGTERM from PID/UID 6512/0, scheduled to exit gracefully
[2017-06-21 11:24:29.460] Shutting down...
[2017-06-21 11:24:29.460] ########## FTL terminated! ##########
[2017-06-21 11:29:05.691] ########## FTL started! ##########
[2017-06-21 11:29:05.691] FTL branch: (no branch)
[2017-06-21 11:29:05.691] FTL hash: v2.9.2
[2017-06-21 11:29:05.691] FTL date: 2017-06-19 21:16:56 +0200
[2017-06-21 11:29:05.691] FTL user: pihole
[2017-06-21 11:29:05.691] Starting config file parsing
[2017-06-21 11:29:05.692] SOCKET_LISTENING: only local
[2017-06-21 11:29:05.692] TIMEFRAME: Rolling 24h
[2017-06-21 11:29:05.692] QUERY_DISPLAY: Show queries
[2017-06-21 11:29:05.692] AAAA_QUERY_ANALYSIS: Hide AAAA queries
[2017-06-21 11:29:05.692] MAXDBDAYS: max age for stored queries is 365 days
[2017-06-21 11:29:05.692] Finished config file parsing
[2017-06-21 11:29:05.704] Found no other running pihole-FTL process
[2017-06-21 11:29:05.710] PID of FTL process: 9585
[2017-06-21 11:29:10.057] Gravity list entries: 1600187
[2017-06-21 11:29:10.057] Blacklist entries: 22
[2017-06-21 11:29:10.057] Notice: Increasing wildcards struct size from 0 to 1 (100.00 B)
[2017-06-21 11:29:10.057] Notice: Increasing wildcards struct size from 1 to 2 (113.00 B)
[2017-06-21 11:29:10.057] Notice: Increasing wildcards struct size from 2 to 3 (127.00 B)
[2017-06-21 11:29:10.057] Notice: Increasing wildcards struct size from 3 to 4 (143.00 B)
[2017-06-21 11:29:10.058] Notice: Increasing wildcards struct size from 4 to 5 (157.00 B)
[2017-06-21 11:29:10.058] Notice: Increasing wildcards struct size from 5 to 6 (175.00 B)
[2017-06-21 11:29:10.058] Notice: Increasing wildcards struct size from 6 to 7 (194.00 B)
[2017-06-21 11:29:10.058] Notice: Increasing wildcards struct size from 7 to 8 (214.00 B)
[2017-06-21 11:29:10.058] Notice: Increasing wildcards struct size from 8 to 9 (233.00 B)
[2017-06-21 11:29:10.058] Notice: Increasing wildcards struct size from 9 to 10 (261.00 B)
[2017-06-21 11:29:10.058] Notice: Increasing wildcards struct size from 10 to 11 (279.00 B)
[2017-06-21 11:29:10.058] Notice: Increasing wildcards struct size from 11 to 12 (292.00 B)
[2017-06-21 11:29:10.058] Wildcard blocking list entries: 12
[2017-06-21 11:29:10.058] Database initialized
[2017-06-21 11:29:10.059] Starting initial log file parsing
[2017-06-21 11:29:10.059] Reading from /var/log/pihole.log.1 (rw-r--r--)
[2017-06-21 11:29:10.059] Notice: Increasing forwarded struct size from 0 to 4 (373.00 B)
[2017-06-21 11:29:20.070] New forward server: 195.241.77.58 (0/4)
[2017-06-21 11:29:20.070] Notice: Increasing overTime struct size from 0 to 100 (3.59 KB)
[2017-06-21 11:29:30.081] New forward server: 195.241.77.55 (1/4)
[2017-06-21 11:29:30.114] Notice: Increasing queries struct size from 0 to 10000 (323.89 KB)
[2017-06-21 11:29:30.114] Notice: Increasing domains struct size from 0 to 1000 (343.90 KB)
[2017-06-21 11:29:30.114] Notice: Increasing clients struct size from 0 to 10 (344.08 KB)
[2017-06-21 11:29:31.996] New client: 192.168.2.1 (0/10)
[2017-06-21 11:29:32.047] New client: 192.168.2.2 (1/10)
[2017-06-21 11:29:32.079] New client: 127.0.0.1 localhost (2/10)
[2017-06-21 11:29:32.196] Notice: Increasing overTime struct size from 100 to 200 (352.88 KB)
[2017-06-21 11:29:32.517] Reading from /var/log/pihole.log (rw-r--r--)
[2017-06-21 11:29:32.654] Finished initial log file parsing
[2017-06-21 11:29:32.654] -> Total DNS queries: 3574
[2017-06-21 11:29:32.654] -> Cached DNS queries: 1124
[2017-06-21 11:29:32.654] -> Blocked DNS queries: 1278
[2017-06-21 11:29:32.654] -> Unknown DNS queries: 36
[2017-06-21 11:29:32.654] -> Unique domains: 376
[2017-06-21 11:29:32.654] -> Unique clients: 3
[2017-06-21 11:29:32.654] Successfully accessed setupVars.conf
[2017-06-21 11:29:32.655] Listening on port 4711 for incoming connections
[2017-06-21 11:30:00.098] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 11:30:00.098] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 11:30:00.098] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 11:30:00.099] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 11:30:00.099] DB thread - SQL error: attempt to write a readonly database

[2017-06-21 21:38:00.077] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:38:00.077] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:38:00.077] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:38:00.078] DB thread - SQL error: attempt to write a readonly database

[2017-06-21 21:50:00.181] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:50:00.181] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:50:00.181] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:50:00.182] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:50:00.182] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:50:00.182] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:50:00.182] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:50:00.182] DB thread - SQL error: attempt to write a readonly database

[2017-06-21 21:50:46.711] FATAL: FTL received SIGTERM from PID/UID 10368/0, scheduled to exit gracefully
[2017-06-21 21:50:46.712] Shutting down...
[2017-06-21 21:50:46.712] ########## FTL terminated! ##########
[2017-06-21 21:50:51.676] ########## FTL started! ##########
[2017-06-21 21:50:51.676] FTL branch: (no branch)
[2017-06-21 21:50:51.676] FTL hash: v2.9.3
[2017-06-21 21:50:51.677] FTL date: 2017-06-21 20:19:49 +0200
[2017-06-21 21:50:51.677] FTL user: pihole
[2017-06-21 21:50:51.677] Starting config file parsing
[2017-06-21 21:50:51.684] SOCKET_LISTENING: only local
[2017-06-21 21:50:51.684] TIMEFRAME: Rolling 24h
[2017-06-21 21:50:51.685] QUERY_DISPLAY: Show queries
[2017-06-21 21:50:51.685] AAAA_QUERY_ANALYSIS: Hide AAAA queries
[2017-06-21 21:50:51.685] MAXDBDAYS: max age for stored queries is 365 days
[2017-06-21 21:50:51.685] Finished config file parsing
[2017-06-21 21:50:51.699] Found no other running pihole-FTL process
[2017-06-21 21:50:51.702] PID of FTL process: 644
[2017-06-21 21:50:59.676] Gravity list entries: 1600187
[2017-06-21 21:50:59.676] Blacklist entries: 20
[2017-06-21 21:50:59.676] Notice: Increasing wildcards struct size from 0 to 1 (100.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 1 to 2 (113.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 2 to 3 (127.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 3 to 4 (143.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 4 to 5 (157.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 5 to 6 (175.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 6 to 7 (194.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 7 to 8 (214.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 8 to 9 (233.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 9 to 10 (261.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 10 to 11 (279.00 B)
[2017-06-21 21:50:59.677] Notice: Increasing wildcards struct size from 11 to 12 (292.00 B)
[2017-06-21 21:50:59.677] Wildcard blocking list entries: 12
[2017-06-21 21:50:59.688] Database initialized
[2017-06-21 21:50:59.688] Starting initial log file parsing
[2017-06-21 21:50:59.688] Reading from /var/log/pihole.log.1 (rw-r--r--)
[2017-06-21 21:50:59.688] Notice: Increasing forwarded struct size from 0 to 4 (373.00 B)
[2017-06-21 21:51:18.288] New forward server: 195.241.77.58 (0/4)
[2017-06-21 21:51:18.288] Notice: Increasing overTime struct size from 0 to 100 (3.59 KB)
[2017-06-21 21:51:28.298] New forward server: 195.241.77.55 (1/4)
[2017-06-21 21:51:28.424] Notice: Increasing queries struct size from 0 to 10000 (324.49 KB)
[2017-06-21 21:51:28.424] Notice: Increasing domains struct size from 0 to 1000 (344.50 KB)
[2017-06-21 21:51:28.424] Notice: Increasing clients struct size from 0 to 10 (344.69 KB)
[2017-06-21 21:51:31.841] New client: 192.168.2.1 (0/10)
[2017-06-21 21:51:31.892] New client: 192.168.2.2 (1/10)
[2017-06-21 21:51:31.903] Notice: Increasing overTime struct size from 100 to 200 (348.87 KB)
[2017-06-21 21:51:32.222] Reading from /var/log/pihole.log (rw-r--r--)
[2017-06-21 21:51:32.224] New client: 127.0.0.1 localhost (2/10)
[2017-06-21 21:51:32.524] New client: Jun 21 21:35:25 dnsmasq[7334]: started, version 2.76 cachesize 10000 (3/10)
[2017-06-21 21:51:32.602] New client: 192.168.2.6 (4/10)
[2017-06-21 21:51:32.637] Finished initial log file parsing
[2017-06-21 21:51:32.637] -> Total DNS queries: 3135
[2017-06-21 21:51:32.637] -> Cached DNS queries: 732
[2017-06-21 21:51:32.637] -> Blocked DNS queries: 1421
[2017-06-21 21:51:32.637] -> Unknown DNS queries: 35
[2017-06-21 21:51:32.637] -> Unique domains: 293
[2017-06-21 21:51:32.637] -> Unique clients: 5
[2017-06-21 21:51:32.637] Successfully accessed setupVars.conf
[2017-06-21 21:51:32.638] Listening on port 4711 for incoming connections
[2017-06-21 21:52:00.088] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:52:00.088] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:52:00.088] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:52:00.088] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:52:00.089] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:52:00.089] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:52:00.089] DB thread - SQL error: attempt to write a readonly database
[2017-06-21 21:52:00.089] DB thread - SQL error: attempt to write a readonly database

Database /etc/pihole/pihole-FTL.db

  • Permissions: 0644 (owner root has read and write rights)

Actual versions:
Pi-hole Version v3.1 Web Interface Version v3.1 FTL Version v2.9.3

What can I do to solve it?

Try sudo chown pihole /etc/pihole/pihole-FTL.db

Edit: Better yet, the whole directory: sudo chown -R pihole /etc/pihole/

Thanks for your fast response.

The error logging in pihole-FTL.log is stopped now.
Also the date/time stamp of the database file is actualized

Problem solved. Thanks

On one hand this was a good thing because it caught your attention to a problem of the database permissions. On the other hand, of course, this shouldn't happen. We'll add a limit of a maximum of three error messages that are printed at once at most:

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