hycken / homebridge-fujitsu-hvac

Homebridge plugin for devices compatible with the FGLAir app.
MIT License
2 stars 0 forks source link

error in HVC plugin causing sigterm and restart of homebridge #8

Open kaduffey opened 1 year ago

kaduffey commented 1 year ago

Four times in last 24hrs - here is last two occurences

[3/26/2023, 6:20:33 PM] [Paulson Garage] myQ API: Discovered device family gateway: Paulson Garage two (serial number: GW330000D8AB). [3/26/2023, 9:05:57 PM] [Fujitsu AC] Unexpected end of JSON input [3/27/2023, 1:10:38 AM] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days... [3/27/2023, 2:42:57 AM] [Homebridge UI] Running scheduled instance backup... [3/27/2023, 2:42:57 AM] [Homebridge UI] Creating temporary backup archive at /tmp/homebridge-backup-zWMPAP/homebridge-backup-0E4A1E3424E2.tar.gz [3/27/2023, 3:37:48 AM] TypeError: Cannot read properties of undefined (reading 'info') at FujitsuHVACPlatformAccessory.reload (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/platform.js:59:18) at FujitsuHVACPlatformAccessory.errorHandler (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/platformAccessory.js:287:14) at Timeout. (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/api/localServer.js:84:22) at processTicksAndRejections (node:internal/process/task_queues:95:5) [3/27/2023, 3:37:48 AM] Got SIGTERM, shutting down Homebridge... [3/27/2023, 3:37:53 AM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [3/27/2023, 3:37:58 AM] [HB Supervisor] Restarting Homebridge... [3/27/2023, 3:37:58 AM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution [3/27/2023, 3:37:58 AM] [HB Supervisor] Started Homebridge v1.6.0 with PID: 9910 [3/27/2023, 3:38:03 AM] Loaded config.json with 1 accessories and 4 platforms. [3/27/2023, 3:38:03 AM] Loaded 4 cached accessories from cachedAccessories. [3/27/2023, 3:38:03 AM] --- [3/27/2023, 3:38:04 AM] Loaded plugin: homebridge-flume@3.0.2 [3/27/2023, 3:38:04 AM] Registering platform 'homebridge-flume.Flume' [3/27/2023, 3:38:04 AM] --- [3/27/2023, 3:38:04 AM] Loaded plugin: homebridge-fujitsu-hvac@1.1.0 [3/27/2023, 3:38:04 AM] Registering platform 'homebridge-fujitsu-hvac.FujitsuHVAC' [3/27/2023, 3:38:04 AM] --- [3/27/2023, 3:38:04 AM] Loaded plugin: homebridge-log-cleaner@0.0.2 [3/27/2023, 3:38:04 AM] Registering accessory 'homebridge-log-cleaner.HomebridgeLogCleaner' [3/27/2023, 3:38:04 AM] --- [3/27/2023, 3:38:06 AM] Loaded plugin: homebridge-myq@2.9.0 [3/27/2023, 3:38:06 AM] Registering platform 'homebridge-myq.myQ' [3/27/2023, 3:38:06 AM] --- [3/27/2023, 3:38:06 AM] Loading 4 platforms... [3/27/2023, 3:38:06 AM] [Paulson Garage] Initializing myQ platform... [3/27/2023, 3:38:06 AM] [Flume] Initializing Flume platform... [3/27/2023, 3:38:06 AM] [Flume] Initialising plugin v3.0.2 | System linux | Node v18.15.0 | HB v1.6.0 | HAPNodeJS v0.11.0... [3/27/2023, 3:38:06 AM] [Fujitsu AC] Initializing FujitsuHVAC platform... [3/27/2023, 3:38:06 AM] Loading 1 accessories... [3/27/2023, 3:38:06 AM] [Log cleaner] Initializing HomebridgeLogCleaner accessory... [3/27/2023, 3:38:06 AM] [Fujitsu AC] Loading accessory from cache: Downstairs [3/27/2023, 3:38:06 AM] [Fujitsu AC] Loading accessory from cache: Upstairs [3/27/2023, 3:38:06 AM] [Flume] Plugin initialised. Setting up accessories.... Setup Payload: X-HM://00245TPUS0A72 Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ 418-11-236 │     
└────────────┘     

[3/27/2023, 3:38:07 AM] Homebridge v1.6.0 (HAP v0.11.0) (Homebridge 24E2) is running on port 51368. [3/27/2023, 3:38:08 AM] [Flume] [Flume] initialised with id [6805721315408465078]. [3/27/2023, 3:38:08 AM] [Flume] ✓ Setup complete. Want to see this plugin in your own language? Let me know! [3/27/2023, 3:38:10 AM] [Paulson Garage] myQ API: Successfully connected to the myQ API. [3/27/2023, 3:38:10 AM] [Paulson Garage] myQ API: Discovered device family garagedoor: Paulson Garage two (serial number: CG080089D9C7, gateway: GW330000D8AB). [3/27/2023, 3:38:10 AM] [Paulson Garage] myQ API: Discovered device family gateway: Paulson Garage two (serial number: GW330000D8AB). [3/27/2023, 5:14:27 AM] TypeError: Cannot read properties of undefined (reading 'info') at FujitsuHVACPlatformAccessory.reload (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/platform.js:59:18) at FujitsuHVACPlatformAccessory.errorHandler (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/platformAccessory.js:287:14) at Timeout. (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/api/localServer.js:84:22) at processTicksAndRejections (node:internal/process/task_queues:95:5) [3/27/2023, 5:14:27 AM] TypeError: Cannot read properties of undefined (reading 'info') at FujitsuHVACPlatformAccessory.reload (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/platform.js:59:18) at FujitsuHVACPlatformAccessory.errorHandler (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/platformAccessory.js:287:14) at Timeout. (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/api/localServer.js:84:22) at processTicksAndRejections (node:internal/process/task_queues:95:5) [3/27/2023, 5:14:27 AM] Got SIGTERM, shutting down Homebridge... [3/27/2023, 5:14:32 AM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [3/27/2023, 5:14:37 AM] [HB Supervisor] Restarting Homebridge... [3/27/2023, 5:14:37 AM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution [3/27/2023, 5:14:37 AM] [HB Supervisor] Started Homebridge v1.6.0 with PID: 10093 [3/27/2023, 5:14:42 AM] Loaded config.json with 1 accessories and 4 platforms. [3/27/2023, 5:14:42 AM] Loaded 4 cached accessories from cachedAccessories. [3/27/2023, 5:14:42 AM] --- [3/27/2023, 5:14:44 AM] Loaded plugin: homebridge-flume@3.0.2 [3/27/2023, 5:14:44 AM] Registering platform 'homebridge-flume.Flume' [3/27/2023, 5:14:44 AM] --- [3/27/2023, 5:14:44 AM] Loaded plugin: homebridge-fujitsu-hvac@1.1.0 [3/27/2023, 5:14:44 AM] Registering platform 'homebridge-fujitsu-hvac.FujitsuHVAC' [3/27/2023, 5:14:44 AM] --- [3/27/2023, 5:14:44 AM] Loaded plugin: homebridge-log-cleaner@0.0.2 [3/27/2023, 5:14:44 AM] Registering accessory 'homebridge-log-cleaner.HomebridgeLogCleaner' [3/27/2023, 5:14:44 AM] --- [3/27/2023, 5:14:45 AM] Loaded plugin: homebridge-myq@2.9.0 [3/27/2023, 5:14:45 AM] Registering platform 'homebridge-myq.myQ' [3/27/2023, 5:14:45 AM] --- [3/27/2023, 5:14:45 AM] Loading 4 platforms... [3/27/2023, 5:14:45 AM] [Paulson Garage] Initializing myQ platform... [3/27/2023, 5:14:45 AM] [Flume] Initializing Flume platform... [3/27/2023, 5:14:45 AM] [Flume] Initialising plugin v3.0.2 | System linux | Node v18.15.0 | HB v1.6.0 | HAPNodeJS v0.11.0... [3/27/2023, 5:14:45 AM] [Fujitsu AC] Initializing FujitsuHVAC platform... [3/27/2023, 5:14:45 AM] Loading 1 accessories... [3/27/2023, 5:14:45 AM] [Log cleaner] Initializing HomebridgeLogCleaner accessory... [3/27/2023, 5:14:45 AM] [Fujitsu AC] Loading accessory from cache: Downstairs [3/27/2023, 5:14:45 AM] [Fujitsu AC] Loading accessory from cache: Upstairs [3/27/2023, 5:14:45 AM] [Flume] Plugin initialised. Setting up accessories.... Setup Payload:

hycken commented 1 year ago

Thanks. I'll try to get a fix up today.

hycken commented 1 year ago

This should be fixed in v1.1.1. Thanks for reporting.

kaduffey commented 1 year ago

I've installed and will watch - if I dont reach out in 24hrs please close. Fantastic response - thank you very much.

kaduffey commented 1 year ago

last night I got these errors non-stop (didnt notice until this morning) - nothing else changed on homebridge, no plugin updates but yours in 2 weeks. There was so many the log FIFO'd the logs and it only goes back 2 hours

Could this be yours? Happy to help with logs or changes if you need it. Offhand I saw this type of errors on older servers at teh office that was using sub v1.2 TLS - we should be running only TLS3 I think now

[3/29/2023, 5:23:02 AM] Error: socket hang up at connResetException (node:internal/errors:717:14) at TLSSocket.socketOnEnd (node:_http_client:526:23) at TLSSocket.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at processTicksAndRejections (node:internal/process/task_queues:82:21) [3/29/2023, 5:23:02 AM] Error: socket hang up at connResetException (node:internal/errors:717:14) at TLSSocket.socketOnEnd (node:_http_client:526:23) at TLSSocket.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at processTicksAndRejections (node:internal/process/task_queues:82:21) [3/29/2023, 5:23:02 AM] Error: socket hang up at connResetException (node:internal/errors:717:14) at TLSSocket.socketOnEnd (node:_http_client:526:23) at TLSSocket.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at processTicksAndRejections (node:internal/process/task_queues:82:21) [3/29/2023, 5:23:02 AM] Error: socket hang up at connResetException (node:internal/errors:717:14) at TLSSocket.socketOnEnd (node:_http_client:526:23) at TLSSocket.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at processTicksAndRejections (node:internal/process/task_queues:82:21) [3/29/2023, 5:23:04 AM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [3/29/2023, 5:23:09 AM] [HB Supervisor] Restarting Homebridge... [3/29/2023, 5:23:09 AM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution [3/29/2023, 5:23:09 AM] [HB Supervisor] Started Homebridge v1.6.0 with PID: 17174

kaduffey commented 1 year ago

Now seeing as Carnego does

[3/29/2023, 3:30:41 PM] [Fujitsu AC] Unexpected end of JSON input [3/29/2023, 3:48:39 PM] [Fujitsu AC] Lost connection to accessory. Rediscovering...

quentinjourdan commented 1 year ago

Hello @hycken, I’ve been experiencing the same issue in V1.1.1 :

[31/03/2023 01:10:43] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days... [31/03/2023 03:55:28] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:28] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:31] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:31] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:34] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:34] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:37] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:37] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:40] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:40] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:43] [Fujitsu AC] Lost connection to accessory. Rediscovering... [31/03/2023 03:55:43] [Fujitsu AC] Lost connection to accessory. Rediscovering... TypeError: devices.filter is not a function at FGLAir.getDevices (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/api/fglair.js:109:14) at processTicksAndRejections (node:internal/process/task_queues:95:5) at FujitsuHVACPlatform.discoverDevices (file:///var/lib/homebridge/node_modules/homebridge-fujitsu-hvac/dist/platform.js:34:25) [31/03/2023 03:55:43] [Fujitsu AC] Child bridge process ended [31/03/2023 03:55:43] [Fujitsu AC] Process Ended. Code: 1, Signal: null [31/03/2023 03:55:50] [Fujitsu AC] Restarting Process... [31/03/2023 03:55:52] [Fujitsu AC] Launched child bridge with PID 800 [31/03/2023 03:55:52] Registering platform 'homebridge-fujitsu-hvac.FujitsuHVAC' [31/03/2023 03:55:52] [Fujitsu AC] Loaded homebridge-fujitsu-hvac v1.1.1 child bridge successfully [31/03/2023 03:55:52] Loaded 1 cached accessories from cachedAccessories.0E74CE1C20F2. [31/03/2023 03:55:52] [Fujitsu AC] Loading accessory from cache: Chauffage - Clim [31/03/2023 03:55:52] Homebridge v1.6.0 (HAP v0.11.0) (Fujitsu AC) is running on port 35118. [31/03/2023 03:55:56] [Fujitsu AC] Unexpected end of JSON input [31/03/2023 06:20:51] [Homebridge UI] Running scheduled instance backup... [31/03/2023 06:20:51] [Homebridge UI] Creating temporary backup archive at /tmp/homebridge-backup-kGOZew/homebridge-backup-0EC7B6056B98.tar.gz

hycken commented 1 year ago

Unsure what is causing this, but it could be that the web service doesn't like the frequent requests. I'll try adding some throttling to see if that helps.

hycken commented 1 year ago

I have added some throttling so it only reconnects after 5 minutes and also changed "Lost connection..." to be a debug message rather than info so you have to enable debug mode in Homebridge to see them.

kaduffey commented 1 year ago

Thanks

I've installed it and will watch it. I got the 'Error: Socket Hang Up' twice last night that flooded my logs and crashed HB - so this is welcome

On Sun, Apr 2, 2023 at 8:51 PM Daniel Hyckenberg @.***> wrote:

I have added some throttling so it only reconnects after 5 minutes and also changed "Lost connection..." to be a debug message rather than info so you have to enable debug mode in Homebridge to see them.

— Reply to this email directly, view it on GitHub https://github.com/hycken/homebridge-fujitsu-hvac/issues/8#issuecomment-1493601360, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6RBTCRPHTRXDAMU5ILXZGTW7JCKRANCNFSM6AAAAAAWJK26OM . You are receiving this because you authored the thread.Message ID: @.***>

kaduffey commented 1 year ago

I still see this about every 4 hours. [4/3/2023, 5:10:57 PM] [Fujitsu AC] Unexpected end of JSON input Im on a dual zoned (Two thermostat) system, not grouped.

hycken commented 1 year ago

I'm looking into it but I'm only getting one error per day or two so it's a bit slow to debug.

kaduffey commented 1 year ago

Happy to help where I can as a end [L]user

On Thu, Apr 6, 2023 at 1:52 PM Daniel Hyckenberg @.***> wrote:

I'm looking into it but I'm only getting one error per day or two so it's a bit slow to debug.

— Reply to this email directly, view it on GitHub https://github.com/hycken/homebridge-fujitsu-hvac/issues/8#issuecomment-1499610687, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6RBTCW5GCBUQVQ4EOBTHRDW74UHPANCNFSM6AAAAAAWJK26OM . You are receiving this because you authored the thread.Message ID: @.***>

kaduffey commented 1 year ago

Ok, so 3 times in last week the last entry is the "[Fujitsu AC] Unexpected end of JSON input" error then my HB instance just freezes and is unavailable to access. Should I put this plugin into a child bridge? I dont want to lose the ability to view status without opening the FGLAIR app

If you want to give me a version that has debug on for your plugin, I'll load it for a day and provide the logs

kaduffey commented 1 year ago

I tried child bridge too. My HB Instance just stops after a couple hours and only a power cycle recovers it. I uninstalled fujitsu plugin then did a factory image reload and put the other plugins back in and its been up for 9 days now. I think whatever you relegated to info error might have been more than just too many retries. It also could have been a corrupted HB service I suppose.

hycken commented 1 year ago

I'm so sorry. I've been struggling to find time to look at this. This weekend I implemented something that seems to be working, but it takes forever to test. I'll try to get a new version out today.

kaduffey commented 1 year ago

No reason to apologize. Im ok with FGLAIR app until this is tuned. Thanks for your dedication

On Tue, May 9, 2023 at 8:03 AM Daniel Hyckenberg @.***> wrote:

I'm so sorry. I've been struggling to find time to look at this. This weekend I implemented something that seems to be working, but it takes forever to test. I'll try to get a new version out today.

— Reply to this email directly, view it on GitHub https://github.com/hycken/homebridge-fujitsu-hvac/issues/8#issuecomment-1540322079, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6RBTCQQRUVBGYDUVHYZ2XDXFJMENANCNFSM6AAAAAAWJK26OM . You are receiving this because you authored the thread.Message ID: @.***>

hycken commented 1 year ago

Please let me know how 1.3.1 works for you. Had to do one more test and didn't have an error for over 24h. :)

kaduffey commented 1 year ago

Should I run it in a child bridge?

hycken commented 1 year ago

You shouldn't have to. I do but mainly so I can restart just the plug-in separately while making changes. It may protect the rest of your home bridge I my plug-in crashes.

kaduffey commented 1 year ago

Thanks, installed to a child bridge. I'll check the logs periodically or report any issues. I've been on the new install of Homebridge and other plugins now for 9 days stably.

Here is the startup log, note the two info errors: [5/10/2023, 9:53:20 PM] [Fujitsu AC] Launched child bridge with PID 8811 [5/10/2023, 9:53:21 PM] [Homebridge UI] Terminal session ended. [5/10/2023, 9:53:21 PM] Registering platform 'homebridge-fujitsu-hvac.FujitsuHVAC' [5/10/2023, 9:53:21 PM] [Fujitsu AC] Loaded homebridge-fujitsu-hvac v1.3.1 child bridge successfully [5/10/2023, 9:53:22 PM] Homebridge v1.6.1 (HAP v0.11.1) (Fujitsu AC) is running on port 56107. [Downstairs@@On] Characteristic not in required or optional characteristic section for service Thermostat. Adding anyway. [Upstairs@@On] Characteristic not in required or optional characteristic section for service Thermostat. Adding anyway.

kaduffey commented 1 year ago

3 days and no issues or errors (just the install inform message above). Let's check for a week and if clear I will close this issue. Thanks for your diligence.

hycken commented 1 year ago

Nice! Good to hear. Thanks for the update.