alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.45k stars 209 forks source link

🐛 [changedetection][browserless chrome] Target page, context or browser has been closed #1251

Open Norm2023 opened 6 months ago

Norm2023 commented 6 months ago

Description

I am encountering this error "Target page, context or browser has been closed" for any website in the watchlist.

Strange thing is that if I use Browser Steps and Visual filter selector I actually see the webpage being fetched.

My setup:

Pi4 8GBHome Assistant 2024.1.5

changedetection addon 0.45.14

Browserless Chrome addon: 2.2.0-5

Reproduction steps

1. Add any website to the watchlist
2. After 1 minute more or less the GUI shows "Target page, context or browser has been closed"

If instead navigate to Browser Steps and Visual filter selector the webpage is correclty rendered

Addon Logs

Log changedetection

2024-02-16 14:17:51.270 | ERROR    | changedetectionio.update_worker:run:450 - Exception reached processing watch UUID: 94820347-d9a7-4322-8a4e-b900bb893139 
2024-02-16 14:17:51.270 | ERROR    | changedetectionio.update_worker:run:451 - Target page, context or browser has been closed 

Log Browserless
browserless.io:browsers:cdp:chromium Browser is running on ws://127.0.0.1:35595/devtools/browser/5b682193-47dc-41b2-9c73-7e7bd407a5c2 +2s browserless.io:browsers:cdp:chromium Proxying http://0.0.0.0:3000/?launch=%7B%7D to browser ws://127.0.0.1:35595/devtools/browser/5b682193-47dc-41b2-9c73-7e7bd407a5c2 +1ms 
browserless.io:browsers:cdp:chromium Setting up file:// protocol request rejection +602ms 
browserless.io:limiter Job has hit timeout after 30,003ms of activity. +30s 
browserless.io:limiter Calling timeout handler +1ms 
browserless.io:router Websocket job has timedout, sending 429 response +18h 
browserless.io:limiter (Running: 0, Pending: 0) All jobs complete.  +2ms 
browserless.io:browser-manager 0 Client(s) are currently connected +30s 
browserless.io:browser-manager Closing browser session +1ms 
browserless.io:browser-manager Deleting "/tmp/browserless-data-dirs/browserless-data-dir-bdbd2558-e49f-4f36-80dc-f78155522d1e" user-data-dir and session from memory +1ms browserless.io:browsers:cdp:chromium Closing browser process and all listeners +28s browserless.io:browser-manager Deleting data directory "/tmp/browserless-data-dirs/browserless-data-dir-bdbd2558-e49f-4f36-80dc-f78155522d1e" +56ms

Architecture

aarch64

OS

HAos

Norm2023 commented 3 months ago

I suspect this is related to Browserless timeout (maybe Hardware is not great and it goes in timeout?). How to increase the timeout in browserless hassio addons? Can you make it configurable?

browserless.io:limiter Job has hit timeout after 30,003ms of activity. +30s

alexbelgium commented 3 months ago

Hi, please try adding TIMEOUT: 60000 in the config.yaml it will pass it as env variable. I'll push a new version of the addon with this as default

Norm2023 commented 3 months ago

Did you mean config.json? I am using local addons as I had to change the PLAYWRIGHT_DRIVER_URL env variable due to websocket error. Now websocket is OK but it goes in timeout after 30sec. Adding TIMEOUT to config.json or config.yaml does not change anything. I was expecting to change something in browserless addon rather than changedetection.

Norm2023 commented 3 months ago

Hi it seems things are getting better now (I updated to Browserless to 2.12.0-2 with 60sec timeout). Thansk for that!! What if I wanted to increase more the timeout? Can you make it configurable in next releases? Also I don't know why but I am not able to find the config.json for browserless hassio addon, while the one for changedetection I can (do you know the path?)

alexbelgium commented 3 months ago

Hi, indeed browserless chrome dorsn't expose it's config; something i can solve in the future

alexbelgium commented 3 months ago

Added for changedetection too