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

Cannot add a new helper in UI sometimes - seeing a loading indicator #20809

Open
3 of 4 tasks
ildar170975 opened this issue May 16, 2024 · 17 comments
Open
3 of 4 tasks

Cannot add a new helper in UI sometimes - seeing a loading indicator #20809

ildar170975 opened this issue May 16, 2024 · 17 comments

Comments

@ildar170975
Copy link
Contributor

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.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

I think I have seen a similar issue - but cannot find it.
Experience the issue for at least a year.
May be - longer, cannot say for sure since I am not using UI for adding/editing helpers usually, only for a testing purpose.

The issue is that in 100% cases when I try to add a helper - I see this:
изображение

And this indicator may be rotating for a VERY long time (minutes at minimum).
Usually I press F5 when I see that this is a long process and try to repeat.
Sometimes the "Add a helper" dialogue is shown after a minute, sometimes - faster.
I observe a huge CPU & RAM load when this indicator is rotating.
No messages in Log.

Describe the behavior you expected

The "add a new helper" dialog is shown within a few seconds.

Steps to reproduce the issue

see above

What version of Home Assistant Core has the issue?

2024.5.3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Chrome 124.0.6367.202

Which operating system are you using to run this browser?

Win10x64

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

@ildar170975 ildar170975 changed the title Cannot add a new helper in UI sometimes Cannot add a new helper in UI sometimes - seeing a loading indicator May 16, 2024
@silamon
Copy link
Contributor

silamon commented May 19, 2024

There was an issue, but that was related to the schedule helper not being able to load. That was fixed.

Whenever you have this, check the javascript console for errors. If there are no errors in the javascript console, it must be the loading explained below that fails.

At the point the loading indicator is shown (and never goes away), it needs to do the following:

  • Load the possible helpers from the backend (there will be a network request to /api/config/config_entries/flow_handlers?type=helper that should present you the different helpers
  • Load the backend translations for the different integrations on the websocket

@ildar170975
Copy link
Contributor Author

check the javascript console for errors. If there are no errors in the javascript console, it must be the loading explained below that fails.

Took a minute from this:

изображение

to this:

изображение

Can you suggest me what shall I do next?

@silamon
Copy link
Contributor

silamon commented May 19, 2024

Could you try safe mode first to see if that brings better times?

@ildar170975
Copy link
Contributor Author

ildar170975 commented May 19, 2024

In safe mode the window is displayed immediately.
Does this mean that some custom integration prevents to show the window fast?

@silamon
Copy link
Contributor

silamon commented May 19, 2024

It loads the integration titles for all integrations (helpers, core integrations, custom integrations) at that point. I'm not sure if the amount of custom integrations make it slower or if there would be a specific custom integration that takes a while.

@ildar170975
Copy link
Contributor Author

ildar170975 commented May 19, 2024

  1. I believed that "Add a helper" window allows to create a helper for STOCK integrations, not custom ones. Checked a content of this window- yes, only stock integrations. Then what is a reason of loading titles for ALL integrations then?

изображение

  1. On the run right after that test "safe mode" run - the window is shown immediately. How can a "safe mode" run fix (may be for a while) this problem?

@silamon
Copy link
Contributor

silamon commented May 20, 2024

  1. It's not really know what the helpers are when the integration title translations are fetched.
  2. Once the integrations title translations are fetched, they are kept in memory until you refresh the whole application.

@ildar170975
Copy link
Contributor Author

ildar170975 commented May 20, 2024

Noticed that after HA reboot it again needs ~1 minute to show a window.

@silamon
Copy link
Contributor

silamon commented May 20, 2024

If you're able to find out if the slowdown comes from the amount of custom integrations you have and not from a single particular one, I'll be able to change it, so it loads only the integration title translations from the helpers.

@ildar170975
Copy link
Contributor Author

I am thinking about finding a culprit.
I have some custom integrations - some are defined in yaml, some in UI.
Shall I check for both types?

@silamon
Copy link
Contributor

silamon commented May 20, 2024

I think you should check the custom integrations that define a config flow (others said, are configurable from the UI)
I should mention that it would be good to find the culprit as that would help towards the general performance of your home assistant as well.

@ildar170975
Copy link
Contributor Author

custom integrations that define a config flow (others said, are configurable from the UI)

Not too many of them:
fontawesome
gismeteo
iPhone device tracker
places
ha-composite-tracker

Shall I disable them one by one - or delete?

@silamon
Copy link
Contributor

silamon commented May 20, 2024

Setup a logger in your configuration yaml:

logger:
  default: info
  logs:
    homeassistant.config_entries: debug # add this

Then load the add helper and check for any late "Loaded <integration_name> from <integration_path>"

@ildar170975
Copy link
Contributor Author

Added these lines for logger, rebooted - and see no freezes for "add a helper".
Will keep observing within these days.

Thanks for a feedback!

@ildar170975
Copy link
Contributor Author

Still do not observe freezes "add a helper".
Closing this issue.
Will reopen if needed.
Thanks again for support!

@Mariusthvdb
Copy link
Contributor

seeing that since yesterday ...... having more trouble with the Hlpers page, but didnt notice before because I didnt add new helpers in a while. not fixed I suppose (Ha 2024.8.0)

Scherm­afbeelding 2024-08-09 om 15 21 09

@ildar170975 ildar170975 reopened this Aug 9, 2024
@ildar170975
Copy link
Contributor Author

seeing that since yesterday

Reopened then

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