Pi-hole Web Request failure


#1

1) Give a description of the problem
Webcore does not appear to be sending the web request to my pi-hole on my local network.

2) What is the expected behavior?
I expect Webcore to send a post request to my local pi-hole to use the API to disable it for 60 minutes.

3) What is happening/not happening?
The console reports everything is running, but Pi-hole is not changing its status. If I copy and paste the same link in Firefox the request is successful.

4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)
( 9/24/2018, 2:54:23 PM +46ms
+0ms â•”Received event [Home].time = 1537826064021 with a delay of -976ms
+60ms â•‘RunTime Analysis CS > 14ms > PS > 31ms > PE > 15ms > CE
+62ms â•‘Runtime (39554 bytes) successfully initialized in 31ms (v0.3.108.20180906) (61ms)
+64ms â•‘â•”Execution stage started
+65ms ║╚Execution stage complete. (1ms)
+66ms ╚Event processed successfully (66ms)
9/24/2018, 2:54:04 PM +581ms
+0ms â•”Received event [Home].wc_async_reply = httpRequest with a delay of 0ms
+71ms â•‘RunTime Analysis CS > 27ms > PS > 26ms > PE > 18ms > CE
+73ms â•‘Runtime (39559 bytes) successfully initialized in 26ms (v0.3.108.20180906) (72ms)
+74ms â•‘â•”Execution stage started
+96ms â•‘â•‘Pi Hole Disabled for 30 minutes
+97ms â•‘â•‘Executed virtual command [Pi Hole].log (1ms)
+100ms ║╚Execution stage complete. (25ms)
+101ms ╚Event processed successfully (101ms)
9/24/2018, 2:54:03 PM +931ms
+1ms â•”Received event [Pi Hole].switch = off with a delay of 44ms
+51ms â•‘RunTime Analysis CS > 12ms > PS > 25ms > PE > 13ms > CE
+53ms â•‘Runtime (39541 bytes) successfully initialized in 25ms (v0.3.108.20180906) (51ms)
+54ms â•‘â•”Execution stage started
+65ms â•‘â•‘Comparison (enum) off is (string) on = false (2ms)
+67ms ║║Cancelling condition #2’s schedules…
+68ms â•‘â•‘Condition #2 evaluated false (8ms)
+70ms ║║Cancelling condition #1’s schedules…
+71ms â•‘â•‘Condition group #1 evaluated false (state changed) (12ms)
+74ms ║║Cancelling statement #9’s schedules…
+85ms â•‘â•‘Sending internal web request to: 10.0.0.250/admin/api.php?disable=1800&auth=c811e37cfb5aff0159cbb42d9f2d77e57b9151c6574a3a34436a1dc78dc1f2d7
+88ms â•‘â•‘Executed virtual command [Pi Hole].httpRequest (3ms)
+89ms â•‘â•‘Requesting a wake up for Mon, Sep 24 2018 @ 2:54:24 PM PDT (in 20.0s)
+95ms ║╚Execution stage complete. (41ms)
+97ms â•‘Setting up scheduled job for Mon, Sep 24 2018 @ 2:54:24 PM PDT (in 19.994s)
+109ms ╚Event processed successfully (109ms)
9/24/2018, 2:53:48 PM +482ms
+1ms â•”Received event [Home].wc_async_reply = httpRequest with a delay of 0ms
+73ms â•‘RunTime Analysis CS > 29ms > PS > 28ms > PE > 15ms > CE
+75ms â•‘Runtime (39553 bytes) successfully initialized in 28ms (v0.3.108.20180906) (74ms)
+76ms â•‘â•”Execution stage started
+95ms â•‘â•‘Pi Hole Enabled
+96ms â•‘â•‘Executed virtual command [Pi Hole].log (1ms)
+99ms ║╚Execution stage complete. (22ms)
+100ms ╚Event processed successfully (100ms)
9/24/2018, 2:53:48 PM +159ms
+2ms â•”Received event [Pi Hole].switch = on with a delay of 58ms
+75ms â•‘RunTime Analysis CS > 17ms > PS > 38ms > PE > 21ms > CE
+78ms â•‘Runtime (39546 bytes) successfully initialized in 38ms (v0.3.108.20180906) (75ms)
+79ms â•‘â•”Execution stage started
+91ms â•‘â•‘Comparison (enum) on is (string) on = true (2ms)
+93ms ║║Cancelling condition #2’s schedules…
+94ms â•‘â•‘Condition #2 evaluated true (9ms)
+95ms ║║Cancelling condition #1’s schedules…
+97ms â•‘â•‘Condition group #1 evaluated true (state changed) (11ms)
+100ms ║║Cancelling statement #5’s schedules…
+112ms â•‘â•‘Sending internal web request to: 10.0.0.250/admin/api.php?enable&auth=c811e37cfb5aff0159cbb42d9f2d77e57b9151c6574a3a34436a1dc78dc1f2d7
+116ms â•‘â•‘Executed virtual command [Pi Hole].httpRequest (4ms)
+117ms â•‘â•‘Requesting a wake up for Mon, Sep 24 2018 @ 2:54:08 PM PDT (in 20.0s)
+124ms ║╚Execution stage complete. (45ms)
+126ms â•‘Setting up scheduled job for Mon, Sep 24 2018 @ 2:54:08 PM PDT (in 19.993s)
+173ms ╚Event processed successfully (173ms))


#2

What do you get when you log $httpStatusCode after the web call?


#3

411

That is awesome! The more I use Webcore the more I’m impressed with it.

Adding “Content-Length: 0” to the Request body resolved the issue!


#4

Your post reminded me that I’ve been wanting to try pi-hole for a while now and so I did set it up yesterday… one night and half the queries in my network are blocked!

My question is why do you want to turn it off sometimes?


#5

I’ve been running a dedicated pi-hole server for about a year now. The reason why you might want to turn it off versus adding domains to the whitelist is for times when you have to work with blocked sites.

For instance, in mine, I have Google Analytics completely blocked, but my job requires me to pull reports and such from GA, so, when I’m pulling reports, I turn pi-hole off for a period rather than whitelisting GA.