core icon indicating copy to clipboard operation
core copied to clipboard

Integration Setup Unknown error occurred

Open GtAnders opened this issue 1 year ago • 3 comments

The problem

Integration Setup is not working. Gets Unknown erroor occurred.

What version of Home Assistant Core has the issue?

2024.10.1

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

2024.10.0

Link to integration documentation on our website

https://www.home-assistant.io/integrations/vicare

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

GtAnders avatar Oct 14 '24 19:10 GtAnders

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

Code owner commands

Code owners of vicare 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 vicare 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)


vicare documentation vicare source (message by IssueLinks)

home-assistant[bot] avatar Oct 14 '24 19:10 home-assistant[bot]

Please Share log and diagnostic file.

CFenner avatar Oct 14 '24 19:10 CFenner

Here are the log:

Logger: ViCare Source: components/vicare/init.py:69 First occurred: October 9, 2024 at 9:05:50 PM (31 occurrences) Last logged: 12:25:04 PM

Missing 'data' property when fetching installations

Before this problem I hade another problem so I uninstalled it and tried again. Do not know if it helps but here are the log from the other problem:

Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: October 9, 2024 at 9:05:50 PM (1 occurrences) Last logged: October 9, 2024 at 9:05:50 PM

Error setting up entry ViCare for vicare Traceback (most recent call last):   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup     result = await component.async_setup_entry(hass, self)              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/src/homeassistant/homeassistant/components/vicare/init.py", line 48, in async_setup_entry     await hass.async_add_executor_job(setup_vicare_api, hass, entry)   File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run     result = self.fn(*self.args, **self.kwargs)              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/src/homeassistant/homeassistant/components/vicare/init.py", line 80, in setup_vicare_api     vicare_api = vicare_login(hass, entry.data)                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/src/homeassistant/homeassistant/components/vicare/init.py", line 69, in vicare_login     vicare_api.initWithCredentials(   File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCare.py", line 25, in initWithCredentials     self.initWithExternalOAuth(ViCareOAuthManager(   File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCare.py", line 30, in initWithExternalOAuth     self.__loadInstallations()   File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCare.py", line 45, in __loadInstallations     raise PyViCareInvalidDataError(installations) PyViCare.PyViCareUtils.PyViCareInvalidDataError: {'viErrorId': 'req-75cbe069f3a94158955867a9343239c6', 'statusCode': 401, 'errorType': 'UNAUTHORIZED', 'message': 'Request contain invalid token', 'error': 'NO TOKEN AVAILABLE'}

Den 14 okt. 2024 21:19, kI 21:19, Christopher Fenner @.***> skrev:

Please Share log and diagnostic file.

-- Reply to this email directly or view it on GitHub: https://github.com/home-assistant/core/issues/128382#issuecomment-2412039762 You are receiving this because you authored the thread.

Message ID: @.***>

GtAnders avatar Oct 15 '24 10:10 GtAnders

Please Share log and diagnostic file.

Hello @CFenner!

Is it something more you need from me?

Best Regards

//Anders

GtAnders avatar Oct 24 '24 09:10 GtAnders

Yes, the diagnostic file. Select the vicare integration, click '...' and download diagnostic file.

My is my name in your log file..

'statusCode': 401, 'errorType': 'UNAUTHORIZED', 'message': 'Request contain invalid token', 'error': 'NO TOKEN AVAILABLE'} Den 14 okt. 2024 21:19, kI 21:19, Christopher Fenner ***@***.***> skrev:

CFenner avatar Oct 24 '24 09:10 CFenner

Okej but since I tried to uninstall the integration and install it again I can not reach the diagnostik file.

I reach config but trying to submit the config settings it says Unknown error ocured.

Is there any way I can reach the files another way?

Den 24 okt. 2024 11:39, kI 11:39, Christopher Fenner @.***> skrev:

Yes, the diagnostic file. Select the vicare integration, click '...' and download diagnostic file.

My is my name in your log file..

-- Reply to this email directly or view it on GitHub: https://github.com/home-assistant/core/issues/128382#issuecomment-2434788397 You are receiving this because you authored the thread.

Message ID: @.***>

GtAnders avatar Oct 24 '24 09:10 GtAnders

The credentials seem to be invalid. There is no valid token generated.

CFenner avatar Oct 24 '24 10:10 CFenner

Okej, where to generate token? I follow instructions on Homeassistant integrations page.

On developer portal I can generate IoT or user.

Den 24 okt. 2024 12:29, kI 12:29, Christopher Fenner @.***> skrev:

The credentials seem to be invalid. There is no valid token generated.

-- Reply to this email directly or view it on GitHub: https://github.com/home-assistant/core/issues/128382#issuecomment-2434898722 You are receiving this because you authored the thread.

Message ID: @.***>

GtAnders avatar Oct 24 '24 11:10 GtAnders

The token is generated from username password and clientID in PyViCare. You do not need to create a token yourself.

CFenner avatar Oct 24 '24 11:10 CFenner

Just the clientID

CFenner avatar Oct 24 '24 11:10 CFenner

Made it all from start even in Viessman Developer Portal but it doesnt work.

ClientID = copy paste, e-mail and password What can go wrong?

Can it be because of the previus  installation?

Den 24 okt. 2024 13:52, kI 13:52, Christopher Fenner @.***> skrev:

Just the clientID

-- Reply to this email directly or view it on GitHub: https://github.com/home-assistant/core/issues/128382#issuecomment-2435064943 You are receiving this because you authored the thread.

Message ID: @.***>

GtAnders avatar Oct 24 '24 19:10 GtAnders

Can you post the log again, what is the error now?

It could be that your clientID is not activated yet or deactivated due to API plan change.

CFenner avatar Oct 24 '24 19:10 CFenner

I made the new API 7h ago. Here are the log I get:

Logger: ViCare Source: components/vicare/init.py:69 First occurred: 11:55:48 AM (18 occurrences) Last logged: 10:04:20 PM

Missing 'data' property when fetching installations

⁣Skaffa BlueMail för Android ​

Den 24 okt. 2024 21:23, kI 21:23, Christopher Fenner @.***> skrev:

Can you post the log again, what is the error now?

It could be that your clientID is not activated yet or deactivated due to API plan change.

-- Reply to this email directly or view it on GitHub: https://github.com/home-assistant/core/issues/128382#issuecomment-2436173031 You are receiving this because you authored the thread.

Message ID: @.***>

GtAnders avatar Oct 24 '24 20:10 GtAnders

Here are another log with same timestamp:

Logger: aiohttp.server Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:448 First occurred: 11:55:48 AM (18 occurrences) Last logged: 10:04:20 PM

Error handling request Traceback (most recent call last):   File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request     resp = await request_handler(request)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 559, in _handle     return await handler(request)            ^^^^^^^^^^^^^^^^^^^^^^   File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 117, 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 77, 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 74, 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 370, in async_configure     result = await self._async_configure(flow_id, user_input)              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 417, in _async_configure     result = await self._async_handle_step(              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 520, in _async_handle_step     result: _FlowResultT = await getattr(flow, method)(user_input)                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/src/homeassistant/homeassistant/components/vicare/config_flow.py", line 66, in async_step_user     await self.hass.async_add_executor_job(   File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run     result = self.fn(*self.args, **self.kwargs)              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/src/homeassistant/homeassistant/components/vicare/init.py", line 69, in vicare_login     vicare_api.initWithCredentials(   File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCare.py", line 25, in initWithCredentials     self.initWithExternalOAuth(ViCareOAuthManager(   File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCare.py", line 30, in initWithExternalOAuth     self.__loadInstallations()   File "/usr/local/lib/python3.12/site-packages/PyViCare/PyViCare.py", line 45, in __loadInstallations     raise PyViCareInvalidDataError(installations) PyViCare.PyViCareUtils.PyViCareInvalidDataError: {'viErrorId': 'req-7714ee57915e46889fe83e6a84551508', 'statusCode': 401, 'errorType': 'UNAUTHORIZED', 'message': 'Request contain invalid token', 'error': 'NO TOKEN AVAILABLE'}

⁣Skaffa BlueMail för Android ​

Den 24 okt. 2024 21:23, kI 21:23, Christopher Fenner @.***> skrev:

Can you post the log again, what is the error now?

It could be that your clientID is not activated yet or deactivated due to API plan change.

-- Reply to this email directly or view it on GitHub: https://github.com/home-assistant/core/issues/128382#issuecomment-2436173031 You are receiving this because you authored the thread.

Message ID: @.***>

GtAnders avatar Oct 24 '24 20:10 GtAnders

Please verify that you use the same Account for ViCare app, ViCare Developer Portal and ViCare Home Assistant integration.

So the ClientID must be created with the account that is linked to your heating device.

CFenner avatar Oct 24 '24 20:10 CFenner

Same e-mail and same password on both app and developer portal. Then used in config on HA. I have done it before with same credentials and got it running.

Den 24 okt. 2024 22:23, kI 22:23, Christopher Fenner @.***> skrev:

Please verify that you use the same Account for ViCare app, ViCare Developer Portal and ViCare Home Assistant integration.

-- Reply to this email directly or view it on GitHub: https://github.com/home-assistant/core/issues/128382#issuecomment-2436272544 You are receiving this because you authored the thread.

Message ID: @.***>

GtAnders avatar Oct 25 '24 03:10 GtAnders

I have the same issue

FrancescoFdd5 avatar Nov 14 '24 22:11 FrancescoFdd5

Same here, Have you found something ? :-)

MrAurik avatar Dec 13 '24 14:12 MrAurik

You both have also NO TOKEN AVAILABLE in the logs?

PyViCare.PyViCareUtils.PyViCareInvalidDataError: {'viErrorId': 'req-7714ee57915e46889fe83e6a84551508', 'statusCode': 401, 'errorType': 'UNAUTHORIZED', 'message': 'Request contain invalid token', 'error': 'NO TOKEN AVAILABLE'}

CFenner avatar Dec 13 '24 14:12 CFenner

Hello.

Yes it seems to :

`Logger: aiohttp.server Source: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:451 First occurred: 06:47:59 (2 occurrences) Last logged: 06:48:44

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, 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 210, 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 86, 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 74, 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 367, 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( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ flow, cur_step["step_id"], user_input ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ 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/vicare/config_flow.py", line 65, in async_step_user await self.hass.async_add_executor_job( vicare_login, self.hass, user_input ) File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/vicare/init.py", line 69, in vicare_login vicare_api.initWithCredentials( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ entry_data[CONF_USERNAME], ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<2 lines>... hass.config.path(STORAGE_DIR, _TOKEN_FILENAME), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/local/lib/python3.13/site-packages/PyViCare/PyViCare.py", line 25, in initWithCredentials self.initWithExternalOAuth(ViCareOAuthManager( ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ username, password, client_id, token_file)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/PyViCare/PyViCare.py", line 30, in initWithExternalOAuth self.__loadInstallations() ~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/usr/local/lib/python3.13/site-packages/PyViCare/PyViCare.py", line 45, in __loadInstallations raise PyViCareInvalidDataError(installations) PyViCare.PyViCareUtils.PyViCareInvalidDataError: {'viErrorId': 'req-0b4016df2e624121851a8ab5efef3d20', 'statusCode': 401, 'errorType': 'UNAUTHORIZED', 'message': 'Request contain invalid token', 'error': 'NO TOKEN AVAILABLE'} `

MrAurik avatar Dec 17 '24 05:12 MrAurik

Please go to config/.storage and remove the token file vicare_token.save. When you now reload the integration it should create a new one. If that still fails, please remove the integration and setup again.

CFenner avatar Dec 17 '24 07:12 CFenner

perfect, it works !

Thank's a lot ! :-D

MrAurik avatar Dec 17 '24 09:12 MrAurik

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.