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: Navigation timeout of 60000 ms exceeded #119

Open
Cornmeister opened this issue Apr 16, 2024 · 6 comments
Open

Comments

@Cornmeister
Copy link

Cornmeister commented Apr 16, 2024

Hi,

I'm not able to use your tool, It starts, and after trying (and failing) to connect, it shuts down itself,
Sometimes it is able to render an image, but fails most of the time.

It happens with both the HA addon and the standalone docker,
running on a proxmox VMs with 16GB ram and 4 CPU cores assigned on a gen10 i7 host

any suggestions ?

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[20:10:40] INFO: Loading config...
[20:10:41] INFO: Loading additional environment variables...
[20:10:41] INFO: Setting UNSAFE_IGNORE_CERTIFICATE_ERRORS to true
[20:10:41] INFO: Using HA_BASE_URL: https://192.168.0.29
[20:10:41] INFO: Starting server...

> [email protected] start
> node index.js

Starting browser...
Visiting 'https://192.168.0.29' to login...
Adding authentication entry to browser's local storage...
Starting first render...
Rendering https://192.168.0.29/kiosk-mode/0?kiosk to image...
Failed to render TimeoutError: Navigation timeout of 60000 ms exceeded
    at /app/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
Converting rendered screenshot of https://192.168.0.29/kiosk-mode/0?kiosk to grayscale...
/app/node_modules/gm/lib/command.js:301
          err = new Error('Command failed: ' + stderr);
                ^

Error: Command failed: convert: unable to open image 'output/cover.png.temp': No such file or directory @ error/blob.c/OpenBlob/3569.
convert: no decode delegate for this image format `TEMP' @ error/constitute.c/ReadImage/746.
convert: no images defined `output/cover.png' @ error/convert.c/ConvertImageCommand/3354.

    at ChildProcess.onExit (/app/node_modules/gm/lib/command.js:301:17)
    at ChildProcess.emit (node:events:517:28)
    at maybeClose (node:internal/child_process:1098:16)
    at ChildProcess._handle.onexit (node:internal/child_process:303:5) {
  code: 1,
  signal: null
}

Node.js v18.20.1
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
HA_BASE_URL: https://192.168.0.29
HA_SCREENSHOT_URL: /kiosk-mode/0?kiosk
HA_ACCESS_TOKEN: *******
LANGUAGE: en
CRON_JOB: "* * * * *"
RENDERING_TIMEOUT: "60000"
RENDERING_DELAY: 5000
RENDERING_SCREEN_HEIGHT: 825
RENDERING_SCREEN_WIDTH: 1200
BROWSER_LAUNCH_TIMEOUT: 300
ROTATION: "0"
SCALING: "1"
GRAYSCALE_DEPTH: "8"
IMAGE_FORMAT: png
COLOR_MODE: GrayScale
REMOVE_GAMMA: true
PREFERS_COLOR_SCHEME: light
HA_BATTERY_WEBHOOK: set_kindle_battery_level
ADDITIONAL_ENV_VARS:
  - name: UNSAFE_IGNORE_CERTIFICATE_ERRORS
    value: "true"
@sibbl
Copy link
Owner

sibbl commented Apr 17, 2024

Hey, thanks for reaching out!

Navigation timeout of 60000 ms exceeded sounds like the Browser was not able to settle rendering of the page after one minute. The timeout looks quite reasonable for the hardware specs, but maybe you can check what's on your dashboard and maybe try rendering some lovelace page first, which maybe has one default entity on it? Just to be sure that the URL etc works and can then try to narrow it down on maybe some part of the content.

Unfortunately this doesn't seem to be a very straight forward advise, but it's the best I can tell from just the logs. The browser isn't very "talkative" when it comes to finding the reasons why navigation failed after 60s.

@Cornmeister
Copy link
Author

Strange, a simple lovelace dashboard with one card renders fine.
After switching back to the original dashboard, it still runs :D

no clue why, it works for now, will reopen issue if it returns.

thanks

@Cornmeister
Copy link
Author

:( It rendered once, but now it will only render simple lovelace dashboards with one card,
larger dashboards result in timeouts.

@Cornmeister Cornmeister reopened this Apr 17, 2024
@Cornmeister
Copy link
Author

did some testing, without an Apex Chart card, it runs fine.
takes too much time/resources I guess.

@sibbl
Copy link
Owner

sibbl commented Apr 18, 2024

Technically the only option we have is to just enforce rendering, even after the timeout error was raised. It may result in broken screenshots but even this might be more helpful than an exception in the logs...

I'll think about this and let you know once I'll give this a try.

Thanks for the hint with the Apex Chart card! It's something I can try to use for reproducing the issue and fiddling around with timeout handling.

@beeh5
Copy link
Contributor

beeh5 commented May 15, 2024

@Cornmeister @sibbl
maybe it has to do with hardware graphic acceleration in the virtualized environment?
maybe headless Chrome tries to access that, but fails to get enough of it from Proxmox... Did you allocate any GPU to your VM?

However much you put on that dashboard, your CPU config should be able to handle that...

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

3 participants