grzegorz914 / homebridge-xbox-tv

Homebridge plugin for Microsoft Game Console, publish as independent external platform accessory.
MIT License
164 stars 15 forks source link

Reached heap limit Allocation failed #172

Closed T-Bone90 closed 1 year ago

T-Bone90 commented 1 year ago

The plugin is great but usually doesn't work for me as it should. Very rarely does the XBox turn on by voice command. The xbox is fully authorized and web api is on. I get this message several times a day:

`<--- Last few GCs --->

[19201:0x5967f58] 23528215 ms: Mark-sweep 921.5 (983.4) -> 920.6 (983.7) MB, 1297.7 / 0.5 ms (average mu = 0.883, current mu = 0.742) allocation failure; scavenge might not succeed [19201:0x5967f58] 23533051 ms: Mark-sweep 921.7 (983.7) -> 920.8 (983.9) MB, 1624.2 / 0.5 ms (average mu = 0.820, current mu = 0.664) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory [15.4.2023, 09:29:53] [homebridge-xbox-tv] Child bridge process ended [15.4.2023, 09:29:53] [homebridge-xbox-tv] Process Ended. Code: null, Signal: SIGABRT [15.4.2023, 09:30:00] [homebridge-xbox-tv] Restarting Process... [15.4.2023, 09:30:01] [homebridge-xbox-tv] Launched child bridge with PID 25999 [15.4.2023, 09:30:02] Registering platform 'homebridge-xbox-tv.XboxTv' [15.4.2023, 09:30:02] [homebridge-xbox-tv] Loaded homebridge-xbox-tv v2.8.15 child bridge successfully`

T-Bone90 commented 1 year ago

Now I get this every 60 seconds. The console is full authorized and activated.

[21.4.2023, 19:49:26] [homebridge-xbox-tv] Device: 192.168.255.23 Xbox, web Api data error: Console: F4001EFAF173CCCE, get status error: Error: connect ETIMEDOUT 168.63.53.71:443, recheck in 60se.

torandreroland commented 1 year ago

I have this problem as well. I think it happens when the token for a xbox is invalidated. Somehow the plugin ends up in a loop and exhausts all resources on the machine. This brings my whole smart home to a halt, even in a Docker environment (on a Raspberry Pi 4).

shanemcw commented 1 year ago

Possibly related to #171 and subsequent continuous error processing [4/14/2023, 11:35:53 AM] [XboxTv] Device: 192.168.0.23 Xbox, check authorization state error: {}, recheck in 60se.

grzegorz914 commented 1 year ago

@T-Bone90

Please try 2.8.18-beta.4 and let me know

T-Bone90 commented 1 year ago

Unfortunately, I now get the message with beta 4 when I want to turn on the console:

[3.5.2023, 09:24:31] [homebridge-xbox-tv] Device: 192.168.255.23 Xbox, Power On error, please try again. [3.5.2023, 09:24:31] [homebridge-xbox-tv] Device: 192.168.255.23 Xbox, set Power, error: TypeError: this.packer is not a function

grzegorz914 commented 1 year ago

check beta.6

T-Bone90 commented 1 year ago

[3.5.2023, 18:56:38] [homebridge-xbox-tv] Device: 192.168.255.23 Xbox, Power On failed, please try again.

torandreroland commented 1 year ago

Beta 8 still has a problem with the token not being refreshed thus eventually leading to all resource being exhausted

From the homebridge.log: device: 10.0.0.123 Loft Xbox, set Power, error: send command type: Power, command: TurnOff, params: undefined, error: {"status":401,"body":""}

grzegorz914 commented 1 year ago

Try latest beta please and let me know.

grzegorz914 commented 1 year ago

fixed in latest release