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
73.83k stars 30.91k forks source link

[Beta 2022.6.0b0] Calendar Config Unload Error - Reports: Config was Never Loaded #72555

Closed jweston2112 closed 2 years ago

jweston2112 commented 2 years ago

The problem

Error in Core Log

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 474, in async_unload
result = await component.async_unload_entry(hass, self)
File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 61, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 172, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded```

### What version of Home Assistant Core has the issue?

2022.6.0b0

### What was the last working version of Home Assistant Core?

2022.5.5

### What type of installation are you running?

Home Assistant OS

### Integration causing the issue

Google Calendars

### Link to integration documentation on our website

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

### Diagnostics information

_No response_

### Example YAML snippet

```yaml
Yaml Config was deprecated in this release

#### Google Calendar
# google:
#   client_id: !secret google_cid
#   client_secret: !secret google_secret
#   track_new_calendar: true
was all that was in Config

Anything in the logs that might be useful for us?

No response

Additional information

Not Sure what triggers the issue

logging set for

homeassistant.config_entries: debug
homeassistant.components.google.calendar: debug

produced the Above log snippet

probot-home-assistant[bot] commented 2 years ago

google documentation google source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

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

jweston2112 commented 2 years ago

Let me know if you require additional information

allenporter commented 2 years ago

Let me know if you require additional information

Hi, Can you let me know the steps you took to see this or anything else that would help reproduce?

allenporter commented 2 years ago

Let me know if you require additional information

Hi, Can you let me know the steps you took to see this or anything else that would help reproduce?

(I'm wondering why the entry is being unloaded)

jweston2112 commented 2 years ago

Does it unload during a Core Restart? ... Since it seems to be async I am wondering if it was a delayed error from a core restart

but I did wait quite awhile ... I got the error so I tried to setup logger debug and restarted the core and waited ... went back to "my real" work (working from home ) turned back later and checked the logs and saw the error again... I have seen it various times since yesterday after loading the beta... but wanted to see if it would go away with a host reboot and time... but it still happens

just before sending this I checked again and

jweston2112 commented 2 years ago
Logger: homeassistant.config_entries
Source: helpers/entity_component.py:172
First occurred: 3:28:08 PM (1 occurrences)
Last logged: 3:28:08 PM

Error unloading entry Configuration.yaml for calendar
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 474, in async_unload
    result = await component.async_unload_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 61, in async_unload_entry
    return await component.async_unload_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 172, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
jweston2112 commented 2 years ago

I had left it going undistrubed since ... I was out feeding my chickens and goats so I wasnt messing with the system...

This is a PI4 8gb running HAOS ... so i doubt it has to do with memory in such a short time... and my Mem usgae is sorta flat since this isnt my "production" machine.... just for preview and developement

jweston2112 commented 2 years ago

I do have a Number of calendars ...

image

so I wonder if that is an issue....

the ones that are unchecked are "additional" sensors (the unchecked ones ... unchecked as they shw up 2X in the calendar when checked) but have automations associated.

jweston2112 commented 2 years ago

Hope I am helping as you can see I use Google Calendars a Bit and Hope to use them more ...

Thanks for your Effort and Help...

allenporter commented 2 years ago

Thanks that is helpful. There is a new place where unload happens when options are updated, or the config entry is updated for any reason, it will reload itself.

Do you have any logbook entries around that time that might give any clues as to why the entry is reloading? I have some things to try later but thought I would still ask while I investigate more.

jweston2112 commented 2 years ago

Around that time in the Logbook... all the calendars became "unavailable" then "off" then all turned "on"... but I think at 3:28 I was out and away from the computer... My quitting time is 3 PM and like I said I went to feed the chickens and goats and came back in after for a beer :) so I dont think I was messing with it at the time... I wonder if Google was having an issue... I had prior to that time made a number of updates to my primary calendar to reflect time off next week ... so maybe it was trying to unload and reload due to the new information.... I had the 4 days after memorial day set with an event of "8 Hour Days" and changed them to "Off of Work" so it would have technically modified 3 calendars....

excert from my google_calendars.yaml

- cal_id: jimweston1932@gmail.com
  entities:
    - device_id: jimweston1932_gmail_com
      ignore_availability: true
      name: jimweston1932@gmail.com
    #      track: true
    - device_id: Off_of_Work
      name: Days Off
      #      track: true
      search: "Off of Work"
      offset: "!!"
    - device_id: 8_Hour_Days
      name: Short Days
      #      track: true
      search: "8 Hour Days"
      offset: "!!"
    - device_id: Heartworm_meds
      name: Dogs Heartworm Medicine
      #      track: true
      search: "Dogs Heartworm Medicine"
      offset: "!!"

I also have "subscibed" to calendars from the Atlanta Braves and they sometimes auto update with scores ... so I wonder if that is when some of the other times I get the error ... updates to calendars?

also I just check the log again before sending this and I see this

Logger: homeassistant.components.calendar Source: helpers/entity_platform.py:598 Integration: Calendar (documentation, issues) First occurred: May 26, 2022, 6:28:12 PM (44 occurrences) Last logged: May 26, 2022, 11:28:18 PM

Platform google does not generate unique IDs. ID en.christian#holiday@group.v.calendar.google.com is already used by calendar.christian_holidays - ignoring calendar.christian_holidays_2 Platform google does not generate unique IDs. ID jimweston1932@gmail.com-Off_of_Work is already used by calendar.off_of_work - ignoring calendar.off_of_work_2 Platform google does not generate unique IDs. ID jimweston1932@gmail.com-8_Hour_Days is already used by calendar.8_hour_days - ignoring calendar.8_hour_days_2 Platform google does not generate unique IDs. ID tmc3mc7m5pnkjs22941qvstlbc@group.calendar.google.com is already used by calendar.2022_nascar_schedule_nascar_cup_series - ignoring calendar.2022_nascar_schedule_nascar_cup_series_2 Platform google does not generate unique IDs. ID jimweston1932@gmail.com-Heartworm_meds is already used by calendar.heartworm_meds - ignoring calendar.heartworm_meds_2

and this

Logger: homeassistant.config_entries Source: helpers/entity_component.py:172 First occurred: May 26, 2022, 3:28:08 PM (25 occurrences) Last logged: May 26, 2022, 11:28:17 PM

Error unloading entry Configuration.yaml for calendar Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 474, in async_unload result = await component.async_unload_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/calendar/init.py", line 61, in async_unload_entry return await component.async_unload_entry(entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 172, in async_unload_entry raise ValueError("Config entry was never loaded!") ValueError: Config entry was never loaded!

So its looking like updates to calendars cause these in a delayed fashion possibly

jweston2112 commented 2 years ago

calendar

as you can see the Braves Lost again... and Yesterday was Ascension Day (Christian Holiday)

jweston2112 commented 2 years ago

I hate to say this... but I am also seeing this sometimes.

Logger: homeassistant.components.google.calendar Source: components/google/calendar.py:204 Integration: Google Calendars (documentation, issues) First occurred: 8:04:18 AM (1 occurrences) Last logged: 8:04:18 AM

Unable to connect to Google: Error connecting to API: [Errno 1] [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2633)

allenporter commented 2 years ago

I missed that this also had the "does not generate unique id" message like https://github.com/home-assistant/core/issues/72592 has also.

Anto79-ops commented 2 years ago

just starting seeing this message (in title) for my [Beta 2022.6.0b0] in the logs. If you need another pair of eyes on it, just let me know. cheers

allenporter commented 2 years ago

Thanks, i don't think any additional is needed at the moment but we're discussing the fix in https://github.com/home-assistant/core/pull/72608