seydx / homebridge-fritz-platform

AiO Homebridge dynamic platform plugin for AVM hardware like Fritz!Box, Fritz!Repeater etc.
MIT License
223 stars 32 forks source link

Error: The `onCancel` handler was attached after the promise settled. #257

Open Gadagadanagadanagana opened 2 years ago

Gadagadanagadanagana commented 2 years ago

Dear all,

I have migrated my Homebridge instance from my Raspberry PI to my Mac Mini M1. Now when configuring Fritz Platform, I alway run into the error "The onCancel handler was attached after the promise settled.". Please find my configuration below. Thanks for any hints to resolve this issue.

macOS Monterey Node v16.13.1 NPM v8.3.0

{ "name": "Fritzbox Platform", "debug": true, "warn": false, "error": false, "extendedError": true, "devices": [ { "active": true, "name": "MK", "host": "192.168.178.1", "username": "abc", "password": "xyz", "ssl": true, "tr064": true, "igd": false, "model": "7530", "serialNumber": "1234567", "wifiUnits": 2, "master": true, "readOnly": false, "hide": true, "connection": "dsl", "options": { "wifi_2ghz": "switch", "wifi_5ghz": "switch", "wifi_guest": "switch", "wps": "characteristic", "dect": "switch", "aw": "characteristic", "deflection": "switch", "led": "switch", "lock": "switch", "broadband": "characteristic", "reconnect": "switch" } } ], "options": { "polling": { "timer": 15 } }, "platform": "FritzPlatform" },

pabloscloud commented 2 years ago

I have the same problem:

Node.js Version v16.13.2 Npm Version v8.1.2

It happens to me when I activate the FRITZ!Repeater 600 in my config.

