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

Unexpected error #56

Closed
snp-g opened this issue Nov 28, 2023 · 24 comments
Closed

Unexpected error #56

snp-g opened this issue Nov 28, 2023 · 24 comments

Comments

@snp-g
Copy link

snp-g commented Nov 28, 2023

Hi

when I enter the myVaillant credentials

image

I got this error

image

Could you help me, please?

myPyllant v0.6.1

@snp-g
Copy link
Author

snp-g commented Nov 28, 2023

It seems there is a problem with http to https redirect

2023-11-28 20:55:11.578 DEBUG (MainThread) [myPyllant.api] Session expires in 2023-11-28 21:00:11.578532
2023-11-28 20:55:11.580 DEBUG (MainThread) [myPyllant.api] Starting request TraceRequestStartParams(method='GET', url=URL('https://identity.vaillant-group.com/auth/realms/vaillant-czechrepublic-b2c/protocol/openid-connect/auth'), headers=<CIMultiDict()>)
2023-11-28 20:55:11.674 ERROR (MainThread) [custom_components.mypyllant.config_flow] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/mypyllant/config_flow.py", line 178, in async_step_user
    username = await validate_input(self.hass, user_input)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/config_flow.py", line 86, in validate_input
    await api.login()
  File "/config/deps/lib/python3.11/site-packages/myPyllant/api.py", line 159, in login
    async with self.aiohttp_session.get(
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 624, in _request
    raise ValueError("Can redirect only to http or https")
ValueError: Can redirect only to http or https

@snp-g snp-g changed the title Vaillant Login issue Nov 29, 2023
@pdpelsem
Copy link

I have the same issue.

@snp-g snp-g changed the title Login issue Unxpected error Nov 29, 2023
@snp-g snp-g changed the title Unxpected error Unexpected error Nov 29, 2023
@snp-g
Copy link
Author

snp-g commented Nov 29, 2023

I guess this is a full log, so I hope someone finds it useful in helping to troubleshoot it.

I'm sorry for the formatting of the log which starts here til the end of the post.

`2023-11-29 07:18:10.640 DEBUG (MainThread) [myPyllant.api] Starting request TraceRequestStartParams(method='GET', url=URL('https://identity.vaillant-group.com/auth/realms/vaillant-czechrepublic-b2c/protocol/openid-connect/auth'), headers=<CIMultiDict()>)
2023-11-29 07:18:10.858 DEBUG (MainThread) [myPyllant.api] Got response

        <meta name="viewport" content="width=device-width,initial-scale=1"/>
<script>

if (document.documentElement && document.documentElement.style && document.documentElement.style.setProperty) {
document.documentElement.style.setProperty('--vh', '' + (window.innerHeight * 0.01) + 'px');
}
</script><title>Přihlásit do Vaillant Česká republika</title>

<script src="/auth/resources/6fr79/login/vaillant-czechrepublic-b2c/2632/js/login.js" type="text/javascript"></script>
Vaillant Česká republika

Přihlásit k vašemu účtu

<div id="kc-form">
  <div id="kc-form-wrapper">
        <form id="kc-form-login" onsubmit="login.disabled = true; return true;" action="https://identity.vaillant-group.com/auth/realms/vaillant-czechrepublic-b2c/login-actions/authenticate?session_code=token_removed&amp;execution=**token_removed**&amp;client_id=myvaillant&amp;tab_id=**token_removed**" method="post">
                <div class="form-group">
                    <label for="username" class="">E-mail</label>

                    <input tabindex="1" id="username" placeholder="" class="" name="username" value="" type="email" autofocus autocomplete="off"
                           aria-invalid=""
                    />


                </div>

            <div class="form-group">
                <label for="password" class="">Heslo</label>

                <input tabindex="2" id="password" placeholder="" class="" name="password" type="password" autocomplete="off"
                       aria-invalid=""
                />


            </div>

            <div class="form-group form-settings">
                <div id="kc-form-options">
                    </div>
                    <div class="form-options-wrapper">
                            <span><a tabindex="5" href="/auth/realms/vaillant-czechrepublic-b2c/login-actions/reset-credentials?client_id=myvaillant&amp;tab_id=token_removed">Obnovit heslo</a></span>
                    </div>

              </div>

              <div id="kc-form-buttons" class="form-group">
                  <input type="hidden" id="id-hidden-input" name="credentialId" />
                  <input tabindex="4" class="   " name="login" id="kc-login" type="submit" value="Přihlásit se"/>
              </div>
        </form>
    </div>

</div>





    </div>
  </div>

</div>
Soubor cookie nenalezen. Ujistěte se prosím, že máte v prohlížeči povolené cookies.
  <ul>
    
      <li>
        <a href='https://myvaillant.com/vaillant-pp.html?lang=cs' target="_blank">Prohlášení o ochraně údajů</a>
      </li>
    
      <li>
        <a href='https://myvaillant.com/vaillant-tac.html?lang=cs' target="_blank">Podmínky používání</a>
      </li>
    
  </ul>

<span class="support-id">Support ID: **9479026477f7e6e80997a9c1a6d70ba4**</span>

2023-11-29 07:18:10.858 DEBUG (MainThread) [myPyllant.api] Got login url https://identity.vaillant-group.com/auth/realms/vaillant-czechrepublic-b2c/login-actions/authenticate?session_code=**token_removed**&client_id=myvaillant&tab_id=**token_removed**
2023-11-29 07:18:10.858 DEBUG (MainThread) [myPyllant.api] Starting request TraceRequestStartParams(method='POST', url=URL('https://identity.vaillant-group.com/auth/realms/vaillant-czechrepublic-b2c/login-actions/authenticate'), headers=<CIMultiDict()>)
2023-11-29 07:18:12.018 DEBUG (MainThread) [myPyllant.api] Got response
2023-11-29 07:18:12.018 DEBUG (MainThread) [myPyllant.api] Got login response headers <CIMultiDictProxy('Date': 'Wed, 29 Nov 2023 06:18:10 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Set-Cookie': 'INGRESSCOOKIE=token_removed|token_removed; Path=/auth(?!/(admin|metrics|realms/master).*)/; HttpOnly', 'Referrer-Policy': 'no-referrer', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'X-Robots-Tag': 'none', 'Cache-Control': 'no-store, must-revalidate, max-age=0', 'X-Content-Type-Options': 'nosniff', 'Content-Security-Policy': "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", 'Set-Cookie': 'KC_RESTART=; Version=1; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Max-Age=0; Path=/auth/realms/vaillant-czechrepublic-b2c/; Secure; HttpOnly', 'Set-Cookie': 'KEYCLOAK_IDENTITY=token_removed; Version=1; Path=/auth/realms/vaillant-czechrepublic-b2c/; SameSite=None; Secure; HttpOnly', 'Set-Cookie': 'KEYCLOAK_IDENTITY_LEGACY=token_removed; Version=1; Path=/auth/realms/vaillant-czechrepublic-b2c/; Secure; HttpOnly', 'Set-Cookie': 'KEYCLOAK_SESSION=vaillant-czechrepublic-token_removed; Version=1; Expires=Wed, 29-Nov-2023 16:18:10 GMT; Max-Age=36000; Path=/auth/realms/vaillant-czechrepublic-b2c/; SameSite=None; Secure', 'Set-Cookie': 'KEYCLOAK_SESSION_LEGACY=vaillant-czechrepublic-token_removed; Version=1; Expires=Wed, 29-Nov-2023 16:18:10 GMT; Max-Age=36000; Path=/auth/realms/vaillant-czechrepublic-b2c/; Secure', 'Set-Cookie': 'KEYCLOAK_REMEMBER_ME=; Version=1; Comment=Expiring cookie; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Max-Age=0; Path=/auth/realms/vaillant-czechrepublic-b2c/; Secure; HttpOnly', 'P3P': 'CP="This is not a P3P policy!"', 'X-XSS-Protection': '1; mode=block', 'Location': 'enduservaillant.page.link://login?session_state=token_removed&code=token_removed')>
2023-11-29 07:18:12.019 DEBUG (MainThread) [myPyllant.api] Got location from authorize endpoint: enduservaillant.page.link://login?session_state=token_removed&code=token_removed
2023-11-29 07:18:12.019 DEBUG (MainThread) [myPyllant.api] Starting request TraceRequestStartParams(method='POST', url=URL('https://identity.vaillant-group.com/auth/realms/vaillant-czechrepublic-b2c/protocol/openid-connect/token'), headers=<CIMultiDict()>)
2023-11-29 07:18:12.171 DEBUG (MainThread) [myPyllant.api] Got response {"access_token":"token_removed","token_type":"Bearer","not-before-policy":0,"session_state":"token_removed","scope":"profile offline_access email"}
2023-11-29 07:18:12.171 DEBUG (MainThread) [myPyllant.api] Got session {'access_token': 'token_removed', 'expires_in': 300, 'refresh_expires_in': 0, 'refresh_token': 'token_removed', 'token_type': 'Bearer', 'not-before-policy': 0, 'session_state': 'token_removed', 'scope': 'profile offline_access email'}
2023-11-29 07:18:12.171 DEBUG (MainThread) [myPyllant.api] Session expires in 2023-11-29 07:23:12.171493
2023-11-29 07:18:12.175 DEBUG (MainThread) [myPyllant.api] Starting request TraceRequestStartParams(method='GET', url=URL('https://identity.vaillant-group.com/auth/realms/vaillant-czechrepublic-b2c/protocol/openid-connect/auth'), headers=<CIMultiDict()>)
2023-11-29 07:18:12.326 ERROR (MainThread) [custom_components.mypyllant.config_flow] Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/mypyllant/config_flow.py", line 178, in async_step_user
username = await validate_input(self.hass, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mypyllant/config_flow.py", line 86, in validate_input
await api.login()
File "/config/deps/lib/python3.11/site-packages/myPyllant/api.py", line 159, in login
async with self.aiohttp_session.get(
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in aenter
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 624, in _request
raise ValueError("Can redirect only to http or https")
ValueError: Can redirect only to http or https`

@hatage
Copy link

hatage commented Nov 29, 2023

I have the same issue.

@signalkraft
Copy link
Owner

Could you please test if everything works in v0.6.0? That would help narrow it down.

@snp-g
Copy link
Author

snp-g commented Nov 30, 2023

Hi Signalkraft

thank you for your support. I tried and it works. It found 5 devices.

image

If you want to troubleshoot v0.6.1 still please let me know.

@Marown
Copy link

Marown commented Nov 30, 2023

I have the same problem

@misterdeer
Copy link

Same problem with v0.6.1 here. Went back to v0.6.0 and it works.

@fellek
Copy link

fellek commented Nov 30, 2023

Could you please test if everything works in v0.6.0? That would help narrow it down.
Did not test 0.6.0, but downgrade to 0.5.5b worked for me. Upgrade to 0.6.1 worked also, after successfull login.

@misterdeer
Copy link

Could you please test if everything works in v0.6.0? That would help narrow it down.
Did not test 0.6.0, but downgrade to 0.5.5b worked for me. Upgrade to 0.6.1 worked also, after successfull login.

Yes, v0.6.0 works.

@MichaelLachmann
Copy link

Hi,
initial configuration with v0.6.1 didn't work. Downgrading to v0.6.0 allowed me to add the integration.
After that upgrade to v0.6.1 worked and the integration is still working.

@misterdeer
Copy link

Hi, initial configuration with v0.6.1 didn't work. Downgrading to v0.6.0 allowed me to add the integration. After that upgrade to v0.6.1 worked and the integration is still working.

For me v0.6.1 did not work anymore after restart. I'm still back on v0.6.0.

@signalkraft
Copy link
Owner

@misterdeer
Copy link

This should be fixed in https://github.com/signalkraft/mypyllant-component/releases/tag/v0.6.2

Great, it works! Many thanks!

@mariandodu
Copy link

This error originated from a custom integration.

Logger: custom_components.mypyllant.config_flow
Source: custom_components/mypyllant/config_flow.py:180
Integration: myVAILLANT (documentation, issues)
First occurred: 15:27:05 (1 occurrences)
Last logged: 15:27:05

Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/mypyllant/config_flow.py", line 180, in async_step_user
self._abort_if_unique_id_configured()
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1597, in _abort_if_unique_id_configured
raise data_entry_flow.AbortFlow(error)
homeassistant.data_entry_flow.AbortFlow: Flow aborted: already_configured

@Technikie
Copy link

Hello, i've got exactly the same ( In Dutch) as mariandodu:

Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.mypyllant.config_flow
Source: custom_components/mypyllant/config_flow.py:180
Integration: myVAILLANT (documentation, issues)
First occurred: 21:21:29 (1 occurrences)
Last logged: 21:21:29

Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/mypyllant/config_flow.py", line 180, in async_step_user
self._abort_if_unique_id_configured()
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1597, in _abort_if_unique_id_configured
raise data_entry_flow.AbortFlow(error)
homeassistant.data_entry_flow.AbortFlow: Flow aborted: already_configured

@signalkraft
Copy link
Owner

Could you test with the latest release and let me know if this persists? Also, does this error affect the functionality at all? Or does everything work despite the error?

@snp-g
Copy link
Author

snp-g commented Jan 1, 2024

HI,

thank you, however did not help, still an Unexpected Error came.

2024-01-01 09:14:36.257 ERROR (MainThread) [custom_components.mypyllant.config_flow] Unexpected exception Traceback (most recent call last): File "/config/custom_components/mypyllant/config_flow.py", line 179, in async_step_user await self.async_set_unique_id(username) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1614, in async_set_unique_id raise data_entry_flow.AbortFlow("already_in_progress") homeassistant.data_entry_flow.AbortFlow: Flow aborted: already_in_progress

@signalkraft
Copy link
Owner

I looked at the code again, that should only happen if you've previously configured the integration with the same username. Is that the case? Can you maybe delete it and try again if it is?

@snp-g
Copy link
Author

snp-g commented Jan 3, 2024

Hi,

firstly, I tried to connect over the existing configuration and I realized there could be a kind of issue so I deleted the configuration.

image

Then I tried to initiate it without configuration and logs are after I did it. I do not know if that is enough or do I need to do anything more.

@signalkraft
Copy link
Owner

Are you still facing this issue?

@mariandodu
Copy link

mariandodu commented Feb 24, 2024 via email

@mariandodu
Copy link

mariandodu commented Feb 24, 2024 via email

@signalkraft
Copy link
Owner

Check #54 please

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

10 participants