Exception: Failed to parse line
Hi, getting exception, debug says the following:
Jul 6 13:52:02 px uwsgi[37746]: [2022-07-06 13:52:02 +0300] [37746] [WARNING] Bad PUT request on '/[email protected]/84462f4d-f5f2-e70f-31eb-9a9d24851ef3/040000008200E00074C5B7101A82E00800000000608BAB55C145D801000000000000000010000000AD6AB9858598D840B1551929CBC36C73.ics': At line 58: Failed to parse line: ORGANIZER;CN="Antonov, Viktor (ANT Victor)";SENT-BY="mailto:[email protected] Jul 6 13:52:02 px uwsgi[37746]: Traceback (most recent call last): Jul 6 13:52:02 px uwsgi[37746]: File "/opt/p3v/lib/python3.8/site-packages/radicale/app/put.py", line 144, in do_PUT Jul 6 13:52:02 px uwsgi[37746]: vobject_items = radicale_item.read_components(content or "") Jul 6 13:52:02 px uwsgi[37746]: File "/opt/p3v/lib/python3.8/site-packages/radicale/item/init.py", line 52, in read_components Jul 6 13:52:02 px uwsgi[37746]: return list(vobject.readComponents(s)) Jul 6 13:52:02 px uwsgi[37746]: File "/opt/p3v/lib/python3.8/site-packages/vobject/base.py", line 1101, in readComponents Jul 6 13:52:02 px uwsgi[37746]: vline = textLineToContentLine(line, n) Jul 6 13:52:02 px uwsgi[37746]: File "/opt/p3v/lib/python3.8/site-packages/vobject/base.py", line 925, in textLineToContentLine Jul 6 13:52:02 px uwsgi[37746]: return ContentLine(*parseLine(text, n), **{'encoded': True, Jul 6 13:52:02 px uwsgi[37746]: File "/opt/p3v/lib/python3.8/site-packages/vobject/base.py", line 813, in parseLine Jul 6 13:52:02 px uwsgi[37746]: raise ParseError("Failed to parse line: {0!s}".format(line), lineNumber) Jul 6 13:52:02 px uwsgi[37746]: vobject.base.ParseError: At line 58: Failed to parse line: ORGANIZER;CN="Antonov, Viktor (ANT Viktor)";SENT-BY="mailto:[email protected] Jul 6 13:52:02 px uwsgi[37746]: [2022-07-06 13:52:02 +0300] [37746] [DEBUG] Response content: Jul 6 13:52:02 px uwsgi[37746]: Bad Request
The fragment of ICS around ORGANIZER is the following:
Jul 6 13:52:02 px uwsgi[37746]: PRIORITY:5 Jul 6 13:52:02 px uwsgi[37746]: STATUS:CONFIRMED Jul 6 13:52:02 px uwsgi[37746]: ORGANIZER;CN="Antonov, Viktor (ANT Viktor)";SENT-BY="mailto:[email protected] Jul 6 13:52:02 px uwsgi[37746]: ^n ":mailto:[email protected] Jul 6 13:52:02 px uwsgi[37746]: ATTENDEE;RSVP=TRUE;[email protected];PARTSTAT=ACCEPTED;ROLE=REQ-PARTICIPAN Jul 6 13:52:02 px uwsgi[37746]: ^n T:mailto:[email protected]
Please, advice how to fix this.
Thank you.
Hi again, I think this error is about the same issue:
Jul 6 19:01:57 px uwsgi[39663]: [2022-07-06 19:01:57 +0300] [39663] [WARNING] Bad PUT request on '/[email protected]/84462f4d-f5f2-e70f-31eb-9a9d24851ef3/040000008200E00074C5B7101A82E0080000000069B1C99B3B70D801000000000000000010000000C79F6AAD5D963D4C9C75E0A0286E3665.ics': At line 64: Failed to parse line: ATTENDEE;RSVP=TRUE;CN="LITOVKA, VOLODYMYR";PARTSTAT=NEEDS-ACTION;ROLE=REQ- Jul 6 19:01:57 px uwsgi[39663]: Traceback (most recent call last): Jul 6 19:01:57 px uwsgi[39663]: File "/opt/p3v/lib/python3.8/site-packages/radicale/app/put.py", line 144, in do_PUT Jul 6 19:01:57 px uwsgi[39663]: vobject_items = radicale_item.read_components(content or "") Jul 6 19:01:57 px uwsgi[39663]: File "/opt/p3v/lib/python3.8/site-packages/radicale/item/init.py", line 52, in read_components Jul 6 19:01:57 px uwsgi[39663]: return list(vobject.readComponents(s)) Jul 6 19:01:57 px uwsgi[39663]: File "/opt/p3v/lib/python3.8/site-packages/vobject/base.py", line 1101, in readComponents Jul 6 19:01:57 px uwsgi[39663]: vline = textLineToContentLine(line, n) Jul 6 19:01:57 px uwsgi[39663]: File "/opt/p3v/lib/python3.8/site-packages/vobject/base.py", line 925, in textLineToContentLine Jul 6 19:01:57 px uwsgi[39663]: return ContentLine(*parseLine(text, n), **{'encoded': True, Jul 6 19:01:57 px uwsgi[39663]: File "/opt/p3v/lib/python3.8/site-packages/vobject/base.py", line 813, in parseLine Jul 6 19:01:57 px uwsgi[39663]: raise ParseError("Failed to parse line: {0!s}".format(line), lineNumber) Jul 6 19:01:57 px uwsgi[39663]: vobject.base.ParseError: At line 64: Failed to parse line: ATTENDEE;RSVP=TRUE;CN="LITOVKA, VOLODYMYR";PARTSTAT=NEEDS-ACTION;ROLE=REQ- Jul 6 19:01:57 px uwsgi[39663]: [2022-07-06 19:01:57 +0300] [39663] [DEBUG] Response content: Jul 6 19:01:57 px uwsgi[39663]: Bad Request Jul 6 19:01:57 px uwsgi[39663]: [2022-07-06 19:01:57 +0300] [39663] [INFO] PUT response status for '/[email protected]/84462f4d-f5f2-e70f-31eb-9a9d24851ef3/040000008200E00074C5B7101A82E0080000000069B1C99B3B70D801000000000000000010000000C79F6AAD5D963D4C9C75E0A0286E3665.ics' in 0.011 seconds: 400 Bad Request
With the content:
Jul 6 19:01:57 px uwsgi[39663]: ORGANIZER;CN="FREEMAN JR., STALONNE";SENT-BY="mailto:[email protected]":mail Jul 6 19:01:57 px uwsgi[39663]: Jul 6 19:01:57 px uwsgi[39663]: to:[email protected] Jul 6 19:01:57 px uwsgi[39663]: ATTENDEE;RSVP=TRUE;CN="LITOVKA, VOLODYMYR";PARTSTAT=NEEDS-ACTION;ROLE=REQ- Jul 6 19:01:57 px uwsgi[39663]: ^n PARTICIPANT:mailto:[email protected] Jul 6 19:01:57 px uwsgi[39663]: ATTENDEE;RSVP=TRUE;CN="POWER, JASON";PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPA Jul 6 19:01:57 px uwsgi[39663]: ^n NT:mailto:[email protected] Jul 6 19:01:57 px uwsgi[39663]: ATTENDEE;RSVP=TRUE;CN="JAMMIE, SAUDI";PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTIC Jul 6 19:01:57 px uwsgi[39663]: ^n IPANT:mailto:[email protected]
Thank you.
I had an extremely similar error and dug in to figure it out. As you can see in the traceback that error is actually happening in the vobject dependency (see here). I cloned that repo and tried loading the offending vcard on my laptop. But it parsed it fine without error! So then I thought harder about it and found that my server was running radicale under python 3.6 while my laptop was running python 3.10. I re-installed radicale on my server using python3.8 and this error went away. I believe the actual underlying issue is at the python level and has been fixed somewhere between 3.6 and 3.8. Are you running on an old python version?
EDIT: oh now I see in your tb that you are using python 3.8... hmm so maybe this doesn't help you.
btw: (potentionally one should also add this to FAQ) here is a validator: https://icalendar.org/validator.html
If the validator let pass the ics, then it's a vobject issue, if it's not passing then one has to dig into vobject, where radicale relies on only.
@doka380, thanks for the report. Is it possible that you still have (or can regenerate) the problematic ICS file? If so, it'd be great if you could attach it to a comment here.
The pasted example looks a little messed up, and I'm wondering if it's been corrupted somewhere going through the logs, cut-and-paste, and the GitHub comments system ...