syncall icon indicating copy to clipboard operation
syncall copied to clipboard

[BUG] Frequent exceptions: raise ValueError(f'Expected int, got: {ical}')

Open ataraskov opened this issue 1 year ago • 6 comments

Describe the bug

Configured a sync between taskwarrior and devcal (nextcloud) It works sometimes, but other times i see exception: raise ValueError(f'Expected int, got: {ical}')

To Reproduce

Steps to reproduce the behavior: Do a usual sync, example: tw_caldav_sync --caldav-url https://example.com/remote.php/dav --caldav-calendar tasks --all --verbose

Expected Behavior

No errors during sync

Versions

$ task --version
3.1.0

OS Version (cat /etc/*-release; uname -a)

Ubuntu 24.04.1 LTS

Python version (python --version; python3 --version)

Python 3.12.3

--version of your executable

tw_caldav_sync, version 1.8.8

Additional context

Full exception stack:

09:20:01.39 | DEBUG     | Initialising...
09:20:01.39 | DEBUG     | Initialising preferences manager -> /home/user/.config/syncall
09:20:01.39 | INFO      | Loading preferences...
09:20:01.39 | DEBUG     | Loading cached configuration - tasks____None__.yaml
09:20:01.39 | INFO      | 

Configuration: 
===============

  - TW Filter             : 
  - TW Tags               : ()
  - TW Project            : None
  - TW Sync All Tasks     : True
  - Caldav Calendar       : tasks
  - Prefer scheduled dates: False



09:20:01.39 | DEBUG     | Initializing Taskwarrior instance using config file: /home/user/.taskrc
09:20:01.39 | DEBUG     | Reading the caldav password from environment variable...
09:20:01.78 | DEBUG     | Using a custom configuration file ... -> tasks____None__.yaml
09:20:01.78 | DEBUG     | Initialising preferences manager -> /home/user/.config/syncall
09:20:01.78 | INFO      | Loading preferences...
09:20:01.80 | INFO      | Initializing Caldav...
09:20:02.11 | DEBUG     | Connected to calendar tasks
09:20:02.21 | DEBUG     | Connected to calendar - tasks
09:20:02.21 | INFO      | Initializing Taskwarrior...
Exception was raised during program execution.

  File "/home/user/bin/syncall/bin/tw_caldav_sync", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/syncall/scripts/tw_caldav_sync.py", line 240, in main
    aggregator.sync()
  File "/home/user/bin/syncall/lib/python3.12/site-packages/syncall/aggregator.py", line 186, in sync
    str(item[self._helper_A.id_key]): item for item in self._side_A.get_all_items()
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/syncall/caldav/caldav_side.py", line 76, in get_all_items
    data = icalendar_component(t)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/syncall/caldav/caldav_utils.py", line 22, in icalendar_component
    return obj.icalendar_component  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/caldav/objects.py", line 1758, in _get_icalendar_component
    for x in self.icalendar_instance.subcomponents
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/caldav/objects.py", line 2215, in _get_icalendar_instance
    self.icalendar_instance = icalendar.Calendar.from_ical(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/icalendar/cal.py", line 398, in from_ical
    parsed_components = [factory(factory.from_ical(vals))]
                                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/bin/syncall/lib/python3.12/site-packages/icalendar/prop.py", line 231, in from_ical
    raise ValueError(f'Expected int, got: {ical}')


Expected int, got: 
09:20:02.72 | ERROR     | Application failed; Below you can find the error message and stack trace. If you think this is a bug, attach this stack trace to create a new issue -> [https://github.com/bergercookie/syncall/issues].
NoneType: None

ataraskov avatar Dec 06 '24 08:12 ataraskov

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Feb 04 '25 15:02 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Feb 10 '25 15:02 github-actions[bot]

I'm actually having the same error today. It worked some days ago.

VanackSabbadium avatar Apr 05 '25 09:04 VanackSabbadium

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jun 04 '25 15:06 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jun 10 '25 15:06 github-actions[bot]

Has this been resolved? The bot seems pretty aggressive with closing :) I also have the same issue

ferdinandyb avatar Oct 05 '25 21:10 ferdinandyb