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
71.62k stars 29.93k forks source link

Google Calendar trouble after upgrade to 2024.3? #112679

Closed aleksanderlvr closed 4 months ago

aleksanderlvr commented 6 months ago

The problem

Google Calendar is not working. The problem somehow coincides with the HA upgrade to version 2024.3

What version of Home Assistant Core has the issue?

2024.3

What was the last working version of Home Assistant Core?

2024.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Google Calendar

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

New entry gives this error:

Config flow could not be loaded: <!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]--> <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]--> <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]--> <head> <title>(edited my URL).eu | 524: A timeout occurred</title> <meta charset="UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta name="robots" content="noindex, nofollow" /> <meta name="viewport" content="width=device-width,initial-scale=1" /> <link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/main.css" /> </head> <body> <div id="cf-wrapper"> <div id="cf-error-details" class="p-0"> <header class="mx-auto pt-10 lg:pt-6 lg:px-8 w-240 lg:w-full mb-8"> <h1 class="inline-block sm:block sm:mb-2 font-light text-60 lg:text-4xl text-black-dark leading-tight mr-2"> <span class="inline-block">A timeout occurred</span> <span class="code-label">Error code 524</span> </h1> <div> Visit <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_524&utm_campaign=(edited my URL).eu" target="_blank" rel="noopener noreferrer">cloudflare.com</a> for more information. </div> <div class="mt-3">2024-03-08 06:08:58 UTC</div> </header> <div class="my-8 bg-gradient-gray"> <div class="w-240 lg:w-full mx-auto"> <div class="clearfix md:px-8"> <div id="cf-browser-status" class=" relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center"> <div class="relative mb-10 md:m-0"> <span class="cf-icon-browser block md:hidden h-20 bg-center bg-no-repeat"></span> <span class="cf-icon-ok w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4"></span> </div> <span class="md:block w-full truncate">You</span> <h3 class="md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3"> Browser </h3> <span class="leading-1.3 text-2xl text-green-success">Working</span> </div> <div id="cf-cloudflare-status" class=" relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center"> <div class="relative mb-10 md:m-0"> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_524&utm_campaign=(edited my URL).eu" target="_blank" rel="noopener noreferrer"> <span class="cf-icon-cloud block md:hidden h-20 bg-center bg-no-repeat"></span> <span class="cf-icon-ok w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4"></span> </a> </div> <span class="md:block w-full truncate">Vienna</span> <h3 class="md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3"> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_524&utm_campaign=(edited my URL).eu" target="_blank" rel="noopener noreferrer"> Cloudflare </a> </h3> <span class="leading-1.3 text-2xl text-green-success">Working</span> </div> <div id="cf-host-status" class="cf-error-source relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center"> <div class="relative mb-10 md:m-0"> <span class="cf-icon-server block md:hidden h-20 bg-center bg-no-repeat"></span> <span class="cf-icon-error w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4"></span> </div> <span class="md:block w-full truncate">(edited my URL).eu</span> <h3 class="md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3"> Host </h3> <span class="leading-1.3 text-2xl text-red-error">Error</span> </div> </div> </div> </div> <div class="w-240 lg:w-full mx-auto mb-8 lg:px-8"> <div class="clearfix"> <div class="w-1/2 md:w-full float-left pr-6 md:pb-10 md:pr-0 leading-relaxed"> <h2 class="text-3xl font-normal leading-1.3 mb-4">What happened?</h2> <p>The origin web server timed out responding to this request.</p> </div> <div class="w-1/2 md:w-full float-left leading-relaxed"> <h2 class="text-3xl font-normal leading-1.3 mb-4">What can I do?</h2> <h3 class="text-15 font-semibold mb-2">If you're a visitor of this website:</h3> <p class="mb-6">Please try again in a few minutes.</p> <h3 class="text-15 font-semibold mb-2">If you're the owner of this website:</h3> <p><span>The connection to the origin web server was made, but the origin web server timed out before responding. The likely cause is an overloaded background task, database or application, stressing the resources on your web server. To resolve, please work with your hosting provider or web development team to free up resources for your database or overloaded application.</span> <a rel="noopener noreferrer" href="https://support.cloudflare.com/hc/en-us/articles/200171926-Error-524">Additional troubleshooting information here.</a></p> </div> </div> </div> <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300"> <p class="text-13"> <span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">8610a4ee4facc311</strong></span> <span class="cf-footer-separator sm:hidden">&bull;</span> <span id="cf-footer-item-ip" class="cf-footer-item hidden sm:block sm:mb-1"> Your IP: <button type="button" id="cf-footer-ip-reveal" class="cf-footer-ip-reveal-btn">Click to reveal</button> <span class="hidden" id="cf-footer-ip">31.15.129.117</span> <span class="cf-footer-separator sm:hidden">&bull;</span> </span> <span class="cf-footer-item sm:block sm:mb-1"><span>Performance &amp; security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_524&utm_campaign=(edited my URL).eu" id="brand_link" target="_blank">Cloudflare</a></span> </p> <script>(function(){function d(){var b=a.getElementById("cf-footer-item-ip"),c=a.getElementById("cf-footer-ip-reveal");b&&"classList"in b&&(b.classList.remove("hidden"),c.addEventListener("click",function(){c.classList.add("hidden");a.getElementById("cf-footer-ip").classList.remove("hidden")}))}var a=document;document.addEventListener&&a.addEventListener("DOMContentLoaded",d)})();</script> </div><!-- /.error-footer --> </div> </div> </body> </html>

