Read the statement by Michael Teeuw here.
MMM-homeassistant-sensors certificate expired
-
A few weeks ago, my MM showed “Error fetching stats.” where my MMM-homeassistant-sensors module is usually displayed. It has been working for just over a year.
I turned debug logging on and restarted MM. The following error was logged:
[2021-10-07 21:00:37.634] [LOG] Starting MagicMirror: v2.13.0 [2021-10-07 21:00:37.642] [LOG] Loading config ... [2021-10-07 21:00:37.646] [LOG] Loading module helpers ... [2021-10-07 21:00:37.987] [LOG] Initializing new module helper ... [2021-10-07 21:00:37.988] [LOG] Module helper loaded: MMM-homeassistant-sensors [2021-10-07 21:00:37.988] [LOG] All module helpers loaded. [2021-10-07 21:00:38.123] [LOG] Starting server on port 8080 ... [2021-10-07 21:00:38.137] [LOG] Server started ... [2021-10-07 21:00:38.138] [LOG] Connecting socket for: MMM-homeassistant-sensors [2021-10-07 21:00:38.139] [LOG] Sockets connected & modules started ... [2021-10-07 21:00:38.246] [LOG] Launching application. [2021-10-07 21:00:40.393] [ERROR] MMM-homeassistant-sensors - buildUrl: https://XXXXXXXXXXX.duckdns.org:443/api/states [2021-10-07 21:00:40.395] [ERROR] MMM-homeassistant-sensors: Adding token XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [2021-10-07 21:00:40.559] [ERROR] MMM-homeassistant-sensors ERROR: Error: certificate has expired at TLSSocket.onConnectSecure (_tls_wrap.js:1317:34) at TLSSocket.emit (events.js:200:13) at TLSSocket._finishInit (_tls_wrap.js:792:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:606:12) { code: 'CERT_HAS_EXPIRED' } [2021-10-07 21:00:40.569] [ERROR] Whoops! There was an uncaught exception... [2021-10-07 21:00:40.570] [ERROR] TypeError: Cannot read property 'statusCode' of undefined at Request._callback (/home/pi/MagicMirror/modules/MMM-homeassistant-sensors/node_helper.js:22:77) at self.callback (/home/pi/MagicMirror/node_modules/request/request.js:185:22) at Request.emit (events.js:200:13) at Request.onRequestError (/home/pi/MagicMirror/node_modules/request/request.js:877:8) at ClientRequest.emit (events.js:200:13) at TLSSocket.socketErrorListener (_http_client.js:402:9) at TLSSocket.emit (events.js:200:13) at emitErrorNT (internal/streams/destroy.js:91:8) at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) at processTicksAndRejections (internal/process/task_queues.js:84:9) [2021-10-07 21:00:40.573] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? [2021-10-07 21:00:40.574] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues [2021-10-07 21:00:46.509] [LOG] Shutting down server... [2021-10-07 21:00:46.510] [LOG] Stopping module helper: MMM-homeassistant-sensors
I checked to make sure that the host configured was resolvable from the MM Pi. That was fine.
I then opened the Chromium browser on the Pi and navigated to https://XXXXXXXXX.duckdns.org/ which worked fine. I click on the lock and the pop up said “Connection is secure” and that the certificate is valid.
I did this on another computer just to be sure and had the same results.
I removed all other modules from my config.js and only left one switch configured for MMM-homeassistant-sensors and restarted just to be sure there wasn’t something weird in the config.js. Problem is still there.
I checked the DuckDNS AddOn and updated to the latest and restarted it. The problem persisted. I restarted HA just in case. Still the same problem.
I installed the Cert Expiry AddOn just in case and it says the cert will expire in 13 weeks. Maybe silly, but I checked the date time stamp on the MM Pi just to be sure. It was correct too.
I can only assume that the error that is thrown from the module is referring to the HA URL, correct? If that’s true, that cert seems totally fine.
Any suggestions for what else to try?
-
@drwatson there was an expired certificate authority certificate. and a bug in electron.
fixed in 2.17.1 just released last week.
-
@sdetweil Thank you very much! That was it. I updated MMM to do it. There were some missing modules after I did that, but I installed those and everything came up aces!
Thanks again for your help. I never would have known about that electron bug.