Nest integration not working after updating 2023.1.5

Greetings!

I have updated my HA to 2023.1.5 and now the Nest integration (Thermostats) doesn’t come up.
Tried to delete so I could recofigure but can’t do that as well. Tried to delete application credentials and can’t add it back as I get “No application credentials for platform nest”.
This is what I have in the logs:

Traceback (most recent call last):
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 744, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 761, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/nest/__init__.py", line 62, in <module>
    from . import api, config_flow
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/nest/api.py", line 12, in <module>
    from google_nest_sdm.google_nest_subscriber import GoogleNestSubscriber
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google_nest_sdm/google_nest_subscriber.py", line 15, in <module>
    from google.api_core.exceptions import GoogleAPIError, NotFound, Unauthenticated
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/api_core/exceptions.py", line 29, in <module>
    from google.rpc import error_details_pb2
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/rpc/error_details_pb2.py", line 52, in <module>
    _descriptor.FieldDescriptor(
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 560, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
2023-01-17 11:20:42.600 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component homeassistant.components.nest
Traceback (most recent call last):
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 725, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/nest/__init__.py", line 62, in <module>
    from . import api, config_flow
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/nest/api.py", line 12, in <module>
    from google_nest_sdm.google_nest_subscriber import GoogleNestSubscriber
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google_nest_sdm/google_nest_subscriber.py", line 15, in <module>
    from google.api_core.exceptions import GoogleAPIError, NotFound, Unauthenticated
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/api_core/exceptions.py", line 29, in <module>
    from google.rpc import error_details_pb2
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/rpc/error_details_pb2.py", line 52, in <module>
    _descriptor.FieldDescriptor(
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 560, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
2023-01-17 11:20:42.604 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 725, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/nest/__init__.py", line 62, in <module>
    from . import api, config_flow
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/nest/api.py", line 12, in <module>
    from google_nest_sdm.google_nest_subscriber import GoogleNestSubscriber
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google_nest_sdm/google_nest_subscriber.py", line 15, in <module>
    from google.api_core.exceptions import GoogleAPIError, NotFound, Unauthenticated
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/api_core/exceptions.py", line 29, in <module>
    from google.rpc import error_details_pb2
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/rpc/error_details_pb2.py", line 52, in <module>
    _descriptor.FieldDescriptor(
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 560, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/hass/homeassistant/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/http/ban.py", line 81, in ban_middleware
    return await handler(request)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/config/config_entries.py", line 86, in delete
    result = await hass.config_entries.async_remove(entry_id)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/config_entries.py", line 968, in async_remove
    await entry.async_remove(self.hass)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/config_entries.py", line 569, in async_remove
    component = integration.get_component()
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 732, in get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing homeassistant.components.nest

Any way of deleting this integration manually so I can try to reconfigure it? Or any other idea?

Many thanks for reading until here.

I was able to delete it from the core.config_entries but can’t readd integration as I get a:

Config flow could not be loaded: {“message”:“Invalid handler specified”}

And this in the logs:

2023-01-17 11:53:54.225 ERROR (MainThread) [frontend.js.latest.202301100] :0:0 ResizeObserver loop completed with undelivered notifications.
2023-01-17 11:53:57.203 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform homeassistant.components.nest.config_flow
Traceback (most recent call last):
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 744, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 761, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/nest/__init__.py", line 62, in <module>
    from . import api, config_flow
  File "/home/hass/homeassistant/lib/python3.10/site-packages/homeassistant/components/nest/api.py", line 12, in <module>
    from google_nest_sdm.google_nest_subscriber import GoogleNestSubscriber
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google_nest_sdm/google_nest_subscriber.py", line 15, in <module>
    from google.api_core.exceptions import GoogleAPIError, NotFound, Unauthenticated
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/api_core/exceptions.py", line 29, in <module>
    from google.rpc import error_details_pb2
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/rpc/error_details_pb2.py", line 52, in <module>
    _descriptor.FieldDescriptor(
  File "/home/hass/homeassistant/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 560, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
2023-01-17 11:53:57.207 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration nest: Exception importing homeassistant.components.nest.config_flow

Here no issues at all after last update 2023.1.5

Created a new virtualenv and started from scratch, problem solved.