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

scrollTop Virtualizer error in HA core logs #17745

Closed
3 tasks done
TheJulianJES opened this issue Aug 30, 2023 · 10 comments · Fixed by #18206
Closed
3 tasks done

scrollTop Virtualizer error in HA core logs #17745

TheJulianJES opened this issue Aug 30, 2023 · 10 comments · Fixed by #18206

Comments

@TheJulianJES
Copy link
Member

TheJulianJES commented Aug 30, 2023

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

I've noticed two errors in Home Assistant Core logs whilst running 2023.9.0b0:
(the first seems to be more important)

If these errors aren't related, I can split up this issue and open another issue if wanted.

2023-08-31 01:07:10.222 ERROR (MainThread) [frontend.js.latest.202308300] Unhandled promise rejection from Chrome 116.0.0.0 on Mac OS 10.15.7
TypeError: Cannot destructure property 'scrollTop' of 'this._scrollerController' as it is null.
scrollTop (src/Virtualizer.ts:741:13)
_correctScrollError (src/Virtualizer.ts:546:9)
_finishDOMUpdate (src/Virtualizer.ts:538:9)
_updateDOM (src/Virtualizer.ts:603:11)
_handleLayoutMessage (src/Virtualizer.ts:441:43)
_hostSink (src/layouts/shared/BaseLayout.ts:478:9)
_sendStateChangedMessage (src/layouts/shared/BaseLayout.ts:364:9)
_reflow (src/layouts/flow.ts:491:10)
_reflow (src/layouts/shared/BaseLayout.ts:257:11)
reflowIfNeeded (src/Virtualizer.ts:563:20)

2023-08-31 01:08:45.811 ERROR (MainThread) [frontend.js.latest.202308300] Unhandled promise rejection from Chrome 116.0.0.0 on Mac OS 10.15.7
{
  "code": "not_found",
  "message": "Subscription not found."
}

Describe the behavior you expected

That no errors show up in the log.

Steps to reproduce the issue

Unclear for now. Perhaps related to:

What version of Home Assistant Core has the issue?

core-2023.9.0b0

What was the last working version of Home Assistant Core?

core-2023.8.4

In which browser are you experiencing the issue with?

Google Chrome 116.0.5845.96

Which operating system are you using to run this browser?

macOS Sonoma (14.0) Dev Beta 6

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@Anto79-ops
Copy link

Anto79-ops commented Aug 31, 2023

maybe related, I can open a separate issue if not:

Logger: frontend.js.latest.202308300
Source: components/system_log/__init__.py:269
First occurred: 4:37:37 PM (5 occurrences)
Last logged: 4:50:10 PM

Unhandled promise rejection from Chrome WebView 114.0.5735.220 on Android 9 { "code": "unknown_command", "message": "Unknown command." }
Unhandled promise rejection from Chrome 116.0.0.0 on Windows 10 { "code": "not_found", "message": "Subscription not found." }
Unhandled promise rejection from Chrome 116.0.0.0 on Windows 10 TypeError: Cannot read properties of null (reading 'addEventListener') addEventListener (src/platform/platform.dom.js:98:7) canvas (src/platform/platform.dom.js:247:14) handler (src/platform/platform.dom.js:338:20) addEventListener (src/core/core.controller.js:999:15) _add (src/core/core.controller.js:1009:40) call (src/helpers/helpers.core.ts:149:11) this (src/core/core.controller.js:1009:9) bindUserEvents (src/core/core.controller.js:983:9) bindEvents (src/core/core.controller.js:575:11) _checkEventBindings (src/core/core.controller.js:496:9)

More come later.

Logger: frontend.js.latest.202308300
Source: components/system_log/__init__.py:269
First occurred: 4:37:37 PM (22 occurrences)
Last logged: 9:56:18 PM

