PROPFIND on user home returns 500: `ValueError` in radicale `xmlutils.make_clark` (meta keys without `prefix:tag` form)
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- backend-api-design
Research direction
Start with storage.py at Collection.get_meta() and compare the returned metadata keys with the names Radicale accepts in xmlutils.make_clark(). Reproduce with the depth-1 PROPFIND request in the issue and inspect the linked pull request #373. Done means the request no longer returns HTTP 500 for collection metadata.
Written by the indexing model from the issue text.
Description
Description
Listing the user's collections — i.e. any depth-1 PROPFIND on the user's home path, which every CalDAV client does immediately after account verification — crashes with HTTP 500.
(This is observable after working around the separate cls.user bug in Storage.discover(), which crashes first on PROPFIND / — see my other issue: https://github.com/etesync/etesync-dav/issues/371 )
Environment
- etesync-dav 0.35.1 — both the prebuilt macOS binary and a source install from the v0.35.1 tag
- macOS 26.6.2, Apple Silicon (source install run under Rosetta x86_64, Python 3.9.6)
- Radicale 3.2.0 (the version etesync-dav pins)
- Server: hosted etesync.com account (api.etebase.com)
Full traceback
Traceback (most recent call last):
File ".../radicale/app/__init__.py", line 108, in __call__
status_text, headers, answers = self._handle_request(environ)
File ".../radicale/app/__init__.py", line 292, in _handle_request
status, headers, answer = function(
File ".../radicale/app/propfind.py", line 407, in do_PROPFIND
xml_answer = xml_propfind(base_prefix, path, xml_content,
File ".../radicale/app/propfind.py", line 71, in xml_propfind
multistatus.append(xml_propfind_response(
File ".../radicale/app/propfind.py", line 139, in xml_propfind_response
clark_tag = xmlutils.make_clark(tag)
File ".../radicale/xmlutils.py", line 90, in make_clark
ns_prefix, tag = human_tag.split(":", maxsplit=1)
ValueError: not enough values to unpack (expected 2, got 1)
Cause
Radicale's xml_propfind_response iterates the keys of collection.get_meta() and passes each one to xmlutils.make_clark(), which requires prefix:tag (or clark {ns}tag) form.
etesync-dav's Collection.get_meta() (storage.py line 445 in 0.35.1) returns the raw etebase collection-info keys:
if key is None:
ret = {}
for key in self.journal.info.keys():
ret[key] = self.meta_mappings.map_get(self.journal.info, key)[1]
return ret
Keys such as name / description / type (no colon, not in radicale's NAMESPACES map) reach make_clark and crash on human_tag.split(":"). The crash occurs on the first collection in the list.
Repro
curl -u user:pass -X PROPFIND -H 'Depth: 1' http://localhost:37358/username/ # 500
Seen identically in the prebuilt macOS 0.35.1 binary and in a source install with radicale pinned to 3.2.0.
Happy to test a patch or a newer build if useful.
- Dominant language
- Python
- Stars
- 332
- Forks
- 61
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from etesync/etesync-dav
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
etesync/etesync-dav#376 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
etesync/etesync-dav#371 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
etesync/etesync-dav#355 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
etesync/etesync-dav#375 · 1 reaction ·
-
*systemd-shutdown[1]: Waiting for process: N (etesync-dav)* lasts ~80 seconds when shutting downOpen
Difficulty 3/5 1-2 days Newbie friendliness 45/100
etesync/etesync-dav#367 ·
All issues in etesync/etesync-dav
Similar issues
-
fuzz fuzz-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Switch to ruffOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Qiskit/qiskit-aer#2533 ·
Maintainers usually reply within 1 day
-
crate-drift
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
po4yka/rust-skills#33 ·
Maintainers usually reply within 1 day