Closed joecarpita closed 1 year ago
Hi @joecarpita, from the logs you attached it seems that the plugin gets a 403 (Forbidden) status code when making the get status request, did you change any of your Pi-hole configuration recently?
Pardon the delay in replying – I don't believe any changes were made to the pi-hole configuration. Can you think of any changes that may have happened that might be causing it. Also, for context, Pi-hole & Homebridge are running on the same device.
Finally troubleshooting this a bit again (this pi-hole is located at a relative's house) – it seemed like changing the plugin configuration host from its default of localhost to the IP address of the pi-hole has solved the issue (even though both pi-hole & homebridage are running on the same device).
I am not sure if this is desired behavior, but I'm going to close with this comment.
Describe the bug Recently started experiencing odd behavior with pihole plugin.
Toggling the switch in iOS home app would appear to turn the pihole off, but there would be no indication it would turn back on via home app.
Checking the webUI of pihole, the plugin appears to be working (e.g. turning off would disable pihole, which would automatically restart after 120 second interval; but home app wouldn't reflect this).
Checking the homebridge web UI I revealed a problem with the plugin. On homebridge boot, I receive the following error with the homebridge-pihole plugin:
`[12/30/2022, 10:37:36 PM] [Pihole] Error: Request failed with status code 403 at createError (/usr/lib/node_modules/homebridge-pihole/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/lib/node_modules/homebridge-pihole/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/lib/node_modules/homebridge-pihole/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at processTicksAndRejections (node:internal/process/task_queues:82:21) { config: { url: 'api.php', method: 'get', headers: { Accept: 'application/json, text/plain, /', 'User-Agent': 'axios/0.21.4' }, params: { status: 1, auth: '54a6673c814b32309806ff1067ede0155de1af6c0550d6ce51d6f62ba76e4101' }, baseURL: 'http://localhost:80/admin/', transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, adapter: [Function: httpAdapter], responseType: 'json', xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, httpsAgent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype] {}, freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 0, maxCachedSessions: 100, _sessionCache: [Object],
}, request: <ref 1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular 1],
}, response: { status: 403, statusText: 'Forbidden', headers: { 'content-type': 'text/html', 'x-pi-hole': 'The Pi-hole Web interface is working!', 'x-frame-options': 'DENY', 'content-length': '341', connection: 'close', date: 'Sat, 31 Dec 2022 04:37:36 GMT', server: 'lighttpd/1.4.53' }, config: { url: 'api.php', method: 'get', headers: [Object], params: [Object], baseURL: 'http://localhost:80/admin/', transformRequest: [Array], transformResponse: [Array], timeout: 0, adapter: [Function: httpAdapter], responseType: 'json', xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, httpsAgent: [Agent], validateStatus: [Function: validateStatus], transitional: [Object], data: undefined }, request: <ref 1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: [Socket], _header: 'GET /admin/api.php?status=1&auth=54a6673c814b32309806ff1067ede0155de1af6c0550d6ce51d6f62ba76e4101 HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /*\r\n' + 'User-Agent: axios/0.21.4\r\n' + 'Host: localhost\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/admin/api.php?status=1&auth=54a6673c814b32309806ff1067ede0155de1af6c0550d6ce51d6f62ba76e4101', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', protocol: 'http:', _redirectable: [Writable],
}, isAxiosError: true, toJSON: [Function: toJSON] }`
Additional context I've tried removing the homebridge-pihole plugin and re-installing, but no dice.
All software is up to date. DietPi OS - v8.12.1 Homebridge - v1.6.0 homebridge-pihole - v0.4.2 NPM - v9.2.0 Node JS - v18.12.1 Pihole - v5.14.2, FTL - v5.20, Web Interface v5.18