Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to render TimeoutError: waiting for selector home-assistant failed: timeout 8986ms exceeded #28

Closed
davyike opened this issue Dec 31, 2021 · 2 comments

Comments

@davyike
Copy link

davyike commented Dec 31, 2021

Hoping you can help me here. I've set up the docker container:

docker create --name="ha-kindle-screensaver" -p 5050:5000 -e HA_BASE_URL="https://<MYURL>" -e HA_SCREENSHOT_URL="/lovelace/climate?kiosk" -e HA_ACCESS_TOKEN="<ACCESSTOKEN>" --restart=always sibbl/hass-lovelace-kindle-screensaver

I get the following in the logs:

> hass-lovelace-kindle-screensaver@1.0.4 start
> node index.js

Starting browser...
Visiting 'https://<MYURL>' to login...
Adding authentication entry to browser's local storage...
Starting first render...
Starting rendering cronjob...
Server is running at 5000
Rendering https://<MYURL>/lovelace/climate?kiosk to image...
Failed to render TimeoutError: waiting for selector `home-assistant` failed: timeout 8986ms exceeded
    at new WaitTask (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:517:34)
    at DOMWorld.waitForSelectorInPage (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:428:26)
    at Object.internalHandler.waitFor (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/QueryHandler.js:31:77)
    at DOMWorld.waitForSelector (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:321:29)
    at Frame.waitForSelector (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:924:51)
    at Page.waitForSelector (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2359:33)
    at renderUrlToImageAsync (/app/index.js:257:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async renderAndConvertAsync (/app/index.js:171:5)
Converting rendered screenshot of https://<MYURL>/lovelace/climate?kiosk to grayscale png...
/app/node_modules/gm/lib/command.js:301
          err = new Error('Command failed: ' + stderr);

Unsurprisingly, I get "Image not found" when hitting the server. Any tips? It looks like it's authenticating OK, right?

  • I can hit the URL myself and it renders as expected
  • The page loads in about 1 second when I load it myself
@davyike
Copy link
Author

davyike commented Dec 31, 2021

Hmm, just noticed I have this in my HA logs though:

Login attempt or request with invalid authentication from 172.17.0.22 (172.17.0.22). (Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/81.0.4044.113 Safari/537.36)

Maybe it's the auth playing up after all. Deleting the access token from HA seems to have no impact on the logs, so perhaps this is not being detected correctly.

@davyike
Copy link
Author

davyike commented Dec 31, 2021

Got it! I'd missed part of the Access Token. 🤦🦆

Is there a way to better catch/show this in the logs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant