-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing event without UID makes khal crash #632
Comments
The issue here is that the VEVENT you are trying to has no UID which is required by relevant RFC (RFC 5545) and the icalendar library we are using here and there really is no sensible way for us in khal to work around that. I have opened an issue for icalendar, but don't expect icalendar to accept this any time soon, if at all. I would suggest opening an issue with calcurse as well, this might lead to faster results. As long as you only want to import this single event, you might want to insert a line like this Also, thank you for the well formed issue and I'm sorry for not being able to help you. |
What about the |
The problem lies with the underlying icalendar library, which throws an exception when it encounters a vevent without a uid. This cannot be fixed without changing icalendar (or building or using another icalendar parser). |
Just wanted to add, since this helped me solve my problem, that it does work to add a random UID (I used my password generator) but if you're importing a flight confirmation there might be two events in a single Then |
I've encountered the same problem and used the following bash script to automatically add UID's to ics files. #!/bin/bash
set -e
while read line
do
echo $line
if [ "$line" = "BEGIN:VEVENT" ]
then
echo "UID:$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 36)"
fi
done |
@dopefishh for next time:
scnr |
I'd encourage you to reach out to whomever sends those iCalendar files, and ask for them to be fixed. One of the issues of just automatically adding a UID, is that it's impossible to detect duplicates, or updates to a same event (eg: if the UID is the same, it's an update, if it's a new one, it's a new event). Also, no harm is asking for them to actually generate valid iCalendar files. |
@WhyNotHugo good luck, I've tried. Sites, such as Eventbrite, don't even bother to reply. That is if you find a way to even get in touch with them. |
It might make sense to use the file's It'll avoid duplication if it gets imported more than once. If you import an updated version though, you'll get a duplicate, but tough luck, that's what UIDs are for. |
That sounds like a good idea, thanks! |
Could I got this message on the very first event I wanted to import using this software and seeing it crash is not great user experience. A message stating that the file is invalid would be a lot better. |
Isn't this fixed by #1082 ? |
Ah possibly, looks like it should have. Sorry. I just found this issue with no recent activity suggesting recent changes, so I didn't bother checking HEAD, latest release doesn't have #1082. My bad. |
No worries, forgot to update this issue anyway. Can you confirm that it works fine for you on |
Yeah, seems to work. Thanks. |
I exported an event and a todo list item using calcurse to ics format with the following command:
calcurse --export > mytest.ics
It created the following:
And running
khal import -r mytest.ics
gives me the following errorThe text was updated successfully, but these errors were encountered: