sibbl / hass-lovelace-kindle-screensaver

This tool generates a png from a Home Assistant Lovelace view, which can be displayed on a Kindle device which has the Online Screensaver plugin installed.
MIT License
333 stars 74 forks source link

Execution context was destroyed, most likely because of navifation. #64

Open martinbrasna opened 1 year ago

martinbrasna commented 1 year ago

Hello everybody, I'm desperate - don't know what I'm doing wrong. Running HASS on RPi3, hass-lovelace-kindle-screensaver worked well, until last week, when it starts falling. Now it refuses to create png file and quits on start. I will be happy for any idea. Thanks

hass-lovelace-kindle-screensaver@1.0.4 start node index.js Starting browser... Visiting 'http://192.168.20.19:8123' to login... Adding authentication entry to browser's local storage... /app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:265 throw new Error('Execution context was destroyed, most likely because of a navigation.'); ^ Error: Execution context was destroyed, most likely because of a navigation. at rewriteError (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:265:23) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async ExecutionContext._evaluateInternal (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:219:60) at async ExecutionContext.evaluate (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16) at async /app/index.js:51:3 npm notice npm notice New major version of npm available! 8.19.3 -> 9.6.7 npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.7 npm notice Run npm install -g npm@9.6.7 to update! npm notice

megathlon commented 5 months ago

Same problem here with a RPi3B. I think this error message about the destroyed execution context occurs when the cron schedule starts a new rendering while the previous one is still in progress. I tried changing the cron string (e.g. from * * * * * to */10 * * * * for rendering only every 10 minutes) and increasing the rendering timeout, but even 10 minutes are not sufficient. I can see on the terminal with "top" that the CPU is busy (apparently 1 of the 2 cores) until either the timeout or the destruction of the execution context occurs. Unfortunately I have no idea what's wrong. But since the add-on seems to have worked for martinbrasna before, I assume the problem is not just a lack of CPU power/RAM.

megathlon commented 3 months ago

In my case it seems to help to

Still, it does not always start successfully.