jacklul / pihole-updatelists

Update Pi-hole's lists from remote sources easily
MIT License
1.39k stars 81 forks source link

Unable to update the tool #105

Closed Fooughhy closed 2 years ago

Fooughhy commented 2 years ago

I am trying to update this script but continue receiving errors when doing so.

I get the following when running "sudo pihole-updatelists --update":

Git branch: master Local checksum: 30a5a965a88c20dcdae9f7892142e15a Failed to check remote script: HTTP request failed

I have reinstalled the script, tried without sudo and nothing helps.

Running with "--debug" I get the following:

Acquired process lock through file: /var/lock/pihole-updatelists.lock

  Pi-hole's Lists Updater by Jack'lul

https://github.com/jacklul/pihole-updatelists

Checksum: 30a5a965a88c20dcdae9f7892142e15a Git branch: master OS: Linux raspberrypi 5.15.40-v7l+ #1556 SMP Wed May 18 11:28:32 BST 2022 armv7l PHP: 7.3.31-1~deb10u1 NTS SQLite: 3.27.2 cURL: 7.64.0 Pi-hole Core: v5.10-0-g853f6b7d (master) Pi-hole Web: v5.12-0-g6c320a42 (master) Pi-hole FTL: v5.15 (master) Configuration: array(20) { ["CONFIG_FILE"] => string(28) "/etc/pihole-updatelists.conf" ["GRAVITY_DB"] => string(22) "/etc/pihole/gravity.db" ["LOCK_FILE"] => string(33) "/var/lock/pihole-updatelists.lock" ["LOG_FILE"] => string(0) "" ["ADLISTS_URL"] => string(47) "https://v.firebog.net/hosts/lists.php?type=tick" ["WHITELIST_URL"] => string(205) "https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/referral-sites.txt /home/xxx/xbox-whitelist.txt" ["REGEX_WHITELIST_URL"] => string(0) "" ["BLACKLIST_URL"] => string(225) "https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt https://www.github.developerdan.com/hosts/lists/amp-hosts-extended.txt https://www.github.developerdan.com/hosts/lists/dating-services-extended.txt" ["REGEX_BLACKLIST_URL"] => string(72) "https://raw.githubusercontent.com/mmotti/pihole-regex/master/regex.list " ["COMMENT"] => string(29) "Managed by pihole-updatelists" ["GROUP_ID"] => int(0) ["PERSISTENT_GROUP"] => bool(false) ["REQUIRE_COMMENT"] => bool(true) ["UPDATE_GRAVITY"] => bool(true) ["VERBOSE"] => bool(false) ["DEBUG"] => bool(true) ["DOWNLOAD_TIMEOUT"] => int(60) ["IGNORE_DOWNLOAD_FAILURE"] => bool(false) ["GIT_BRANCH"] => string(6) "master" ["VACUUM_DATABASE"] => bool(true) } Options: array(1) { ["debug"] => bool(false) }

jacklul commented 2 years ago

You can try rerunning install script to update

Fooughhy commented 2 years ago

As I said, I did an actual reinstall. But before that I also tried just running that command again.

If I do "pihole-updatelists --verbose --debug" I get the following:

Acquired process lock through file: /var/lock/pihole-updatelists.lock

  Pi-hole's Lists Updater by Jack'lul

https://github.com/jacklul/pihole-updatelists

Checksum: 30a5a965a88c20dcdae9f7892142e15a Git branch: master OS: Linux raspberrypi 5.15.40-v7l+ #1556 SMP Wed May 18 11:28:32 BST 2022 armv7l PHP: 7.3.31-1~deb10u1 NTS SQLite: 3.27.2 cURL: 7.64.0 Pi-hole Core: v5.10-0-g853f6b7d (master) Pi-hole Web: v5.12-0-g6c320a42 (master) Pi-hole FTL: v5.15 (master) Configuration: array(20) { ["CONFIG_FILE"] => string(28) "/etc/pihole-updatelists.conf" ["GRAVITY_DB"] => string(22) "/etc/pihole/gravity.db" ["LOCK_FILE"] => string(33) "/var/lock/pihole-updatelists.lock" ["LOG_FILE"] => string(0) "" ["ADLISTS_URL"] => string(47) "https://v.firebog.net/hosts/lists.php?type=tick" ["WHITELIST_URL"] => string(205) "https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/referral-sites.txt /home/xxxx/xbox-whitelist.txt" ["REGEX_WHITELIST_URL"] => string(0) "" ["BLACKLIST_URL"] => string(225) "https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt https://www.github.developerdan.com/hosts/lists/amp-hosts-extended.txt https://www.github.developerdan.com/hosts/lists/dating-services-extended.txt" ["REGEX_BLACKLIST_URL"] => string(72) "https://raw.githubusercontent.com/mmotti/pihole-regex/master/regex.list " ["COMMENT"] => string(29) "Managed by pihole-updatelists" ["GROUP_ID"] => int(0) ["PERSISTENT_GROUP"] => bool(false) ["REQUIRE_COMMENT"] => bool(true) ["UPDATE_GRAVITY"] => bool(true) ["VERBOSE"] => bool(true) ["DEBUG"] => bool(true) ["DOWNLOAD_TIMEOUT"] => int(60) ["IGNORE_DOWNLOAD_FAILURE"] => bool(false) ["GIT_BRANCH"] => string(6) "master" ["VACUUM_DATABASE"] => bool(true) } Options: array(2) { ["verbose"] => bool(false) ["debug"] => bool(false) }

Configuration option VACUUM_DATABASE has been removed.

Opened gravity database: /etc/pihole/gravity.db (6.86 MB)

SQL Query: SELECT FROM adlist SQL Query: SELECT FROM adlist_by_group Fetching ADLISTS from 'https://v.firebog.net/hosts/lists.php?type=tick'... error setting certificate verify locations: CAfile: ~/.local/share/cacert.pem CApath: /etc/ssl/certs

SQL Query: SELECT FROM domainlist SQL Query: SELECT FROM domainlist_by_group Fetching WHITELIST from 'https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt'... error setting certificate verify locations: CAfile: ~/.local/share/cacert.pem CApath: /etc/ssl/certs One of the lists failed to download, operation aborted!

Fetching BLACKLIST from 'https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt'... error setting certificate verify locations: CAfile: ~/.local/share/cacert.pem CApath: /etc/ssl/certs One of the lists failed to download, operation aborted!

Fetching REGEX_BLACKLIST from 'https://raw.githubusercontent.com/mmotti/pihole-regex/master/regex.list '... done (14 entries) Processing... SQL Query: SELECT FROM domainlist WHERE enabled = 1 AND type = 3 AND comment LIKE "%Managed by pihole-updatelists%" SQL Query: SELECT FROM domainlist LEFT JOIN domainlist_by_group ON domainlist.id = domainlist_by_group.domainlist_id WHERE domainlist.enabled = 1 AND domainlist.type = 3 AND domainlist_by_group.group_id = 0 Exists: ^ad([sxv]?[0-9]|system)_.-{1,}|[_.-]ad([sxv]?[0-9]|system)[.-] Exists: ^(.+[.-])?adse?rv(er?|ice)?s?[0-9][.-] Exists: ^(.+[.-])?telemetry[_.-] Exists: ^adim(age|g)s?[0-9][.-] Exists: ^adtrack(er|ing)?[0-9]*[.-] Exists: ^advert(s|is(ing|ements?))?[0-9][.-] Exists: ^aff(iliat(es?|ion))?[.-] Exists: ^analytics?[.-] Exists: ^banners?[.-] Exists: ^beacons?[0-9][.-] Exists: ^count(ers?)?[0-9]*[.-] Exists: ^mads. Exists: ^pixels?[-.] Exists: ^stat(s|istics)?[0-9]*[_.-] Summary: 14 exists

Closed database handles. Updating Pi-hole's gravity using command '/usr/local/bin/pihole updateGravity'... [i] Neutrino emissions detected... [✓] Pulling blocklist source list into range

[✓] Preparing new gravity database [i] Using libz compression

[i] Target: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts [✓] Status: Retrieval successful [i] Analyzed 115063 domains [i] List stayed unchanged

[✓] Creating new gravity databases [✓] Storing downloaded domains in new gravity database [✓] Building tree [✓] Swapping databases [✓] The old database remains available. [i] Number of gravity domains: 115063 (115063 unique domains) [i] Number of exact blacklisted domains: 0 [i] Number of regex blacklist filters: 14 [i] Number of exact whitelisted domains: 18 [i] Number of regex whitelist filters: 0 [✓] Cleaning up stray matter

[✓] FTL is listening on port 53 [✓] UDP (IPv4) [✓] TCP (IPv4) [✓] UDP (IPv6) [✓] TCP (IPv6)

[✓] Pi-hole blocking is enabled

Memory reached peak usage of 1.47 MB Finished with 3 error(s) in 6.48 seconds. Releasing lock and removing lockfile: /var/lock/pihole-updatelists.lock

jacklul commented 2 years ago

error setting certificate verify locations: CAfile: ~/.local/share/cacert.pem CApath: /etc/ssl/certs

Here is your issue, PHP is expecting a CA cert there and it can't find one, because of this any SSL connection initiated by PHP will fail.

Fooughhy commented 2 years ago

I have set the "CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt" in the environment (visible with 'printenv') and if I use curl on the same address, it works.

Also if I curl on a https site (like '') it return this: image

Fooughhy commented 2 years ago

Followed this: https://support.deskpro.com/lt-LT/kb/articles/how-to-update-curl-trusted-root-certificates

Works now.