[1/30/2022, 4:34:33 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules [1/30/2022, 4:34:34 PM] [HB Supervisor] Started Homebridge v1.4.0 with PID: 2022 [1/30/2022, 4:34:35 PM] Loaded config.json with 0 accessories and 3 platforms. [1/30/2022, 4:34:35 PM] Loaded 6 cached accessories from cachedAccessories. [1/30/2022, 4:34:35 PM] --- [1/30/2022, 4:34:36 PM] Loaded plugin: homebridge-dummy@0.5.0 [1/30/2022, 4:34:36 PM] Registering accessory 'homebridge-dummy.DummySwitch' [1/30/2022, 4:34:36 PM] --- [1/30/2022, 4:34:36 PM] Loaded plugin: homebridge-fritz-platform@6.0.19 [1/30/2022, 4:34:37 PM] Registering platform 'homebridge-fritz-platform.FritzPlatform' [1/30/2022, 4:34:37 PM] --- [1/30/2022, 4:34:37 PM] Loaded plugin: homebridge-config-ui-x@4.42.0 [1/30/2022, 4:34:37 PM] Registering platform 'homebridge-config-ui-x.config' [1/30/2022, 4:34:37 PM] --- [1/30/2022, 4:34:37 PM] Loading 3 platforms... [1/30/2022, 4:34:37 PM] [Config] Initializing config platform... [1/30/2022, 4:34:37 PM] [Config] Running in Service Mode [1/30/2022, 4:34:37 PM] [FritzPlatform] Initializing FritzPlatform platform... [1/30/2022, 4:34:40 PM] [FritzPlatform] [DEBUG] FRITZ!Box 7490: New device added! [1/30/2022, 4:34:40 PM] [FritzPlatform] [DEBUG] FRITZ!Box 4040 1: New device added! [1/30/2022, 4:34:40 PM] [FritzPlatform] [DEBUG] FRITZ!Box 4040 2: New device added! [1/30/2022, 4:34:40 PM] [FritzPlatform] [DEBUG] FRITZ!Repeater 600: New device added! Setup Payload: X-HM://XXXXXXXXXXXXX Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ XXX-XX-XXX │     
└────────────┘     

[1/30/2022, 4:34:42 PM] Homebridge v1.4.0 (HAP v0.10.0) (Homebridge C042) is running on port XXXXX. [1/30/2022, 4:34:42 PM] [FritzPlatform] FRITZ!Box 7490: Configuring cached accessory... [1/30/2022, 4:34:42 PM] [FritzPlatform] FRITZ!Box 4040 1: Configuring cached accessory... [1/30/2022, 4:34:42 PM] [FritzPlatform] FRITZ!Box 4040 2: Configuring cached accessory... [1/30/2022, 4:34:42 PM] [FritzPlatform] FRITZ!Repeater 600: Configuring cached accessory... [1/30/2022, 4:34:42 PM] [FritzPlatform] FRITZ!Box 7490: Setup accessory... [1/30/2022, 4:34:42 PM] [FritzPlatform] FRITZ!Box 4040 1: Setup accessory... [1/30/2022, 4:34:42 PM] [FritzPlatform] FRITZ!Box 4040 2: Setup accessory... [1/30/2022, 4:34:42 PM] [FritzPlatform] FRITZ!Repeater 600: Setup accessory... [1/30/2022, 4:34:45 PM] [FritzPlatform] [DEBUG] FRITZ!Box 7490 (dsl): {"NewEnable":"1","NewConnectionStatus":"Connected","NewPossibleConnectionTypes":"IP_Routed, IP_Bridged","NewConnectionType":"IP_Routed","NewName":"internet","NewUptime":"1033375","NewUpstreamMaxBitRate":"24101433","NewDownstreamMaxBitRate":"4030654","NewLastConnectionError":"ERRORNONE","NewIdleDisconnectTime":"0","NewRSIPAvailable":"0","NewUserName":"5511248654630001@setup.t-online.de","NewNATEnabled":"1","NewExternalIPAddress":"79.217.82.133","NewDNSServers":"2003:180:2:9000::53, 2003:180:2:7000::53,217.237.148.102,217.237.151.115","NewMACAddress":"CC:CE:1E:5D:3A:95","NewConnectionTrigger":"AlwaysOn","NewLastAuthErrorInfo":"","NewMaxCharsUsername":"128","NewMinCharsUsername":"3","NewAllowedCharsUsername":"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-.@()#/%[]{}+§$&=?!:;,","NewMaxCharsPassword":"64","NewMinCharsPassword":"3","NewAllowedCharsPassword":"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._@()#/%[]{}+§$&=?!:;,","NewTransportType":"PPPoE","NewRouteProtocolRx":"Off","NewPPPoEServiceName":"","NewRemoteIPAddress":"","NewPPPoEACName":"AFFJ00","NewDNSEnabled":"1","NewDNSOverrideAllowed":"1"} [1/30/2022, 4:34:45 PM] [FritzPlatform] [DEBUG] FRITZ!Box 4040 1 (repeater): {"NewEnable":"1","NewStatus":"Up","NewMaxBitRate":"Auto","NewChannel":"6","NewSSID":"FRITZ!Box 7490","NewBeaconType":"11iandWPA3","NewX_AVM-DEPossibleBeaconTypes":"None,11i,WPAand11i,11iandWPA3","NewMACAddressControlEnabled":"0","NewStandard":"n","NewBSSID":"F0:B0:14:5D:38:A4","NewBasicEncryptionModes":"None","NewBasicAuthenticationMode":"None","NewMaxCharsSSID":"32","NewMinCharsSSID":"1","NewAllowedCharsSSID":"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz !\"#$%&'()*+,-./:;<=>?@[\]^{|}~","NewMinCharsPSK":"64","NewMaxCharsPSK":"64","NewAllowedCharsPSK":"0123456789ABCDEFabcdef"} [1/30/2022, 4:34:45 PM] [FritzPlatform] [DEBUG] FRITZ!Box 4040 2 (repeater): {"NewEnable":"1","NewStatus":"Up","NewMaxBitRate":"Auto","NewChannel":"11","NewSSID":"FRITZ!Box 7490","NewBeaconType":"11iandWPA3","NewX_AVM-DE_PossibleBeaconTypes":"None,11i,WPAand11i,11iandWPA3","NewMACAddressControlEnabled":"0","NewStandard":"n","NewBSSID":"2C:3A:FD:17:CD:5F","NewBasicEncryptionModes":"None","NewBasicAuthenticationMode":"None","NewMaxCharsSSID":"32","NewMinCharsSSID":"1","NewAllowedCharsSSID":"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz !\"#$%&'()*+,-./:;<=>?@[\\]^_{|}~","NewMinCharsPSK":"64","NewMaxCharsPSK":"64","NewAllowedCharsPSK":"0123456789ABCDEFabcdef"} [1/30/2022, 4:34:46 PM] [FritzPlatform] [DEBUG] FRITZ!Repeater 600 (repeater): {"NewEnable":"1","NewStatus":"Up","NewMaxBitRate":"Auto","NewChannel":"11","NewSSID":"FRITZ!Box 7490","NewBeaconType":"11i","NewX_AVM-DEPossibleBeaconTypes":"None,11i,WPAand11i,11iandWPA3","NewMACAddressControlEnabled":"0","NewStandard":"n","NewBSSID":"1C:ED:6F:1D:85:34","NewBasicEncryptionModes":"None","NewBasicAuthenticationMode":"None","NewMaxCharsSSID":"32","NewMinCharsSSID":"1","NewAllowedCharsSSID":"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz !\"#$%&'()*+,-./:;<=>?@[\]^{|}~","NewMinCharsPSK":"64","NewMaxCharsPSK":"64","NewAllowedCharsPSK":"0123456789ABCDEFabcdef"} [1/30/2022, 4:34:47 PM] Error: TheonCancel` handler was attached after the promise settled. at onCancel (/homebridge/node_modules/homebridge-fritz-platform/node_modules/p-cancelable/index.js:48:12) at makeRequest (/homebridge/node_modules/homebridge-fritz-platform/node_modules/got/dist/source/as-promise/index.js:38:13) at Request. (/homebridge/node_modules/homebridge-fritz-platform/node_modules/got/dist/source/as-promise/index.js:143:17) at Object.onceWrapper (node:events:510:26) at Request.emit (node:events:390:28) at Timeout.retry (/homebridge/node_modules/homebridge-fritz-platform/node_modules/got/dist/source/core/index.js:1270:30) at listOnTimeout (node:internal/timers:557:17) at processTimers (node:internal/timers:500:7) [1/30/2022, 4:34:47 PM] Got SIGTERM, shutting down Homebridge... [1/30/2022, 4:34:52 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [1/30/2022, 4:34:57 PM] [HB Supervisor] Restarting Homebridge... [1/30/2022, 4:34:57 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules [1/30/2022, 4:34:57 PM] [HB Supervisor] Started Homebridge v1.4.0 with PID: 2046

jvacek commented 2 years ago

I have started homebridge on my M1 computer and I have this result too. When I curl the address as it is described above, I don't get a 401, but a 404 though.

jvacek commented 2 years ago

BTW It seems that disabling SSL works around this issue, see https://github.com/seydx/homebridge-fritz-platform/issues/254