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

Проблемы с авторизацией (No credentials provided) #3

Open
empty-child opened this issue Aug 7, 2021 · 6 comments

Comments

@empty-child
Copy link

Установил все по инструкции, вместе с интеграцией яндекс станции (в ней авторизовался), но при попытке транслировать контент на устройство появляется ошибка "Unknown error", а в логах "No credentials provided". Попытки добавить поле credentials в configuration.yaml не помогла. При установке интеграции вопросов о токене/логин-пароле не было. Помогло только ручное добавление токена в core.config_entries (логику чтения конфигов понять не смог, уже ни питон не помню, ни доки по HA читать неохота).

Home Assistant 2021.8.2

@alryaz
Copy link
Owner

alryaz commented Aug 7, 2021

Метод авторизации по юзернейму с паролем интегрирован, однако с ним имеются определенные трудности, поэтому он является "не вырезанным тестовым функционалом".

По поводу того, что с Яндекс Станцией не удалось авторизоваться требуется полностью читать лог; при ошибке авторизации с Яндекс Станцией любая ошибка съедается (но не забывается). Если у Вас имеются конфиденциальные данные в логах, пришлите, пожалуйста, в Телеграмм: @alryaz.

@empty-child
Copy link
Author

У меня нет станции, я все провернул через авторизацию в аккаунт через интеграцию AlexxIT/YandexStation (и то только для токена) и больше ничего. Проблема как раз в подсовывании в Вашу интеграцию токена. Вроде вижу поле credentials в конфигах, но заполнение подполя x_token ни к чем не приводит

@Evgeniy-Elo
Copy link

У меня тоже такая ошибка, пробовал переустанавливать интеграцию, не помогло.
Эта ошибка возникла в кастомной интеграции.

Logger: custom_components.yandex_music_browser.default
Source: custom_components/yandex_music_browser/default.py:100
Integration: Браузер Яндекс Музыки (documentation, issues)
First occurred: 10:53:37 (1 occurrences)
Last logged: 10:53:37

Default authentication failed: No credentials provided

и вот такая

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/yandex_music_browser/default.py:102
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:53:37 (1 occurrences)
Last logged: 10:53:37

[139804868138608] Error handling message: Unknown error (unknown_error)
Traceback (most recent call last):
File "/config/custom_components/yandex_music_browser/default.py", line 98, in async_get_music_browser
authentication = await async_authenticate_using_config_credentials(hass)
File "/config/custom_components/yandex_music_browser/default.py", line 51, in async_authenticate_using_config_credentials
raise YandexMusicBrowserAuthenticationError("No credentials provided")
custom_components.yandex_music_browser.media_browser.YandexMusicBrowserAuthenticationError: No credentials provided

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/media_player/init.py", line 1180, in websocket_browse_media
payload = await player.async_browse_media(media_content_type, media_content_id)
File "/config/custom_components/yandex_music_browser/patches/generic.py", line 138, in _patch_generic_async_browse_media
yandex_browse_object = await _patch_root_async_browse_media(
File "/config/custom_components/yandex_music_browser/patches/_base.py", line 19, in _patch_root_async_browse_media
music_browser = await async_get_music_browser(self)
File "/config/custom_components/yandex_music_browser/default.py", line 102, in async_get_music_browser
raise YandexMusicBrowserAuthenticationError(
custom_components.yandex_music_browser.media_browser.YandexMusicBrowserAuthenticationError: Could not authenticate with any of the provided patches

@dronix27
Copy link

У меня тоже такая ошибка, пробовал переустанавливать интеграцию, не помогло. Эта ошибка возникла в кастомной интеграции.

Logger: custom_components.yandex_music_browser.default Source: custom_components/yandex_music_browser/default.py:100 Integration: Браузер Яндекс Музыки (documentation, issues) First occurred: 10:53:37 (1 occurrences) Last logged: 10:53:37

Default authentication failed: No credentials provided

и вот такая

Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/yandex_music_browser/default.py:102 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 10:53:37 (1 occurrences) Last logged: 10:53:37

[139804868138608] Error handling message: Unknown error (unknown_error) Traceback (most recent call last): File "/config/custom_components/yandex_music_browser/default.py", line 98, in async_get_music_browser authentication = await async_authenticate_using_config_credentials(hass) File "/config/custom_components/yandex_music_browser/default.py", line 51, in async_authenticate_using_config_credentials raise YandexMusicBrowserAuthenticationError("No credentials provided") custom_components.yandex_music_browser.media_browser.YandexMusicBrowserAuthenticationError: No credentials provided

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/media_player/init.py", line 1180, in websocket_browse_media payload = await player.async_browse_media(media_content_type, media_content_id) File "/config/custom_components/yandex_music_browser/patches/generic.py", line 138, in _patch_generic_async_browse_media yandex_browse_object = await _patch_root_async_browse_media( File "/config/custom_components/yandex_music_browser/patches/_base.py", line 19, in _patch_root_async_browse_media music_browser = await async_get_music_browser(self) File "/config/custom_components/yandex_music_browser/default.py", line 102, in async_get_music_browser raise YandexMusicBrowserAuthenticationError( custom_components.yandex_music_browser.media_browser.YandexMusicBrowserAuthenticationError: Could not authenticate with any of the provided patches

Поставил через Hacs версию main. Заработало. Возможно, глюк Хакса.

@tjmaru
Copy link

tjmaru commented Oct 2, 2022

тоже пробовал поставить из main, мне не помогло.
но помогло вытащить токен напрямую из yandex_station интеграции

можете попробовать также
токен искать в файле .storage/core.config_entries

{
        "entry_id": "longid",
        "version": 1,
        "domain": "yandex_station",
        "title": "your_yandex_login",
        "data": {
          "x_token": "your_token", # <- your tokent copy it to the config
          "music_token": null,
          "cookie": "verylongstring"
        },
        "options": {},
        "pref_disable_new_entities": false,
        "pref_disable_polling": false,
        "source": "user",
        "unique_id": "your_yandex_login",
        "disabled_by": null
      }

here is config

yandex_music_browser:
  language: ru
  credentials:
    x_token: "put_your_token_here"
  menu_options:
    - new_releases
    - genres

@futuro135
Copy link

Спасибо @tjmaru и @popsodav из другой ветке. У меня заработало!

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

6 participants