Skip to content
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

Handle malformed ical events #746

Closed
MelissaAutumn opened this issue Nov 18, 2024 · 7 comments · Fixed by #754
Closed

Handle malformed ical events #746

MelissaAutumn opened this issue Nov 18, 2024 · 7 comments · Fixed by #754
Assignees
Labels
bug Something isn't working sentry this issue has a linked sentry report

Comments

@MelissaAutumn
Copy link
Member

Sentry error:
https://thunderbird.sentry.io/issues/6058269302/events/222965a6d0b44d16b9ad497447b81a02/?project=4505428124827648&referrer=issue_details.related_trace_issue

It seems like some caldav servers can provide malformed events but also error out on requesting them? It's a pretty weird error message, we should at least look at potential solutions here.

@MelissaAutumn MelissaAutumn added bug Something isn't working sentry this issue has a linked sentry report labels Nov 18, 2024
@devmount
Copy link
Collaborator

Ical data was modified to avoid compatibility issues
(Your calendar server breaks the icalendar standard)
This is probably harmless, particularly if not editing events or tasks
(error count: 32 - this error is ratelimited)

This is indeed a weird message. We could just try-catch the calendar.search(...) for now and properly error out, that no events could be retrieved. Would be interesting to know, what exactly was breaking the ical standard.

@MelissaAutumn
Copy link
Member Author

Ah this is a log error not an exception:
https://github.com/python-caldav/caldav/blob/c5899b5cb725d241ee4e68c5fefdcd28cbb7f7f8/caldav/lib/vcal.py#L102

Additionally there's an (empty) issue about it here: python-caldav/caldav#266

If python-caldav uses a separate logger we could mute it (I actually haven't looked into how loggers fully work in python...), or we could submit a patch to add a config option like suggested in the ticket.

@devmount
Copy link
Collaborator

Oh I see! Providing a patch to make that configurable might be the best solution for everyone. In the meantime we could indeed just mute the caldav logger. I think you can simply do it like this:

logger = logging.getLogger('caldav')
logger.setLevel(logging.DEBUG)

@MelissaAutumn
Copy link
Member Author

I think setting the log level to critical should fix that for us.

@devmount
Copy link
Collaborator

Ahm, yes of course 😅

@tobixen
Copy link

tobixen commented Nov 19, 2024

Perhaps it could be downgraded to error again, as the last release of caldav library sends sends this as warnings :-)

@devmount
Copy link
Collaborator

Ah thanks for letting us know! We already planned upgrading to caldav 1.4.0 in #757

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sentry this issue has a linked sentry report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants