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
74.18k stars 31.15k forks source link

Yamaha integration fails to start after upgrade to 2024.8 #124087

Closed avwuff closed 2 months ago

avwuff commented 3 months ago

The problem

I was running Yamaha 2024.1. After upgrading to 2024.8, the Yamaha component no longer starts. This is the error I see in the logs tab:

Logger: homeassistant.components.media_player
Source: helpers/entity_platform.py:408
Integration: Media player ([documentation](https://www.home-assistant.io/integrations/media_player), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+media_player%22))
First occurred: 3:10:21 PM (1 occurrences)
Last logged: 3:10:21 PM
Setup of platform yamaha is taking longer than 60 seconds. Startup will proceed without waiting any longer.

I found this previous issue. I experienced this problem with both 2024.8.1 and 2024.8.2 https://github.com/home-assistant/core/issues/123517

What version of Home Assistant Core has the issue?

core-2024.8.1 and core-2024.8.2

What was the last working version of Home Assistant Core?

core-2024.7.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

yamaha

Link to integration documentation on our website

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

Diagnostics information

I don't seem to be able to enable debug logging, since the integration does not appear on the Integrations page.

Example YAML snippet

media_player:
  - platform: yamaha
    host: 192.168.2.17
    source_ignore:
    source_names:
      HDMI1: "PC"
      AV2: "Vinyl"

Anything in the logs that might be useful for us?

Nothing that I can see.

Additional information

It's a Yamaha RX-A660, and works fine otherwise. Something that changed recently is causing this break.

home-assistant[bot] commented 3 months ago

yamaha documentation yamaha source

home-assistant[bot] commented 3 months ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (media_player) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `media_player` 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 media_player` 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)


media_player documentation media_player source (message by IssueLinks)

avwuff commented 3 months ago

Hey @pssc, I think this change in your recent PR https://github.com/home-assistant/core/pull/122676 caused the issue...

I think the call to rxv.find(): causes the integration to take longer than 60 seconds to start up, which causes HA to kill it.

Is there a reason we need to use find when the IP of the receiver is already known? Would you be able to revert that change? Thank you!

joocee415 commented 3 months ago

This is happening with almost all my addons. I think there are a lot of issues with the latest update...not sure why they're doing this so often when they're just breaking this. Will roll back to my backup until they figure things out.

bluemonkeysuit07 commented 3 months ago

upgraded to HAOS 13.0 and supervisor to 2024.8.2 and the Yamaha integration is still timing out and failing to initialize

pssc commented 3 months ago

Can you add debug logging for the integration and post the log.

ManiacMouse commented 3 months ago

Potentially the same issue I'm facing and reported in #124012

The log output is slightly different for me, but I've never had it working, I just now tried to set it up.

Since the integration never starts, I could not add debug logging in my case.

ficklma1 commented 3 months ago

I’m experiencing the same issue! Hoping someone can get this corrected in next release?

pssc commented 3 months ago

Hi all so if the integration has not starting after 60's there is of course an issue fixes where deployed for 2024.08.2 core please ensure your at least on that version. Even if the integration fails with debug logging enabled it will give me something to go on...

On Sun, 18 Aug 2024, 16:52 ficklma1, @.***> wrote:

I’m experiencing the same issue!

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/124087#issuecomment-2295308301, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANORYNQMVGSSICC6OZZUZLZSC7M5AVCNFSM6AAAAABMUZG2NSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGMYDQMZQGE . You are receiving this because you were mentioned.Message ID: @.***>

ficklma1 commented 3 months ago

Yes I’m on 2024.08.2 I did turn on debug for the integration but haven’t been able to find the log? I restarted HA afterwards but not sure where it stores log for this integration?

pssc commented 3 months ago

Will be in the full log not the summary at the top

On Sun, 18 Aug 2024, 17:30 ficklma1, @.***> wrote:

Yes I’m on 2024.08.2 I did turn on debug for the integration but haven’t been able to find the log? I restarted HA afterwards but not sure where it stores log for this integration?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/124087#issuecomment-2295318412, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANORYPGTCFBNRAIEDPMUADZSDDYRAVCNFSM6AAAAABMUZG2NSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGMYTQNBRGI . You are receiving this because you were mentioned.Message ID: @.***>

ficklma1 commented 3 months ago

2024-08-18 14:38:06.359 INFO (MainThread) [homeassistant.components.media_player] Setting up yamaha.media_player 2024-08-18 14:38:06.360 DEBUG (MainThread) [homeassistant.components.yamaha.media_player] Known receiver zones: set() 2024-08-18 14:38:06.364 DEBUG (MainThread) [homeassistant.components.yamaha.media_player] Discovery Info: None 2024-08-18 14:38:06.367 DEBUG (SyncWorker_4) [homeassistant.components.yamaha.media_player] Config Zones 2024-08-18 14:38:10.291 DEBUG (SyncWorker_4) [homeassistant.components.yamaha.media_player] Config Zones Fallback 2024-08-18 14:38:10.435 DEBUG (SyncWorker_4) [homeassistant.components.yamaha.media_player] Returned _discover zones: [<RXV model_name="Yamaha Receiver" serial_number="None" zone="Main_Zone" ctrl_url="http://192.168.1.75:80/YamahaRemoteControl/ctrl" at 0x59f83b58>, <RXV model_name="Yamaha Receiver" serial_number="None" zone="Zone_2" ctrl_url="http://192.168.1.75:80/YamahaRemoteControl/ctrl" at 0x59f8c570>, <RXV model_name="Yamaha Receiver" serial_number="None" zone="Zone_3" ctrl_url="http://192.168.1.75:80/YamahaRemoteControl/ctrl" at 0x59f8cc00>, <RXV model_name="Yamaha Receiver" serial_number="None" zone="Zone_4" ctrl_url="http://192.168.1.75:80/YamahaRemoteControl/ctrl" at 0x59ee0c48>] 2024-08-18 14:38:10.438 DEBUG (MainThread) [homeassistant.components.yamaha.media_player] Receiver zone: Main_Zone serial None 2024-08-18 14:38:10.438 INFO (MainThread) [homeassistant.components.yamaha.media_player] Receiver zone: Yamaha Receiver zone Main_Zone no uid None 2024-08-18 14:38:10.439 DEBUG (MainThread) [homeassistant.components.yamaha.media_player] Receiver zone: Zone_2 serial None 2024-08-18 14:38:10.439 INFO (MainThread) [homeassistant.components.yamaha.media_player] Receiver zone: Yamaha Receiver zone Zone_2 no uid None 2024-08-18 14:38:10.439 DEBUG (MainThread) [homeassistant.components.yamaha.media_player] Receiver zone: Zone_3 serial None 2024-08-18 14:38:10.439 INFO (MainThread) [homeassistant.components.yamaha.media_player] Receiver zone: Yamaha Receiver zone Zone_3 no uid None 2024-08-18 14:38:10.439 DEBUG (MainThread) [homeassistant.components.yamaha.media_player] Receiver zone: Zone_4 serial None 2024-08-18 14:38:10.439 DEBUG (MainThread) [homeassistant.components.yamaha.media_player] Ignore receiver zone: Yamaha Receiver Zone_4

pssc commented 3 months ago

@ficklma1 thanks very much that looks completely normal seems to take less than 5 seconds to setup, what is the exact issue you have?

avwuff commented 3 months ago

Can you add debug logging for the integration and post the log.

I can't unfortunately, as the integration doesn't start up, so it doesn't show up in the Integrations page, so I can't turn on debug logging. Would you be able to tell me another way to turn it on?

pssc commented 3 months ago

Yes can be done though the logger config in the configuration.yaml

pssc commented 3 months ago

Hi if anyone has the ability to test PR https://github.com/home-assistant/core/pull/124057 and provide logs that would be good.

Its looking like the fix in 2024.8.2 is masking another bug, I am working on an updated version

ficklma1 commented 3 months ago

Hi pssc,Thanks for your help!This is the integration page…they are not available. The last update prior to 2024.8.x all was working fine for over 5+ years.Sent from my iPhoneOn Aug 18, 2024, at 6:11 PM, Phill (pssc) @.***> wrote: @ficklma1 thanks very much that looks completely normal seems to take less than 5 seconds to setup, what is the exact issue you have

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

pssc commented 3 months ago

@ficklma1 I was trying to get a unique_id of for entries and for some devices this has worked and for others boom so my apologies. Do you have more than one unit? there should be another log entry related to that one...

ficklma1 commented 3 months ago

Ok after looking at the integration page I sent below. I realized something created _2 version of the same entity. My scripts, etc. are expecting to use entities without the _2.  With that said the _2 versions work fine.  This is making me think 2024.08.x is now natively creating entries for Yamaha?Sent from my iPhoneOn Aug 19, 2024, at 7:46 AM, Mark Fickling @.> wrote:Hi pssc,Thanks for your help!This is the integration page…they are not available. The last update prior to 2024.8.x all was working fine for over 5+ years.Sent from my iPhoneOn Aug 18, 2024, at 6:11 PM, Phill (pssc) @.> wrote: @ficklma1 thanks very much that looks completely normal seems to take less than 5 seconds to setup, what is the exact issue you have

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

ficklma1 commented 3 months ago

Hi @pssc I only have 1 Yamaha Receiver. I have 3 entity entries, but they are being duplicated with a _2 at the end. The _2 seem to be the working version, but has the icon which shows it wasn't setup via UI...Example below... This entity ('media_player.yamaha_receiver_deck_2') does not have a unique ID, therefore its settings cannot be managed from the UI. See the documentation for more detail.

The entity without the _2 (standard version)... This entity is no longer being provided by the yamaha integration. If the entity is no longer in use, delete it in settings.

pssc commented 3 months ago

@ficklma1 ah good in a bad sort of way. You have eliminated this being a multi system discovery issue. Seems the network discovery(which is rock solid on my system) is a bit flaky for quite a few(so loses the serial and hence different unique_id and then a new entity and will flip flop if in then sees the serial at startup). The PR should fix this and restore a stable entity with a uid as it will remember the serial once its been seen it and use it if the discovery fails in the future.

config_flow UI setup and discovery, is next on the list but not until we have a stable integration and people can be happy working as was.

pssc commented 3 months ago

yamaha.tar.gz This should run as a custom_compoment if anyone wishes to provide feedback

ficklma1 commented 3 months ago

@pssc worked like a charm! Thanks for working on getting this corrected so quickly. I assume the PR will be merged in next release and can remove the custom component? Thanks again!

pssc commented 3 months ago

@ficklma1 thanks for testing and sorry for breaking, but thanks for the support, I couldn't have done it without the logs and the work of others, lets elicit some more feedback and I need to get the PR https://github.com/home-assistant/core/pull/124057 reviewed & accepted and into the release yet...

pssc commented 3 months ago

@ficklma1 I have had to make bigger changes to fix #124012 @ManiacMouse issues can you be kind enough to retest this new version and provide a debug log thanks (even if it works just so I can check it works as intended). Then can make the case to get the PR merged.

yamaha.tar.gz

ficklma1 commented 3 months ago

Sorry, that was the built in one. I moved to Yamaha YNCA from a repository and have since unloaded the one from YAML

avwuff commented 3 months ago

Finally had some time to try to figure out what is going on here. I've turned on the logger like so and upgraded to 2024.9.0

logger:
  default: info
  logs:
    yamaha: debug

No additional debug logs were posted, just the 60 second timeout message. I saw there was a recent PR #123349 that removed the debug logging, so I went to version 2024.8.3. I also saw no additional logging there, just this:

2024-09-04 16:28:05.619 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: {('yamaha', '140078775159600'): 81033.223012598}
2024-09-04 16:28:12.362 ERROR (MainThread) [homeassistant.components.media_player] Setup of platform yamaha is taking longer than 60 seconds. Startup will proceed without waiting any longer.

I have a very simple setup: A single Yamaha receiver, nothing special. I can't be the only one who is affected by this.

Would it be possible to revert this change? I'm happy to provide more debugging but I don't know this integration and I am not sure how to turn on debug logging for an integration that does not load.

pssc commented 3 months ago

@avwuff its in truck

avwuff commented 3 months ago

@avwuff its in truck

Do you mean trunk? I'm not sure what this means.

pssc commented 2 months ago

Its in process to fix for 2024.9.1 sorry about the colloquialism.

On Thu, 5 Sept 2024 at 04:22, Av @.***> wrote:

@avwuff https://github.com/avwuff its in truck

Do you mean trunk? I'm not sure what this means.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/124087#issuecomment-2330520038, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANORYPKJY6G5FTJMA7T7XTZU7FBFAVCNFSM6AAAAABMUZG2NSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZQGUZDAMBTHA . You are receiving this because you were mentioned.Message ID: @.***>

-- I Can Resist Everything Except Temptation -- Oscar Wilde

avwuff commented 2 months ago

Confirmed that 2024.9.1 no longer breaks my Yamaha. Thanks for the fix, appreciate the work regardless!

ccalazans commented 2 months ago

Hi I'm still faceing issues with it on the following version
Core 2024.9.3 Supervisor 2024.09.1 Operating System 13.1 Front-end 20240909.1

Integration Yamaha (YNCA) 7.10.1

Receiver - RX-V6A