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
311 stars 71 forks source link

Timeout Errors #107

Closed roverte closed 4 months ago

roverte commented 4 months ago

This container was working great for me for a while but I moved to a new set up and now cannot get it to work. I keep getting a timeout error as shown in the logs below. Please let me know if you have any thoughts on how to fix this. I've anonymized some of the information with XXXs.

Thank you so much.



screenshot       | 
screenshot       | > hass-lovelace-kindle-screensaver@1.0.6 start
screenshot       | > node index.js
screenshot       | 
screenshot       | Starting browser...
screenshot       | Visiting 'http://XXX.XXX.XXX.XXX:8123' to login...
screenshot       | Adding authentication entry to browser's local storage...
screenshot       | Starting first render...
screenshot       | Rendering http://XXX.XXX.XXX.XXX:8123/lovelace/XXX?kiosk to image...
screenshot       | Failed to render TimeoutError: waiting for selector `home-assistant` failed: timeout 27058ms exceeded
screenshot       |     at new WaitTask (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:517:34)
screenshot       |     at DOMWorld.waitForSelectorInPage (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:428:26)
screenshot       |     at Object.internalHandler.waitFor (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/QueryHandler.js:31:77)
screenshot       |     at DOMWorld.waitForSelector (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:321:29)
screenshot       |     at Frame.waitForSelector (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:924:51)
screenshot       |     at Page.waitForSelector (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2359:33)
screenshot       |     at renderUrlToImageAsync (/app/index.js:261:16)
screenshot       |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
screenshot       |     at async renderAndConvertAsync (/app/index.js:174:5)
screenshot       |     at async /app/index.js:70:5
screenshot       | Converting rendered screenshot of http://XXX.XXX.XXX.XXX:8123/lovelace/XXX?kiosk to grayscale png...
screenshot       | /app/node_modules/gm/lib/command.js:301
screenshot       |           err = new Error('Command failed: ' + stderr);
screenshot       |                 ^
screenshot       | 
screenshot       | Error: Command failed: convert: unable to open image '/output/XXX.png.temp': No such file or directory @ error/blob.c/OpenBlob/3569.
screenshot       | convert: no decode delegate for this image format `TEMP' @ error/constitute.c/ReadImage/741.
screenshot       | convert: no images defined `/output/XXX.png' @ error/convert.c/ConvertImageCommand/3342.
screenshot       | 
screenshot       |     at ChildProcess.onExit (/app/node_modules/gm/lib/command.js:301:17)
screenshot       |     at ChildProcess.emit (node:events:513:28)
screenshot       |     at maybeClose (node:internal/child_process:1100:16)
screenshot       |     at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
screenshot       |   code: 1,
screenshot       |   signal: null
screenshot       | }
screenshot       | 
screenshot       | > hass-lovelace-kindle-screensaver@1.0.6 start
screenshot       | > node index.js
screenshot       | ```
sibbl commented 4 months ago

waiting for selectorhome-assistantfailed is an indicator that it fails to fetch the HTML of the dashboard.

Are you sure the IP is correct and you have access from where your docker image is running?

Please also verify that your access token is still valid. This might show a similar error message to yours, if you didn't bring it along to your new setup properly.

roverte commented 4 months ago

Thank you. It turns out it was an issue with the token. I had checked the token using curl in terminal but it had somehow gotten truncated in the docker compose file. To hopefully avoid this going forward, I moved the token to a .env file.

Thank you again for your help and the great code.