New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ERROR]: Unable to parse results from queryads.php: Unhandled error message () #2195
Comments
Please fill out the issue template (see here for the template you deleted). We install lighttpd to use localhost, so this is not an issue with a normal install. However, I do see the issue. |
@Mcat12 I did not delete anything, I just opened a new issue. Anyways, I edited and molded issue to template. |
It appears that some mobile clients don't start with the template like the website does... If you want you can make a PR to fix it, or we will. |
Addendum: seems queryAds also doesn't work with IPv6 (same issue) About the template: not sure if I was on mobile tbh, but generate a PR if you want to. EDIT: fyi think I know what happened:
|
I have the same issue as described by @silv3rr
Wheres when I use the IPv4 (http://10.0...) address, I get a nice Logo with the following text below:
My PiHole is running on a Raspberry Pi 3 Model B with an up to date Rasbian. |
If a blocked domain is resolved to the IPv6 address of the Pi-hole, does the block page work? |
I recently switched my router and IPv6 is not yet working, so I can't test it at the moment. I'll try it as soon as my IPv6 is working again. Anyone else who could test it at the moment? Cheers, |
@Mcat12 nope:
My kludge: function queryAds($serverName) {
...
$serverAddr = htmlspecialchars($_SERVER['SERVER_ADDR']);
// ipv6 does not seem to work..
if (strpos($serverAddr, ':') !== false) {
echo ("<b>NOTICE:</b> Changing Server Address <code>$serverAddr</code> to <code>empty</code><br>");
$serverAddr = "";
}
if (empty($serverAddr)) {
$serverAddr = gethostbyname("pi.hole") ? "pi.hole" : "192.168.0.254";
echo ("<b>NOTICE:</b> Changed empty Server Address to <code>$serverAddr</code><br>");
}
$queryAds = file("http://$serverAddr/admin/scripts/pi-hole/php/queryads.php?domain=$serverName&bp", FILE_IGNORE_NEW_LINES);
... |
Test with kludge enabled:
Also http://[2001:fff:ffff:fff::1]/admin/ in browser does always work for me, without kludge (but not queryads). |
@silv3rr Do you want to open a Pull Request with your code additions? |
@dschaper That was just a quickfix with hardcoded ip and example to show the issue. https://github.com/pi-hole/AdminLTE/blob/e48aa295bd993a4a82bdabeb12a73e3123fc1559/settings.php#L80 So, combine |
We'd welcome the Pull Request if you'd like to set one up. |
Any updates here ? Having the same issue as @bolausson :
|
@Sh4d1 I found that the fix mentioned in #2172 fixed this issue for me:
|
@DrMacinyasha I guess it's two different issues, one when trying to access the pi hole server, the second when trying to access a website. The PR #2388 fixes the server access :) |
I have configure the lighttpd / pihole for tcp port 81 after the install, So please make this string more dynamic in the next pihole versions - thanks. The setup script should ask/check the lighttpd port and set the correct vars in the scripts... |
@rolsch did you managed to fix it? If so, how did you fix? I'm experiencing the same error after reconfiguring to http_port <> 80. |
Manually :-) |
Also note that I run Nginx on port 443 (using Let's Encrypt) together with a domain name. So uhh.. this should be config depended. |
Please open a new issue. |
I, too, was getting this error message instead of the splash page on nginx, and fixed it by adding the |
Hey guys. We also got a report about this issue posted by OP and I am trying to replicate but can't. Tested on Lighttpd I could not identify any clear steps to replicate yet, besides the above. Also I am not quite sure what the FQDN parameter actually does, overriding somehow a check whether the request is coming from a FQDN or not? If so this doesn't sound like a reasonable "fix" at all. Instead of overriding parameters I suggest to handle the given ones as desired. But yeah, I do not really understand the issue here, so far 😉. If I can help with whatever testing, my machines are ready and can be configured with any webserver. Just need to know how to force the error in the first place. @rolsch |
I've just encountered this issue. My setup:
After visiting Is this an issue with my setup, or is it a pihole issue? |
docker exec -it bash apt-get update nano /var/www/html/pihole/index.php change Ctrl+X to save reload web page |
@teredactle my solution works because the docker instance SERVER_ADDR is 127.0.0.1 same as the local host computer |
See pi-hole#2195 (comment) for explanation
This issue can occur in two ways:
In my case I have a reverse proxy so I wanted to use port 80 and lighttpd on another port. There are a few changes in The other issue is this condition with the hard-coded host I saw somewhere that this blocking page will disappear (correct me if I'm wrong) so this might not be a problem anymore. |
TL;DR: Solution: Fix permissions of Kept For Reference Only: This happened when deploying pihole on a machine using
in Replacing
by
in cheers |
… and/or hostname. See issues pi-hole#2195 and pi-hole#2720. Signed-off-by: Matthias Schoettle <git@mattsch.com>
I can confirm that @unitpas simple fix works for me on a raspberry pi. |
… and/or hostname. See issues pi-hole#2195 and pi-hole#2720. Signed-off-by: Matthias Schoettle <git@mattsch.com>
Thank you for this! I had the same problem where I was getting the error when trying to connect to the pihole admin page via a different external port that's forwarded to port 80 of the pihole IP. Just changing the URL to the above works without having to edit any pihole configuration files. |
As per pi-hole/docker-pi-hole#224 (comment)
and pi.hole is in your docker host /etc/hosts like: then you need this as the docker container environment variable: where 8180 is the docker exposed port. |
This issue has been mentioned on Pi-hole Userspace. There might be relevant details there: |
This issue gets stickier when you've:
I started poking when I got the following log entry in my apache log whean I loaded https://pihole.mydomain.com/pihole/index.php
Replacing the static The issue isn't so much with the "/var/www/dns/" as it is with the "pihole/pihole/blockingpage.css'. Changing line 267 of pihole/index.php to I'm thinking .... this might be an unsupported use case : ) |
Problem is still persistant... the Problem is, that some browsers like Firefox give errorpages in the Beta for using HTTP (Like the warn for unsigned SSL) |
Probably it's better to query the database directly instead of doing an API request, which should also be faster: https://github.com/pi-hole/pi-hole/blob/8660459/advanced/index.php#L167-L172 But as far as I can think of now, the browser or proxy shouldn't play a role here as the request is done by the PHP server and not the browser, isn't it? 🤔 For the issue with the blockingpage.css you mean this line? |
@MichaIng First Problem here is: So, little hacketty spaghetti and the nginx Proxy simulates "http" request to hostname "[ip of container]" |
This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days. |
I still hit the issue at the latest docker image. |
@Lukas1818 Please open a new issue at https://github.com/pi-hole/docker-pi-hole |
In raising this issue, I confirm the following:
{please fill the checkboxes, e.g: [X]}
How familiar are you with the the source code relevant to this issue?:
7
Expected behaviour:
"Website blocked" page
Actual behaviour:
[ERROR]: Unable to parse results from queryads.php: Unhandled error message ()
Steps to reproduce:
Goto blocked/blacklisted domain. For me the error is caused by having lighttpd listening (
server.bind) on a specific network interface alias, not localhost.
Debug token provided by uploading
pihole -d
log:N/A
Troubleshooting undertaken, and/or other relevant information:
Saw this already mentioned by @Amunak in issue #2172. Actually diff problem than @KnightTim, so created new issue:
pi-hole/advanced/index.php
Line 133 in fbee18e
It's fixed by replacing 127.0.0.1 with the IP of that interfaces or using
$_SERVER['SERVER_ADDR']
var like @Amunak said:$serverAddr = htmlspecialchars($_SERVER['SERVER_ADDR']);
$queryAds = file("http://$serverAddr/admin/scripts/pi-hole/php/queryads.php?domain=$serverName&bp", FILE_IGNORE_NEW_LINES);
To be 100% safe perhaps add a check if that var doesn't exist to use http://pi.hole/admin/scripts/pi-hole/php/queryads.php instead
The text was updated successfully, but these errors were encountered: