glenpp / py-hole

A Pi-hole inspired DNS firewall for use with bind/named using RPZ
GNU General Public License v3.0
21 stars 6 forks source link

ERROR - Cache file is missing (never successfully fetched?): bindRPZ/bindRPZcache-raw.githubusercontent.com_StevenBlack_hosts_master_hosts Cache file is missing (never successfully fetched?): bindRPZ/bindRPZcache-raw.githubusercontent.com_StevenBlack_hosts_master_hosts #8

Open pecastro opened 3 years ago

pecastro commented 3 years ago

As I mentioned in issue #7 there is something more at play rather than a simple config file issue. At the very least, the vanilla config file provided is broken.

I fresh clone from your repo where the only changes done are the ones described below such that I could run the script as myself and on a host that is not running BIND triggers an error.

pecastro@localhost /download/py-hole[master]$ git rev-parse HEAD
1cd555dc9946d796564c82e2bc6fadef94c08f7a
pecastro@localhost /download/py-hole[master]$ git diff 
diff --git a/py-hole-bind9RPZ_config.yaml b/py-hole-bind9RPZ_config.yaml
index 360ee9f..63b05b0 100644
--- a/py-hole-bind9RPZ_config.yaml
+++ b/py-hole-bind9RPZ_config.yaml
@@ -1,12 +1,12 @@
 ---
-# cachedir: /var/local/bindRPZ
+cachedir: bindRPZ
 # cacheprefix: bindRPZcache-
 # cache_sane_age: 1209600   # 14 days after which this will fail
 # cache_time_min: 3600   # 1 hour default
 # cache_time_default: 43200   # 12 hours default
 # cache_time_max: 604800  # 7 days default
-# fetch_user: nobody
-# fetch_group: nogroup
+fetch_user: pecastro
+fetch_group: pecastro
 reloadzonecommand: [ 'rndc', 'reload', 'rpz.example.com' ]
 # defaultresponse: CNAME .

pecastro@localhost /download/py-hole[master]$ git clean -fxd
Removing bindRPZ/
pecastro@localhost /download/py-hole[master]$ ./py-hole-bind9RPZ -c py-hole-bind9RPZ_config.yaml
py-hole-bind9RPZ[2963482]: INFO - begin updating blocklists...
py-hole-bind9RPZ[2963482]: INFO - Creating cache directory: bindRPZ
py-hole-bind9RPZ[2963482]: INFO - processing https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
py-hole-bind9RPZ[2963482]: DEBUG - expire due to configured maximum cache time
py-hole-bind9RPZ[2963482]: INFO - fecthing (no or expired cache)
py-hole-bind9RPZ[2963482]: ERROR - Fetch sanity check failed
py-hole-bind9RPZ[2963482]: INFO - processing https://urlhaus.abuse.ch/downloads/rpz/
py-hole-bind9RPZ[2963482]: DEBUG - expire due to configured maximum cache time
py-hole-bind9RPZ[2963482]: INFO - fecthing (no or expired cache)
py-hole-bind9RPZ[2963482]: DEBUG - Writing file: bindRPZ/bindRPZcache-urlhaus.abuse.ch_downloads_rpz_
py-hole-bind9RPZ[2963482]: ERROR - Cache file is missing (never successfully fetched?): bindRPZ/bindRPZcache-raw.githubusercontent.com_StevenBlack_hosts_master_hosts
Cache file is missing (never successfully fetched?): bindRPZ/bindRPZcache-raw.githubusercontent.com_StevenBlack_hosts_master_hosts

I understand it Works On Your Machine. I'm just reporting that it doesn't work on mine out of the box...

helmo commented 3 years ago

Same here. I set cachedir to something writable by the useraccount running this.

glenpp commented 3 years ago

What is missing here is the logs produced. The child process will attempt to log to syslog. This will typically end up in /var/log/syslog or /var/log/messages depending on the particular distro you are running.

Please provide this information. Lists provided are a moving target so the logs tell you when things go outside of the boundaries set. From there you can decide if you want to adjust the boundaries allowed or some other action.

pecastro commented 3 years ago

Still the same with the latest master.

$ rm -rf bindRPZ/; ./py-hole-bind9RPZ -c py-hole-bind9RPZ_config.yaml 
py-hole-bind9RPZ[1237086]: INFO - begin updating blocklists...
py-hole-bind9RPZ[1237086]: INFO - Creating cache directory: bindRPZ
py-hole-bind9RPZ[1237086]: INFO - processing https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
py-hole-bind9RPZ[1237086]: DEBUG - expire due to configured maximum cache time
py-hole-bind9RPZ[1237086]: INFO - fecthing (no or expired cache)
py-hole-bind9RPZ[1237086]: ERROR - Fetch sanity check failed
py-hole-bind9RPZ[1237086]: ERROR - child[1237089]: Content-Length header > sane_size_max: 2838532 > 2097152
py-hole-bind9RPZ[1237086]: INFO - processing https://urlhaus.abuse.ch/downloads/rpz/
py-hole-bind9RPZ[1237086]: DEBUG - expire due to configured maximum cache time
py-hole-bind9RPZ[1237086]: INFO - fecthing (no or expired cache)
py-hole-bind9RPZ[1237086]: DEBUG - Writing file: bindRPZ/bindRPZcache-urlhaus.abuse.ch_downloads_rpz_
py-hole-bind9RPZ[1237086]: ERROR - Cache file is missing (never successfully fetched?): bindRPZ/bindRPZcache-raw.githubusercontent.com_StevenBlack_hosts_master_hosts
Cache file is missing (never successfully fetched?): bindRPZ/bindRPZcache-raw.githubusercontent.com_StevenBlack_hosts_master_hosts