Unhandled promise rejection from Chrome 116.0.0.0 on Windows 10 TypeError: Cannot read properties of null (reading 'addEventListener') addEventListener (src/platform/platform.dom.js:98:7) canvas (src/platform/platform.dom.js:247:14) handler (src/platform/platform.dom.js:338:20) addEventListener (src/core/core.controller.js:999:15) _add (src/core/core.controller.js:1009:40) call (src/helpers/helpers.core.ts:149:11) this (src/core/core.controller.js:1009:9) bindUserEvents (src/core/core.controller.js:983:9) bindEvents (src/core/core.controller.js:575:11) _checkEventBindings (src/core/core.controller.js:496:9)
Unhandled promise rejection from Chrome WebView 116.0.0.0 on Android 13 TypeError: Cannot destructure property 'scrollTop' of 'this._scrollerController' as it is null. scrollTop (src/Virtualizer.ts:741:13) _correctScrollError (src/Virtualizer.ts:546:9) _finishDOMUpdate (src/Virtualizer.ts:538:9) _updateDOM (src/Virtualizer.ts:603:11) _handleLayoutMessage (src/Virtualizer.ts:441:43) _hostSink (src/layouts/shared/BaseLayout.ts:478:9) _sendStateChangedMessage (src/layouts/shared/BaseLayout.ts:364:9) _reflow (src/layouts/flow.ts:491:10) _reflow (src/layouts/shared/BaseLayout.ts:257:11) reflowIfNeeded (src/Virtualizer.ts:563:20)
Unhandled promise rejection from Chrome WebView 116.0.0.0 on Android 13 TypeError: Cannot read properties of undefined (reading 'state') CanvasGaugeCard.updated (/hacsfiles/canvas-gauge-card/canvas-gauge-card.js:273:97) CanvasGaugeCard._$AE (/hacsfiles/canvas-gauge-card/canvas-gauge-card.js:34:5212) CanvasGaugeCard.performUpdate (/hacsfiles/canvas-gauge-card/canvas-gauge-card.js:34:4991) CanvasGaugeCard.scheduleUpdate (/hacsfiles/canvas-gauge-card/canvas-gauge-card.js:34:4572) CanvasGaugeCard._$Ej (/hacsfiles/canvas-gauge-card/canvas-gauge-card.js:34:4480)
Unhandled promise rejection from Chrome WebView 116.0.0.0 on Android 13 { "code": "invalid_start_time", "message": "Invalid start_time" }
Unhandled promise rejection from Chrome WebView 116.0.0.0 on Android 13 TypeError: Cannot read properties of null (reading 'addEventListener') addEventListener (src/platform/platform.dom.js:98:7) canvas (src/platform/platform.dom.js:247:14) handler (src/platform/platform.dom.js:338:20) addEventListener (src/core/core.controller.js:999:15) _add (src/core/core.controller.js:1009:40) call (src/helpers/helpers.core.ts:149:11) this (src/core/core.controller.js:1009:9) bindUserEvents (src/core/core.controller.js:983:9) bindEvents (src/core/core.controller.js:575:11) _checkEventBindings (src/core/core.controller.js:496:9)

@karwosts karwosts added this to the 2023.9 milestone Aug 31, 2023
@bramkragten
Copy link
Member

We added a bunch more error logging, so errors that previously would not show up, now do show up in the logs. Meaning these errors might not be related to beta, but now show up in beta 🙃 and we should still try to fix them ofc

I see some custom card errors in there canvas-gauge-card that you should report that error to.
And see some errors in dependencies...

@Thrasher2020
Copy link

Thrasher2020 commented Aug 31, 2023

Seeing the same - when casting to a Google Mini logs are filled

Logger: frontend.js.latest.202308300
Source: components/system_log/__init__.py:269
First occurred: 09:35:46 (199259 occurrences)
Last logged: 13:00:15

