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

Attempting to re-enable disabled integrations never sends a websocket message #12546

Closed
3 tasks done
AskAlice opened this issue May 2, 2022 · 16 comments
Closed
3 tasks done
Labels

Comments

@AskAlice
Copy link

AskAlice commented May 2, 2022

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

in /config/integrations, clicking on the Enable button or the three dots has no effect.

No websocket traffic is seen that should have made the call to enableIntegration

One possible reason could be that it returns without logging an error here: https://github.dev/home-assistant/frontend/blob/3b6b4d76640fa73dc336a9a6875ff036fe45033f/src/panels/config/integrations/ha-integration-card.ts#L528-L535

Describe the behavior you expected

To re-enable the config entry

Steps to reproduce the issue

not sure how to reproduce entirely, but I simply just went to config/integrations, showed disabled integrations, then tried to enable one.

https://discord.com/channels/330944238910963714/672220541343760384/960745641099812934
https://discord.com/channels/330944238910963714/672220541343760384/970715074916405299

What version of Home Assistant Core has the issue?

core-2022.4.7

What was the last working version of Home Assistant Core?

core-2022.4.7

In which browser are you experiencing the issue with?

Google Chrome Version 100.0.4896.127

Which operating system are you using to run this browser?

windows 11 and raspbian

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

no js logs and nothing in hass logs

Additional information

No response

@AskAlice
Copy link
Author

AskAlice commented May 2, 2022

is there an alternate way to edit this data? Where is it stored?

@emontnemery
Copy link
Collaborator

@AskAlice You can manually edit .storage/core.config_entries and set disabled_by to null for the config entry you want to enable:

  1. Stop Home Assistant
  2. Edit .storage/core.config_entries as needed
  3. Start Home Assistant

Make a backup of .storage/core.config_entries first to make sure you can recover if you make a mistake when editing.

@emontnemery
Copy link
Collaborator

@AskAlice I can't reproduce the problem, are you sure this is not an issue with a stale browser cache?

@AskAlice
Copy link
Author

AskAlice commented May 3, 2022

@AskAlice I can't reproduce the problem, are you sure this is not an issue with a stale browser cache?

Yeah I've tried it on a few different browsers. I also tried right clicking refresh with dev tools to empty cache & hard reload, as well as going to the 'Application' tab in the chrome dev tools and clearing all storage.

Another user in discord reports this to also be occurring. The first one that doesn't enable is the nest integration which is defined in my yaml, the second one is an esphome installation that is defunct (esp32 is offline)

I can imagine there are only a few places where it would return before sending the websocket request. Perhaps it should be logged in production builds when it returns so that people can understand more why the function isn't reaching the code to send a websocket message.

@AskAlice You can manually edit .storage/core.config_entries and set disabled_by to null for the config entry you want to enable:

  1. Stop Home Assistant
  2. Edit .storage/core.config_entries as needed
  3. Start Home Assistant

Make a backup of .storage/core.config_entries first to make sure you can recover if you make a mistake when editing.

Hmm...
image
ttg was in fact disabled by "user" but the oauth for web (nest) integration is showing null here... weird

@AskAlice
Copy link
Author

AskAlice commented May 3, 2022

I left my phone open on the page for a few minutes with disabled integrations shown, and while it didn't initially work, tapping it again after that duration did work.

In that time I did run ha core stop and ha core start, but i'm unsure if that has anything to do with it working now.

@emontnemery
Copy link
Collaborator

In that time I did run ha core stop and ha core start, but i'm unsure if that has anything to do with it working now.

OK, so is it now working again and you can disable and enable integrations?

@AskAlice
Copy link
Author

AskAlice commented May 4, 2022

One I had re-enabled in the config, and the other had disabled_by set to null in the config yet was being listed as disabled (and the integration was non functional) but after leaving my browser open for 10+ minutes and restarting HA core it seemed to let re-enable the one that had disabled_by set to null.

@AskAlice
Copy link
Author

