home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.4k stars 30.65k forks source link

Opower "Unknown Error" #120282

Closed gtbdf1 closed 1 week ago

gtbdf1 commented 4 months ago

The problem

Selected Add Entry then selected AEP Ohio from dropdown list, entered credentials for account then clicked submit. Integration appeared to be processing request then after a few seconds, integration displayed "Unknown error occurred".

What version of Home Assistant Core has the issue?

core-2024.6.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Opower

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: frontend.js.latest.202406101
Source: components/system_log/__init__.py:333
First occurred: June 23, 2024 at 7:47:41 PM (45 occurrences)
Last logged: 12:00:29 AM

Failed to format translation for key 'component.opower.config.step.reauth_confirm.title' in language 'en'. Error: The intl string context variable "name" was not provided to the string "Authentication expired for {name}"

Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
First occurred: June 23, 2024 at 7:47:55 PM (7 occurrences)
Last logged: 12:01:37 AM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 70, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/opower/config_flow.py", line 147, in async_step_reauth_confirm
    errors = await _validate_login(self.hass, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/opower/config_flow.py", line 50, in _validate_login
    await api.async_login()
  File "/usr/local/lib/python3.12/site-packages/opower/opower.py", line 197, in async_login
    self.access_token = await self.utility.async_login(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/opower/utilities/aepbase.py", line 158, in async_login
    await async_auth_saml(session, url)
  File "/usr/local/lib/python3.12/site-packages/opower/utilities/helpers.py", line 34, in async_auth_saml
    assert action_url.endswith(".opower.com/sp/ACS.saml2")
AssertionError

Additional information

No response

home-assistant[bot] commented 4 months ago

Hey there @tronikos, mind taking a look at this issue as it has been labeled with an integration (opower) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `opower` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign opower` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


opower documentation opower source (message by IssueLinks)

tronikos commented 4 months ago

The Failed to format translation for key 'component.opower.config.step.reauth_confirm.title' in language 'en'. Error: The intl string context variable "name" was not provided to the string "Authentication expired for {name}" was fixed in https://github.com/home-assistant/core/pull/119627 The assert action_url.endswith(".opower.com/sp/ACS.saml2") will have to be fixed by someone that has AEP utility. Can you login on the utility website and see energy usage there?

greggitter commented 4 months ago

Opower hadn't been working on AEP's website a couple days ago, but today (now) it is working again. Still not working via HA though...maybe soon. Happens sporadically.

Maralai commented 3 months ago

https://www.indianamichiganpower.com/account/usage/

image

I left feedback on their site, letting them know it wasn't working. Below are console logs:

/widgets/sso/opower?token=<removed>.....domainwww.indianamichiganpower.com:1  An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
chrome-error://chromewebdata/:1  Refused to display 'https://custsaml.indianamichiganpower.com/' in a frame because it set 'X-Frame-Options' to 'deny'.
VM300:647  Uncaught TypeError: Cannot read properties of null (reading 'classList')
    at HTMLDocument.onDocumentLoad (VM300:647:19)
onDocumentLoad @ VM300:647
usage/:3762 isInitSuccess=false
scripts-formend?v=95PfGHPn5hZmkDgfZQAaM4bxsE-m2BqQoAzxm3hKkFE1:839 loaded
usage/:3766 Checking for success before patience class. isInitSuccess=false
usage/:3771 Maximum wait time reached. isInitSuccess=false
issue-triage-workflows[bot] commented 2 weeks ago

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.