my domain replaced with "(edited my URL)"

Additional information

No response

home-assistant[bot] commented 6 months 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!

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


google documentation google source (message by IssueLinks)

allenporter commented 6 months ago

Can you tell me what steps you take to get this to happen? e.g. is it for an existing configuration or a setting up new?

On the question: Is there any thing in the error logs, that doesn't look like a home assistant error log message and i'm confused since it mentions cloud flare. Check out https://www.home-assistant.io/docs/configuration/troubleshooting/ for more details on error log messages

aleksanderlvr commented 6 months ago

The integration worked for 10 days. The only changes I made in between were changing the colors on the calendar. The existing calendar doesn't work, I can't add a new one. After deleting the calendar, I cannot create a new one because I get the message "Timeout establishing connection".

allenporter commented 6 months ago

To clarify, i'm asking for additional information from the template that was not included in this issue report:

aleksanderlvr commented 6 months ago

None of the information in the logs pertains to Google Calendar. If I delete the permissions in config/application_credentials . then I get a integration setup window where I can enter the name, Client ID and Client Secret information, but it does not perform the process. If I don't clear the rights, I get a timeout or "Error Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble". Currently i do not have integration among the installed ones. I don't know if the outage is related, but the time the traffic on console.cloud.google.com stopped coincides with the backup time core_2024.2.5, March 7, 2024

aleksanderlvr commented 6 months ago

G-Cal Blue vertical line on chart and Core backup time are 10 min apart.

allenporter commented 6 months ago

I can't really tell since the information here doesn't match what i expect, but it sounds like your server is unable to connect to google. Nearly every time i've seen a report like this it is because of an ipv6 configuration or ad blocker.

aleksanderlvr commented 6 months ago

With the core_2024.2.5 restore, I regained access to google calendar. Core update probably caused some 500 internal error.

allenporter commented 6 months ago

OK, surprising. I don't really understand the information you're giving me about what the problem you were seeing or where you were seeing.

What would be helpful to understand is:

allenporter commented 6 months ago

(i recommend not trying new things like removing a previously working integration, lets focus on the original problem and get to the bottom of it?)

aleksanderlvr commented 6 months ago

graphJPG

Allen, thank you for your time and effort. After the effects, I thought it was a problem with Google Calendar because that was the first visible effect, but the matter has other causes and effects. While waiting for the upgrade of the internet package to 1 Gbps, I also performed the Core upgrade. Everything worked, even Google Travel Time via API, only the calendar disappeared. Following your suggestion, I even canceled the IPv6 address with the Internet provider. Later, problems also appeared with other data sources. The graphs became ragged because the data came only intermittently. An extensive search for help on the HA forum didn't help me, nor can I find anything in the logs. With the restore of the previous Core version, HA works as normal as possible, only the Toyota integration becomes non-functional shortly after enrollment.

