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

Broken ICS file will lead to uncatched exception instead of skip and log on warn level #516

Closed
pbiering opened this issue Sep 15, 2016 · 2 comments

Comments

@pbiering
Copy link
Collaborator

While testing "master" I found during migration tests with real data that one of my calendar entries was broken, resulting in an exception and calendar entries are not sent to client:

2016-09-15 19:27:03,551 - [7f384fec5700] ERROR: An exception occurred during request:
Traceback (most recent call last):
File "/usr/lib64/python3.4/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/usr/lib/python3.4/site-packages/radicale/init.py", line 379, in call
status, headers, answer = function(environ, path, user)
File "/usr/lib/python3.4/site-packages/radicale/init.py", line 572, in do_PROPFIND
path, content, read_items, write_items, user)
File "/usr/lib/python3.4/site-packages/radicale/xmlutils.py", line 525, in propfind
path, collection, props, user, write=True)
File "/usr/lib/python3.4/site-packages/radicale/xmlutils.py", line 658, in _propfind_response
element.text = item.etag
File "/usr/lib/python3.4/site-packages/radicale/storage.py", line 265, in etag
return get_etag(self.serialize())
File "/usr/lib/python3.4/site-packages/radicale/storage.py", line 711, in serialize
items.append(vobject.readOne(fd.read()))
File "/usr/lib/python3.4/site-packages/vobject/base.py", line 1129, in readOne
allowQP))
File "/usr/lib/python3.4/site-packages/vobject/base.py", line 1115, in readComponents
(stack.topName())), n)
vobject.base.ParseError: At line 15: Component VEVENT was never closed

Had to extend storage.py with logging of each read file to get the broken file name

        if os.path.isfile(path):
            self.logger.debug("read object: %s", path)  <- new

Please catch the exception, log the broken object "path" on warn, skip it and continue parsing next files.

@pbiering
Copy link
Collaborator Author

pbiering commented Sep 17, 2016

patch proposed in #517
superseeded by: #526

@liZe
Copy link
Member

liZe commented Feb 27, 2017

#517 is merged, thanks!

@liZe liZe closed this as completed Feb 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants