hassio-addons / addon-pi-hole

Pi-hole - Home Assistant Community Add-ons
https://addons.community
MIT License
123 stars 40 forks source link

Problem to open the PiHole web interface #88

Closed denisjoshua closed 5 years ago

denisjoshua commented 5 years ago

Problem/Motivation

Problem to open the PiHole web interface

(Why the issue was filed) I update at the 4.0 version

Expected behavior

open the web page interface using Ingress

Actual behavior

I take an error: Failed Host Check: domain.com vs 192.168.1.168, , a0d7b954-pi-hole, pi.hole, localhost, ubuntu, ubuntu.local, pihole.domain.com

Steps to reproduce

I just updated

So I just update at the 4.0 version and I choose to use Ingress in order to open the webpage but when I click I take Failed Host Check error.

Thanks a lot all Denis

jerkovicl commented 5 years ago

I am getting the same error, on previous version everything worked perfectly Log is showing some error dont know if its related:

nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
sinclairpaul commented 5 years ago

Could you please post the config for the addon and a full log?, the Openresty error can be ignored.

jerkovicl commented 5 years ago

  "update_lists_on_start": true,
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "interface": "",
  "ipv6": true,
  "ipv4_address": "",
  "ipv6_address": "",
  "virtual_host": "!secret base_url",
  "hosts": [
    {
      "name": "hassio.local",
      "ip": "192.168.5.40"
    },
    {
      "name": "xxx.duckdns.org",
      "ip": "192.168.5.40"
    },
    {
      "name": "Simes-iPhone",
      "ip": "192.168.5.52"
    },
    {
      "name": "Simes-iPhone",
      "ip": "192.168.5.110"
    },
    {
      "name": "lujo-pc",
      "ip": "192.168.5.75"
    }
  ]
}```
jerkovicl commented 5 years ago
  [i] Status: Pending...

  [✓] Status: Retrieval successful

  [i] Target: www.stopforumspam.com (toxic_domains_whole.txt)
  [i] Status: Pending...

  [✓] Status: Retrieval successful

  [i] Target: raw.githubusercontent.com (HOSTS%20(including%20excessive%20GOV%20URLs))
  [i] Status: Pending...

  [✓] Status: Retrieval successful

  [i] Consolidating blocklists...

  [✓] Consolidating blocklists
  [i] Extracting domains from blocklists...

  [✓] Extracting domains from blocklists
  [i] Number of domains being pulled in by gravity: 424711
  [i] Removing duplicate domains...

  [✓] Removing duplicate domains
  [i] Number of unique domains trapped in the Event Horizon: 256628
  [i] Number of whitelisted domains: 21...

  [i] Number of whitelisted domains: 21
  [i] Number of blacklisted domains: 1
  [i] Parsing domains into hosts format...

  [✓] Parsing domains into hosts format
  [i] Cleaning up stray matter...

  [✓] Cleaning up stray matter

  [✓] DNS service is running
  [✓] Pi-hole blocking is Enabled
[cont-init.d] pihole.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[18:44:12] INFO: Starting PHP-FPM...
[18:44:12] INFO: Starting Pi-Hole FTL...
[2019-08-27 18:44:12.191 1634] Using log file /var/log/pihole-FTL.log
[2019-08-27 18:44:12.191 1634] ########## FTL started! ##########
[2019-08-27 18:44:12.191 1634] FTL branch: master
[2019-08-27 18:44:12.191 1634] FTL version: v4.3.1
[2019-08-27 18:44:12.191 1634] FTL commit: b60d63f-dirty
[2019-08-27 18:44:12.191 1634] FTL date: 2019-05-25 21:37:26 +0200
[2019-08-27 18:44:12.191 1634] FTL user: pihole
[2019-08-27 18:44:12.191 1634] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2019-08-27 18:44:12.191 1634]    SOCKET_LISTENING: only local
[2019-08-27 18:44:12.191 1634]    AAAA_QUERY_ANALYSIS: Show AAAA queries
[2019-08-27 18:44:12.191 1634]    MAXDBDAYS: max age for stored queries is 365 days
[2019-08-27 18:44:12.191 1634]    RESOLVE_IPV6: Resolve IPv6 addresses
[2019-08-27 18:44:12.191 1634]    RESOLVE_IPV4: Resolve IPv4 addresses
[2019-08-27 18:44:12.191 1634]    DBINTERVAL: saving to DB file every minute
[2019-08-27 18:44:12.191 1634]    DBFILE: Using /etc/pihole/pihole-FTL.db
[2019-08-27 18:44:12.191 1634]    MAXLOGAGE: Importing up to 24.0 hours of log data
[2019-08-27 18:44:12.191 1634]    PRIVACYLEVEL: Set to 0
[2019-08-27 18:44:12.191 1634]    IGNORE_LOCALHOST: Show queries from localhost
[2019-08-27 18:44:12.191 1634]    BLOCKINGMODE: Null IPs for blocked domains
[2019-08-27 18:44:12.191 1634]    ANALYZE_ONLY_A_AND_AAAA: Disabled. Analyzing all queries
[2019-08-27 18:44:12.191 1634]    DBIMPORT: Importing history from database
[2019-08-27 18:44:12.191 1634]    PIDFILE: Using /var/run/pihole-FTL.pid
[2019-08-27 18:44:12.191 1634]    PORTFILE: Using /var/run/pihole-FTL.port
[2019-08-27 18:44:12.191 1634]    SOCKETFILE: Using /var/run/pihole/FTL.sock
[2019-08-27 18:44:12.191 1634]    WHITELISTFILE: Using /etc/pihole/whitelist.txt
[2019-08-27 18:44:12.191 1634]    BLACKLISTFILE: Using /etc/pihole/black.list
[2019-08-27 18:44:12.191 1634]    GRAVITYFILE: Using /etc/pihole/gravity.list
[2019-08-27 18:44:12.191 1634]    REGEXLISTFILE: Using /etc/pihole/regex.list
[2019-08-27 18:44:12.191 1634]    SETUPVARSFILE: Using /etc/pihole/setupVars.conf
[2019-08-27 18:44:12.192 1634]    AUDITLISTFILE: Using /etc/pihole/auditlog.list
[2019-08-27 18:44:12.192 1634]    MACVENDORDB: Using /etc/pihole/macvendor.db
[2019-08-27 18:44:12.192 1634]    PARSE_ARP_CACHE: Active
[2019-08-27 18:44:12.192 1634] Finished config file parsing
[2019-08-27 18:44:12.192 1634] Database version is 3
[2019-08-27 18:44:12.193 1634] Database successfully initialized
[2019-08-27 18:44:12.193 1634] New forward server: 208.67.220.220 (0/512)
[2019-08-27 18:44:12.193 1634] New forward server: 8.8.8.8 (1/512)
[2019-08-27 18:44:12.193 1634] New forward server: 8.8.4.4 (2/512)
[2019-08-27 18:44:12.194 1634] Resizing "/FTL-strings" from 4096 to 8192
[2019-08-27 18:44:12.201 1634] New forward server: 208.67.222.222 (3/512)
[2019-08-27 18:44:12.201 1634] Resizing "/FTL-strings" from 8192 to 12288
[2019-08-27 18:44:12.205 1634] Resizing "/FTL-strings" from 12288 to 16384
[2019-08-27 18:44:12.211 1634] Resizing "/FTL-queries" from 229376 to 458752
[2019-08-27 18:44:12.211 1634] Resizing "/FTL-strings" from 16384 to 20480
[2019-08-27 18:44:12.213 1634] Resizing "/FTL-strings" from 20480 to 24576
[2019-08-27 18:44:12.216 1634] Resizing "/FTL-strings" from 24576 to 28672
[2019-08-27 18:44:12.219 1634] Resizing "/FTL-strings" from 28672 to 32768
[2019-08-27 18:44:12.221 1634] Resizing "/FTL-queries" from 458752 to 688128
[2019-08-27 18:44:12.222 1634] Resizing "/FTL-strings" from 32768 to 36864
[2019-08-27 18:44:12.223 1634] Resizing "/FTL-strings" from 36864 to 40960
[2019-08-27 18:44:12.226 1634] Imported 9583 queries from the long-term database
[2019-08-27 18:44:12.226 1634]  -> Total DNS queries: 9583
[2019-08-27 18:44:12.226 1634]  -> Cached DNS queries: 380
[2019-08-27 18:44:12.226 1634]  -> Forwarded DNS queries: 4271
[2019-08-27 18:44:12.226 1634]  -> Exactly blocked DNS queries: 4932
[2019-08-27 18:44:12.226 1634]  -> Unknown DNS queries: 0
[2019-08-27 18:44:12.226 1634]  -> Unique domains: 1911
[2019-08-27 18:44:12.226 1634]  -> Unique clients: 3
[2019-08-27 18:44:12.226 1634]  -> Known forward destinations: 4
[18:44:12] INFO: Starting NGinx....
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
[2019-08-27 18:44:12.226[27/Aug/2019:18:46:07 +0200] 400 -(192.168.5.75) \x16\x03\x01\x05\xB7\x01\x00\x05\xB3\x03\x03\x9Fl\xBA\xE1\xEFZ\xBC?\x99*$\xBA?\xA5\xAB\x11\xAF)\xC6\x96u=\xDF\x17\xF2\x17]+\xBF\x05\xB5( \xF1\xBF\xE2*\x90\xBDG\x8E+\x0C~sR\xE6\xF2\xC2\x7F\x9A\xAE\x02\xFETa\xFD\xF7\x8C\x9D\x05[\xEC\xF9\x87\x00\x22\x8A\x8A\x13\x01\x13\x02\x13\x03\xC0+\xC0/\xC0,\xC00\xCC\xA9\xCC\xA8\xC0\x13\xC0\x14\x00\x9C\x00\x9D\x00/\x005\x00 (-)
2019/08/27 18:46:15 [error] 1685#1685: *2 access forbidden by rule, client: 192.168.5.75, server: a0d7b954-pi-hole, request: "GET /admin/queries.php HTTP/1.1", host: "192.168.5.40:4865"
[27/Aug/2019:18:46:15 +0200] 403 -(192.168.5.75) GET /admin/queries.php HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3887.7 Safari/537.36)
[27/Aug/2019:18:46:24 +0200] 400 -(192.168.5.75) \x16\x03\x01\x05\xB7\x01\x00\x05\xB3\x03\x031\x0F%0m\xF7AC\x8Ed\x80f\xA5\xB7\xA76fLZ`kH\x220\x9D\xBA/\xD8\x9F\xE3\xBA< \x88\x94a\xBF\xFB\xDA<%\xDA\xCCx\xB3\x7FD\xED\x8E6\x1E\x0C\x02Y\x5Cu\xB0Rl\xEF\x03\x95cH\xD8\x00\x22\xAA\xAA\x13\x01\x13\x02\x13\x03\xC0+\xC0/\xC0,\xC00\xCC\xA9\xCC\xA8\xC0\x13\xC0\x14\x00\x9C\x00\x9D\x00/\x005\x00 (-)
sinclairpaul commented 5 years ago

Thanks, just to confirm if you expose the addon and access via non-ingress, it works ok?

jerkovicl commented 5 years ago

nope i had port forward before and accessed it like that, but now even that doesnt work anymore

jerkovicl commented 5 years ago

another error popped up :

2019/08/27 23:05:22 [error] 1685#1685: *4 FastCGI sent in stderr: "PHP message: PHP Warning:  error_log(/var/log/lighttpd/error.log): failed to open stream: No such file or directory in /var/www/html/admin/scripts/pi-hole/php/auth.php on line 17" while reading response header from upstream, client: 172.30.32.2, server: a0d7b954-pi-hole, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:17276",
sinclairpaul commented 5 years ago

@jerkovicl I don't see the same error in your log, can you confirm you have a separate DNS server configured for your hassio instance as per the readme? This should probably be moved to a new issue.

jerkovicl commented 5 years ago

@sinclairpaul yes i have dns server configured and that error was in log i guess i just didnt select all:(

denisjoshua commented 5 years ago

Thanks a lot for the fix. Can we add this fix to pihole with out wait the updated version please ? I just add the "proxy_set_header Host pi.hole;" to the server_params.conf file but when I restart the docker that record was cancelled :-( Thanks again

sinclairpaul commented 5 years ago

@denisjoshua You can't as when you restart the container the change will be lost. I also don't believe that PR fully fixes the issue so have created another.

Fogh commented 5 years ago

Any news on a fix for this? I'm having the same problem after updating to 4.0

addons-assistant[bot] commented 5 years ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.