AskAlice commented May 4, 2022

It seems this is a bug that requires more investigation.

A day after I was able to re-enable a disabled integration, I refreshed, and disabled an integration for the first time since yesterday. Disabling an integration yields the same bug as seen in the video I linked.

I could try and sanitize my configs, upload them to git, and see if I can reproduce in a different homeassistant install. If not, I'm happy to give a developer ssh access to a clone of my HASS installation for use with a VSCode remote, with sensitive info stripped out of it.

@emontnemery
Copy link
Collaborator

emontnemery commented May 5, 2022

after leaving my browser open for 10+ minutes and restarting HA core it seemed to let re-enable the one that had disabled_by set to null

That doesn't make sense, "disabled_by": null means the config entry is not disabled.
Changes to config entries are not immediately updated though, meaning data in .storage/core.config_entries may be stale until it's flushed to disk.
If you stop Home Assistant, a flush is guaranteed, then you can open the file for editing.

It could also be that the the enabling works, but the UI is just not updated.
Are you 100% sure there's no WS traffic?

You can enable WS logging in core like this:

logger:                                                          
  default: info                                                  
  logs:                                                          
    homeassistant.components.websocket_api.http.connection: debug

@loopy321
Copy link

loopy321 commented Jun 3, 2022

I too am having this problem (HA 2022.06.0). The buttons do nothing - like disabling is a one-way ticket:
Recording 2022-06-03 at 10 48 34

@loopy321
Copy link

loopy321 commented Jun 3, 2022

@prageeth
Copy link

prageeth commented Jul 23, 2022

I've had this issue too, seems like the button click on the UI is not actually clicking the button. I'm a frontend dev (Angular, React, Vue, etc) and I had a quick look and noticed that selecting the button on dev tools (by right-clking the button and selecting "Inspect Element") actually shows me another element. It could be a rendering issue on the UI.

However, I managed to trigger the button click via Javascript on the dev tools console using the following command:

document.querySelector('home-assistant').shadowRoot.querySelector('home-assistant-main').shadowRoot.querySelector('app-drawer-layout ha-config-integrations').shadowRoot.querySelector('ha-integration-card[data-domain="ui_lovelace_minimalist"]').shadowRoot.querySelector('ha-card.disabled .actions mwc-button').click()

NOTE: Since the HA frontend uses web components, you have to manually query the shadowRoots, so it's not a simple document.querySelector('foo').click()

The above command specifically cards an integration by name (e.g. ui_lovelace_minimalist) that has been disabled (e.g. ha-card.disabled) and then selects the action button (e.g. .actions mwc-button) to perform a "click" action (e.g. .click()),

If anyone else has the same issue, maybe this will help. In the above command, you can simply change the integration name (ui_lovelace_minimalist in data-domain="ui_lovelace_minimalist") to your integration name.

If you're unsure what your integration name is, you can find this by inspecting the integration cards in the dev tools of your browser.

P.S. I'm using the following versions

Home Assistant 2022.7.6
Frontend 20220707.1

@Seliah
Copy link

Seliah commented Aug 26, 2022

@prageeth Nice! That actually activates the component again.
So it's an UI problem and I think this could be an easy fix.

For now I want to give an alternative method to activate the component which I find a little bit easier to execute:

  1. Open DevTools (in Chrome via F12).
  2. Activate the Element selection Tool (top left in DevTools or press Ctrl+Shift+C in Chrome).
  3. Click on the Activate-Button of the Integration the you want to enable.
  4. Make sure you have the mwc-button selected - not the button:
    image
  5. Go to the Console-Tab in DevTools.
  6. Type $0.click()

Now the integration should be activated again. I hope this helps.

@drthanwho
Copy link

Still seeing this now on Google Chrome either Desktop (Version 106.0.5249.119) or Mobile but does work fine on Microsoft Edge.

@loopy321
Copy link

6. $0.click()

This worked for me. But was easiest to do a CTRL-F and search for the integration name first. Thanks!

Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 31, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants