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

Spotcast can't find Spotify integration even if it's installed #258

Closed
mfabiani53 opened this issue Nov 2, 2021 · 18 comments
Closed

Spotcast can't find Spotify integration even if it's installed #258

mfabiani53 opened this issue Nov 2, 2021 · 18 comments
Assignees
Labels
bug Something isn't working

Comments

@mfabiani53
Copy link

mfabiani53 commented Nov 2, 2021

Describe the bug
After installing the latest release (v. 3.1.18) the integration is not loaded with the following errors:

2021-10-31 15:22:33 ERROR (SyncWorker_1) [custom_components.spotcast.helpers] spotify integration not found
2021-10-31 15:22:33 ERROR (SyncWorker_1) [custom_components.spotcast] Spotify integration was not found, aborting setup...
2021-10-31 15:22:33 ERROR (MainThread) [homeassistant.setup] Setup failed for spotcast: Integration failed to initialize.
2021-10-31 15:22:33 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform spotcast.sensor: Unable to set up component.

It seems spotcast is not recognizing the spotify integration regularly installed as you can see:

image

and also from /.storage/core_entity_registry it is completely loaded:

            {
                "entity_id": "media_player.spotify_mfabiani53",
                "config_entry_id": "xxxxxxxxxxxxxxxxxxxxxxx",
                "device_id": "xxxxxxxxxxxxxxxxxxxxx",
                "area_id": null,
                "unique_id": "mfabiani53",
                "platform": "spotify",
                "name": null,
                "icon": null,
                "disabled_by": null,
                "capabilities": {},
                "supported_features": 0,
                "device_class": null,
                "unit_of_measurement": null,
                "original_name": "Spotify mfabiani53",
                "original_icon": "mdi:spotify"
            },

When reverting back to the 3.1.17 release all is working ok !
I am trying to use the using latest version of spotcast v. 3.1.8
I am using latest stable version of Home Assistant

@snp88
Copy link

snp88 commented Nov 3, 2021

Have the same issue
Its not show always bug typically for me its show when i update something and do the soft reboot of HA via Gui button

Workaround is to completely restart your virtual or real machine because you can't do soft reboot configuration check show issue in the config

pull the plug ;)

@mfabiani53
you might want to change the title of the error to something more meaningful.
e.g. Spotcast can't find Spotify integration even if it's installed

@mfabiani53 mfabiani53 changed the title Latest release problems Spotcast can't find Spotify integration even if it's installed Nov 3, 2021
@mfabiani53
Copy link
Author

@snp88 you mean i must turn off completely my raspberry and then turn on again?

@hmmbob
Copy link
Contributor

hmmbob commented Nov 3, 2021

Possible regression of #255

@Darkfull-Dante

@snp88
Copy link

snp88 commented Nov 3, 2021

@mfabiani53 i have my HA in virtual machine but in short word yes if you unplug your raspberry and turn on again it should be ok this is what i do with my HA but my instance is on Virtual machine

@hmmbob @Darkfull-Dante its look like some condition race ;) and sometimes Spotify integration fail this race

@fcusson
Copy link
Collaborator

fcusson commented Nov 3, 2021

thank you for the report @snp88 && @hmmbob, during testing I never add that race condition come up. We are releasing a new feature today from a PR we receive, we will simply keep the error message for the time being to be able to troubleshoot. I'll look into a more elegant way to test the presence of the Spotify integration

@fcusson
Copy link
Collaborator

fcusson commented Nov 3, 2021

I did a quick check of the manifest file and dev documentation and we could try and add spotify in the after_dependencies section of the manifest. For the current release I will go with simply the quick fix (not aborting the setup).

This potential solution still need testing before implementing

@fcusson
Copy link
Collaborator

fcusson commented Nov 3, 2021

#259 was merged with v3.6.19.

@hmmbob @snp88, I will keep this issue open for the moment, please report if the problem persists. I will work and test the after_dependencies solution. If I release a beta with the fix is any of you able to test under your setup? My current dev env only permits me to test the Docker install

@fcusson fcusson self-assigned this Nov 3, 2021
@fcusson fcusson added the bug Something isn't working label Nov 3, 2021
@fcusson fcusson mentioned this issue Nov 3, 2021
@snp88
Copy link

snp88 commented Nov 4, 2021

Hi
@Darkfull-Dante I update to newest spotcast and problem persist
but now beside errors spotcast work

image

@fcusson
Copy link
Collaborator

fcusson commented Nov 4, 2021

@snp88 it is normal, v3.6.19 only reverts the aborting of the setup for the moment, I still maintain the error log as a check, I'll be working on a beta release that contains the potential fix. I'm currently running that fix in my dev env without problem, sadly it doesn't mean much because I never had the race condition you had.

Only the first 2 logs (timewize) are related to the regression in #255. The 2 after that indicate the spotify integration wasn't able to get the playlists, because of taht spotcat playlist sensor fails. That could potentialy be another bug different than the one. Possibly a change in the spotify api on how to get playlist.

@fcusson
Copy link
Collaborator

fcusson commented Nov 5, 2021

@snp88 can you confirm the issue with loading Spotcast integration is gone following v3.6.20? You should now have no error logs regarding finding the Spotify integration

@mfabiani53
Copy link
Author

mfabiani53 commented Nov 5, 2021

On my system I still get errors in loading spotcast integration also with 3.1.20

custom_components.spotcast.helpers] spotify integration not found
2021-11-05 20:20:43 ERROR (SyncWorker_0) [custom_components.spotcast] Spotify integration was not found, please verify integration is functionnal. Could result in python error...

And the spotcast service is not working...

@fcusson
Copy link
Collaborator

fcusson commented Nov 5, 2021

@snp88 ok, thank you for the information, so even with forcing spotcast to load after spotify there is still a possible race condition for certain user. I'll remove the abort setup for following releases. Will simply keep it a debug log for the moment.

fcusson added a commit that referenced this issue Nov 5, 2021
#258 still a problem, will keep error message as debug for future release
@mfabiani53
Copy link
Author

@Darkfull-Dante are you referring to my latest message?

@hmmbob
Copy link
Contributor

hmmbob commented Nov 6, 2021

@mfabiani53 and @snp88: I wonder what will happen if you:

  • disable spotcast (remove from configuration.yaml or put # in front of all spotcast related lines)
  • delete the spotify integration,
  • restart HA
  • add spotify again
  • enable spotcast

As we only see 2 reports now (from you both), and Spotcast is used quite a bit, I am thinking it might be something locally. It's worth trying to see if it fixes the issue.

@fcusson
Copy link
Collaborator

fcusson commented Nov 6, 2021

oh sorry @mfabiani53, I referred to the wrong user, yes I was talking about your last message. Can you verify if the problem still persist in 3.6.21?

@mfabiani53
Copy link
Author

Yes asap I'll let you know...

@snp88
Copy link

snp88 commented Nov 6, 2021

Hi All

sorry for late response
since i update to the version .21 issue not show in my instance.
I trigger few restarts and no problem so in my opinion we are good to close this
@Darkfull-Dante thx for all work and fast reaction :)

@fcusson
Copy link
Collaborator

fcusson commented Nov 6, 2021

No problem, thank you for the testing. I'll keep this ticket around so we can eventually have an elegant way to test for the presence of the spotify integration

@fcusson fcusson closed this as completed Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants