Kozea / Radicale

A simple CalDAV (calendar) and CardDAV (contact) server.
https://radicale.org
GNU General Public License v3.0
3.35k stars 434 forks source link

Cannot create new event from Kalendar #1236

Closed A-UNDERSCORE-D closed 2 weeks ago

A-UNDERSCORE-D commented 2 years ago

Appears that this is a disagreement on some icalendar spec stuff?

from what I understand either:

This is basically the same as https://github.com/Kozea/Radicale/issues/1201 -- so Im going to also open an issue with KDE, but I'm going to keep a copy here for people searching this out

[2022-04-15 11:12:33 +0000] [1193604/Thread-8] [DEBUG] Request content:
BEGIN:VCALENDAR
PRODID:-//K Desktop Environment//NONSGML libkcal 4.3//EN
VERSION:2.0
X-KDE-ICAL-IMPLEMENTATION-VERSION:1.0
BEGIN:VTIMEZONE
TZID:Africa/Johannesburg
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20220415T111224Z
CREATED:20220415T111224Z
UID:84632fb4-6e5e-40ed-9d05-c8192822574a
LAST-MODIFIED:20220415T111224Z
SUMMARY:test four
DTSTART;TZID=Africa/Johannesburg:20220417T131500
DTEND;TZID=Africa/Johannesburg:20220417T141500
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

[2022-04-15 11:12:33 +0000] [1193604/Thread-8] [WARNING] Bad PUT request on '/ad/84bffd00-e6a7-f063-2f06-9a5c227d7441/1650021152.R137.ics': "In transformToNative, unhandled exception on line None: <class 'ValueError'>: at least one component is needed (<VTIMEZONE| [<TZID{}Africa/Johannesburg>]>)"
Traceback (most recent call last):
  File "/home/radicale/.local/lib/python3.8/site-packages/vobject/base.py", line 185, in transformToNative
    return self.behavior.transformToNative(self)
  File "/home/radicale/.local/lib/python3.8/site-packages/vobject/icalendar.py", line 1085, in transformToNative
    obj.registerTzinfo(obj.tzinfo)
  File "/home/radicale/.local/lib/python3.8/site-packages/vobject/icalendar.py", line 154, in gettzinfo
    return tz.tzical(buffer).get()
  File "/home/radicale/.local/lib/python3.8/site-packages/dateutil/tz/tz.py", line 1279, in __init__
    self._parse_rfc(fobj.read())
  File "/home/radicale/.local/lib/python3.8/site-packages/dateutil/tz/tz.py", line 1380, in _parse_rfc
    raise ValueError(
ValueError: at least one component is needed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/radicale/.local/lib/python3.8/site-packages/radicale/app/put.py", line 144, in do_PUT
    vobject_items = radicale_item.read_components(content or "")
  File "/home/radicale/.local/lib/python3.8/site-packages/radicale/item/__init__.py", line 52, in read_components
    return list(vobject.readComponents(s))
  File "/home/radicale/.local/lib/python3.8/site-packages/vobject/base.py", line 1128, in readComponents
    component.transformChildrenToNative()
  File "/home/radicale/.local/lib/python3.8/site-packages/vobject/base.py", line 673, in transformChildrenToNative
    child = child.transformToNative()
  File "/home/radicale/.local/lib/python3.8/site-packages/vobject/base.py", line 198, in transformToNative
    raise ParseError(msg, lineNumber)
vobject.base.ParseError: "In transformToNative, unhandled exception on line None: <class 'ValueError'>: at least one component is needed (<VTIMEZONE| [<TZID{}Africa/Johannesburg>]>)"

I will note that this ALSO errors with a timezone like UTC-10: [WARNING] Bad PUT request on '/xx/84bffd00-e6a7-f063-2f06-9a5c227d7441/1650021891.R108.ics': "In transformToNative, unhandled exception on line None: <class 'ValueError'>: at least one component is needed (<VTIMEZONE| [<TZID{}UTC-10:00>]>)"

A-UNDERSCORE-D commented 2 years ago

Relevant issue on the KDE side: https://bugs.kde.org/show_bug.cgi?id=452656

A-UNDERSCORE-D commented 2 years ago

As a sidenote -- quick fix here is allowing radicale to lookup these names in the system TZDB and filling in the missing data. But Im not sure if thats something you all will want to do

da4089 commented 7 months ago

I suspect, but haven't yet tested, that the problem here is in the VTIMEZONE specification.

According to IETF RFC-5545 (the iCalendar spec), a VTIMEZONE component must include a TZID, plus one of more STANDARD and/or DAYLIGHT sections (neither of which are present in the quoted VCALENDAR data).

This looks like it's a bug in Kalendar/libkcal: it should be providing the definition of the "Africa/Johannesburg" timezone, and it's not.

That said, it might be nice if vObject were to cater for this bug. While the iCalendar spec doesn't support using standard Olsen timezone database names, they are a defacto standard, and it might be reasonable for vObject to deal with VTIMEZONE sections by looking up the relevant definition.

See https://github.com/py-vobject/vobject/issues/28

pbiering commented 2 weeks ago

closed as not our bug