core icon indicating copy to clipboard operation
core copied to clipboard

Unable to Add Todoist Integration

Open mariomaz87 opened this issue 1 year ago • 7 comments

The problem

I have been using the Todoist integration without any issues for months. However, a few days ago, the connection between the integration and the Todoist API was broken. I removed the integration, but now when I try to add it again, I enter my token and receive the error message: "Unknown error occurred." Thanks.

What version of Home Assistant Core has the issue?

core-2024.10.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Todoist

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

I can't find anything in HA logs about the connection

Additional information

No response

mariomaz87 avatar Oct 08 '24 16:10 mariomaz87

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

Code owner commands

Code owners of todoist 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 todoist 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)


todoist documentation todoist source (message by IssueLinks)

home-assistant[bot] avatar Oct 08 '24 16:10 home-assistant[bot]

I would check your logs when you try to re-add the integration and receive the "Unknown error occurred.". That will help narrow down the cause.

For what it's worth I just tried and didn't have any issues adding the integration in my instance. Hopefully any error logs will point to the problem.

boralyl avatar Oct 10 '24 03:10 boralyl

I would check your logs when you try to re-add the integration and receive the "Unknown error occurred.". That will help narrow down the cause.

For what it's worth I just tried and didn't have any issues adding the integration in my instance. Hopefully any error logs will point to the problem.

Should I enable some kind of extended logging? In my Home Assistant Core I don't see anything related to Todoist. After inserting the token the wheel spins for a while (a long while actually), I get the error in the UI but nothing in the logs!

mariomaz87 avatar Oct 10 '24 07:10 mariomaz87

If I try to add the integration in the configuration yaml with:

calendar:
  - platform: todoist
    token: mytoken
    custom_projects:
      - name: "Alla porta"
        due_date_days: 0
        labels:
          - allaporta

In the log I see an error:

Logger: homeassistant.components.calendar
Source: helpers/entity_platform.py:405
integration: Calendar (documentation, issues)
First occurred: 10:30:03 (1 occurrences)
Last logged: 10:30:03

Setup of platform todoist is taking longer than 60 seconds. Startup will proceed without waiting any longer.

mariomaz87 avatar Oct 10 '24 08:10 mariomaz87

And I also tried by issuing a new API token. Same error, but I can use the same API with other applications with no issue (e.g., Obsidian Todoist plugin).

mariomaz87 avatar Oct 10 '24 08:10 mariomaz87

EDIT: it's working again, maybe some kind of connectivity issue

mariomaz87 avatar Oct 10 '24 10:10 mariomaz87

This is definitely some kind of connection issue because it's not working anymore after a few minutes

mariomaz87 avatar Oct 10 '24 10:10 mariomaz87

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.

Same issue here. I get this error after enabeling debug logging for the todoist integration.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/todoist/__init__.py", line 29, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 306, in async_config_entry_first_refresh
    await self._async_refresh(
        log_failures=False, raise_on_auth_failed=True, raise_on_entry_error=True
    )
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/todoist/coordinator.py", line 42, in _async_update_data
    return await self.api.get_tasks()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/todoist_api_python/api_async.py", line 26, in get_tasks
    return await run_async(lambda: self._api.get_tasks(**kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/todoist_api_python/utils.py", line 18, in run_async
    return await loop.run_in_executor(None, func)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

After deleting and readding todoist I get a timeout at this screen:

Image

nighi avatar Jan 24 '25 18:01 nighi

I am unfortunately still unable to reproduce this. It looks like the api request is timing out.

While I don't think this will resolve the issue, I did open a PR to update to the latest version of the todoist-api-python library: https://github.com/home-assistant/core/pull/136549

boralyl avatar Feb 01 '25 22:02 boralyl