allenporter commented 6 months ago

Can you please add the specific information I was asking for in the previos comment?

Phoenix-DH commented 6 months ago

I have a similar issue: It seems that a lot of integrations get not working after a poeriod of time. They loose the connection as it seems. Google, Openweather, VW ....

When I reload the integrations, it get back working for a special timeframe. Afterwards the same. Also it get back working from alone ....

All my components are up to date, based on today. I did not change something more.

Attached some logs ...

Logger: homeassistant.components.google.calendar Source: helpers/update_coordinator.py:350 integration: Google Calendar (documentation, issues) First occurred: 11:30:11 AM (5 occurrences) Last logged: 11:30:11 AM

Error fetching Google Privat data: Error communicating with API: Error connecting to API: Cannot connect to host www.googleapis.com:443 ssl:default [Try again] Error fetching Biomüll data: Error communicating with API: Error connecting to API: Cannot connect to host www.googleapis.com:443 ssl:default [Try again] Error fetching Wertstoffsack data: Error communicating with API: Error connecting to API: Cannot connect to host www.googleapis.com:443 ssl:default [Try again] Error fetching Papiermüll data: Error communicating with API: Error connecting to API: Cannot connect to host www.googleapis.com:443 ssl:default [Try again] Error fetching Restmüll data: Error communicating with API: Error connecting to API: Cannot connect to host www.googleapis.com:443 ssl:default [Try again]

Logger: homeassistant.components.openweathermap.weather_update_coordinator Source: helpers/update_coordinator.py:350 integration: OpenWeatherMap (documentation, issues) First occurred: 10:54:37 AM (1 occurrences) Last logged: 10:54:37 AM

Error fetching openweathermap data: HTTPSConnectionPool(host='api.openweathermap.org', port=443): Max retries exceeded with url: /data/2.5/weather?APPID=6ef58e19b43b7a891b500b38c1976701&lang=de&lon=7.808259129524232&lat=49.15410290594424 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f79d64dd0>: Failed to establish a new connection: [Errno -3] Try again'))

allenporter commented 6 months ago

Sounds like a network connectivity issue.

Phoenix-DH commented 6 months ago

Maybe this messages, but not in general.

I am just looking to my dashboard, openweather and google down, everything else fine …

I never had network issues with ma stable Unify.

aleksanderlvr commented 6 months ago

Phoenix-DH, can you somehow relate the problems to the HA upgrade or changes to your internet connectivity?

Phoenix-DH commented 6 months ago

I can imagine yes. I not saw it before … it startet with the lastest HA or supervisor update. I have a display at the wall where I see it imediatelly. I work in homemoffice and have always an eye on the network. Also never figured out issues with.

aleksanderlvr commented 6 months ago

Phoenix, try entering DNS in settings/system/network/DNS servers in format x.x.x.x, x.x.x.x

Phoenix-DH commented 6 months ago

@aleksanderlvr Under „Configure network interfaces“? This is set to automatic in my case. When I set to static the DNS will be the same than my HA instance because I switched on my fritz box the DNS to it. I have ADGuard running.

I habe also this: You have configured an HTTPS certificate in Home Assistant. This means that your internal URL needs to be set to a domain covered by the certficate.

I am using SSL wirh external URL.

But all of this was never an issue.

now the issues are also only temporary as it seems. And I did not change anything. Only did the updates.

aleksanderlvr commented 6 months ago

Just try temporary under IPv4 / DNS servers / type 8.8.8.8, 8.8.4.4

Phoenix-DH commented 6 months ago

@aleksanderlvr Thanks, will give it a try tomorrow.

Phoenix-DH commented 6 months ago

Changed it without reboot HA. Still the same. Looking tonthe Dashboard, components cannot get data, dashboard an HA in generall are available. Looking tonthe logs, nearly all components cannot get updates with connection/ssl errors.

Maybe really something general? Did not found an issue.

Will check after HA reboot again.

Phoenix-DH commented 6 months ago

Issue persists, also with other components. Maybe related to https://github.com/home-assistant/core/issues/113481

itairaz1 commented 6 months ago

I got similar issue with the following error Timeout fetching xxx@gmail.com data

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/calendar/trigger.py", line 254, in _handle_refresh
self._events.extend(await self._fetcher(self._timespan))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/calendar/trigger.py", line 132, in async_get_events
active_events = await fetcher(offset_timespan)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/calendar/trigger.py", line 114, in async_get_events
return await entity.async_get_events(hass, timespan.start, end_time)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 461, in async_get_events
result_items = await self.coordinator.async_get_events(start_date, end_date)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 363, in async_get_events
result = await self.calendar_service.async_list_events(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gcal_sync/api.py", line 367, in async_list_events
page_result = await get_next_page(None)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gcal_sync/api.py", line 365, in get_next_page
return await self.async_list_events_page(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gcal_sync/api.py", line 381, in async_list_events_page
result = await self._auth.get_json(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gcal_sync/auth.py", line 101, in get_json
resp = await self.get(url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gcal_sync/auth.py", line 94, in get
resp = await self.request("get", url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gcal_sync/auth.py", line 87, in request
return await self._websession.request(method, url, **kwargs, headers=headers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 504, in _request
with timer:
File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in __exit__
raise asyncio.TimeoutError from None
TimeoutError

Restart HA doesn't help Restart the OS (the system) solves the problem until it comes back after few days

Is it the same issue?

Phoenix-DH commented 6 months ago

Do you habe AdGuard running?

https://github.com/hassio-addons/addon-adguard-home/issues/501

itairaz1 commented 6 months ago

No

allenporter commented 6 months ago

File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 504, in _request with timer: File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in exit raise asyncio.TimeoutError from None TimeoutError



Restart HA doesn't help Restart the OS (the system) solves the problem until it comes back after few days

Is it the same issue?

(1) The symptoms / error message is not the same (2) However in both cases it likely means a network misconfiguration (ad blocker, ipv6 misconfiguration, etc). There isn't a home assistant issue here as far as we can tell.

I recommend reacahing out to the community forums for support

issue-triage-workflows[bot] commented 5 months ago

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.

axute commented 5 months ago

Same issues here, 4 networks with vlan tags. Some with gateway and dns, one with IPv6. No issues before 2024.3, now after every update all integrations fail. After reboot only Google calendar and Google home doesn't work.

allenporter commented 5 months ago

@axute have details from the issue template above such as messages in the error log? do things work in safe mode with custom integrations disabled?

aleksanderlvr commented 5 months ago

In my case, I did a complete audit of secure online access. The problem was in the remnants of the settings in HA in the testing of various methods and on the router port forwarding. There were no problems before 2024.3, but then some change caused problems. The calendar was not the only one, it is somehow the most susceptible and the first to show problems. After the audit, other like Toyota data are more consistent.

allenporter commented 5 months ago

Not sure I follow the details. Can you be a little more specific?

axute commented 5 months ago

@axute have details from the issue template above such as messages in the error log? do things work in safe mode with custom integrations disabled?

2024-04-09 00:07:12.344 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Google Kalender for google
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/google/__init__.py", line 170, in async_setup_entry
    await session.async_ensure_token_valid()
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 523, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 94, in async_refresh_token
    new_token = await self._async_refresh_token(token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 184, in _async_refresh_token
    new_token = await self._token_request(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 203, in _token_request
    resp = await session.post(self.token_url, data=data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 504, in _request
    with timer:
  File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in __exit__
    raise asyncio.TimeoutError from None
TimeoutError
axute commented 5 months ago

I disabled the IPv6 on the only network interface with IPv6. Now I get a new error.

2024-04-10 12:21:20.662 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Google Kalender for google
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/google/__init__.py", line 157, in async_setup_entry
    await config_entry_oauth2_flow.async_get_config_entry_implementation(
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 425, in async_get_config_entry_implementation
    raise ValueError("Implementation not available")
ValueError: Implementation not available

image

PS: Google Home integration now works, but not google calendar

axute commented 5 months ago

Sorry, I setuped all new and now it works (without IPv6 enabled).

issue-triage-workflows[bot] commented 4 months ago

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.