Unhandled promise rejection from Chrome 116.0.0.0 on Windows 10 { "code": "not_found", "message": "Subscription not found." }
Unhandled promise rejection from Chrome 112.0.0.0 on Chromecast 1.56.500000 TypeError: t.refresh is not a function /hacsfiles/lovelace-card-mod/card-mod.js:5:1382
Uncaught error from Chrome 116.0.0.0 on Windows 10 TypeError: Cannot read properties of undefined (reading 'entity_id') label (src/components/chart/state-history-chart-line.ts:141:69) call (src/plugins/plugin.tooltip.js:441:33) invokeCallbackWithFallback (src/plugins/plugin.tooltip.js:559:35) call (src/helpers/helpers.core.ts:149:11) tooltipItems (src/plugins/plugin.tooltip.js:551:9) getBody (src/plugins/plugin.tooltip.js:649:23) update (src/plugins/plugin.tooltip.js:1160:13) handleEvent (src/plugins/plugin.tooltip.js:1257:24) apply (src/helpers/helpers.core.ts:109:14) method (src/core/core.plugins.js:60:23)
Unhandled promise rejection from Chrome 112.0.0.0 on Chromecast 1.56.500000 InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing. transaction (node_modules/idb-keyval/dist/index.js:13:62)
Unhandled promise rejection from Chrome 116.0.0.0 on Windows 10 TypeError: Cannot read properties of null (reading 'addEventListener') addEventListener (src/platform/platform.dom.js:98:7) canvas (src/platform/platform.dom.js:247:14) handler (src/platform/platform.dom.js:338:20) addEventListener (src/core/core.controller.js:999:15) _add (src/core/core.controller.js:1009:40) call (src/helpers/helpers.core.ts:149:11) this (src/core/core.controller.js:1009:9) bindUserEvents (src/core/core.controller.js:983:9) bindEvents (src/core/core.controller.js:575:11) _checkEventBindings (src/core/core.controller.js:496:9)

@steverep
Copy link
Member

steverep commented Sep 1, 2023

As Bram noted, #17616 added and enhanced error logging for the frontend, so most of these have probably been just going uncaught before now.

Scanning the errors that have been posted, I'd say most of these are probably separate issues and should be taken one at a time. In short, each unique error message and stack trace should be a separate issue. If it occurs on and gets logged from different browsers and OSs, that can just be noted in the issue.

It would also help if possible to know exactly the steps taken before it throws.

@silamon
Copy link
Contributor

silamon commented Sep 2, 2023

ScrollTop virtualizer issue reproduction:

  1. Have the demo integration available
  2. Go to Devices/Services in the settings
  3. Click xx devices of Demo integration so you see a list of devices
  4. Scroll in the list
  5. Click a device from the integration
  6. Through Device Info click back to Demo integration
  7. Error is now logged

Edit: Bisect indicated 4598b53 is the first bad commit

@bramkragten
Copy link
Member

Thanks @silamon for the research! Very helpful

@steverep
Copy link
Member

steverep commented Sep 6, 2023

Filed an issue with lit: lit/lit#4182

Looking at their source, I'm not sure of the exact cause, but they are asserting the controller is not null, so it's definitely their bug.

@silamon
Copy link
Contributor

silamon commented Sep 11, 2023

This is a better stacktrace for the addEventListener being reported here.

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'addEventListener')
at addListener (chart.esm.js:2966:1)
at createProxyAndListen (chart.esm.js:3089:1)
at DomPlatform.addEventListener (chart.esm.js:3132:1)
at _add (chart.esm.js:5732:1)
at eval (chart.esm.js:5740:1)
at each (helpers.segment.js:102:1)
at Chart.bindUserEvents (chart.esm.js:5740:1)
at Chart.bindEvents (chart.esm.js:5720:1)
at Chart.update (chart.esm.js:5453:1)
at HaChartBase.willUpdate (ha-chart-base.ts:102:1)

It's most likely reproduceable on the energy dashboard and resizing your screen, although I spotted it the first upon opening Home Assistant directly through the energy dashboard url.

EDIT: chartjs/Chart.js#11295

@steverep
Copy link
Member

We should open a separate issue for that chart.js error

@steverep
Copy link
Member

Quick update: waiting on a merge of lit/lit#4233 to fix this.

@karwosts karwosts removed this from the 2023.9 milestone Oct 14, 2023
@steverep steverep linked a pull request Oct 20, 2023 that will close this issue
1 task
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants