pimutils / pimutils/vdirsyncer
Valarm causes: 415 Client Error: Unsupported Media Type for url ?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 185
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 1
Description
I am trying to sync a readonly webcal to baikal. It fails with this error. I have tried changing auth to basic with same result.
Can anyone offer some advice? Thanks!
Unknown error occurred for qwerty: 415 Client Error: Unsupported Media Type for url: http://10.0.0.50/dav.php/calendars/asd/qwerty-connect-baikal/326afb1c817asdasd30778e1603a8cea5b90c35db002f8b5342e9ee13d4a.ics
The error message about Validation error in iCalendar: ACTION MUST appear exactly once in a VALARM component but this is what a typical entry in my iCalendar looks like:
BEGIN:VALARM
TRIGGER:-PT15M
UID:asd@mn.co
END:VALARM
BEGIN:VALARM
ACTION:AUDIO
TRIGGER:-PT15M
UID:asd@mn.co
END:VALARM
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER:-PT15M
DESCRIPTION:Asia
END:VALARM
BEGIN:VALARM
ACTION:AUDIO
TRIGGER:-PT15M
END:VALARM
My source iCalendar is from Mighty Networks and include METHOD:PUBLISH but I saw this is now stripped with https://github.com/pimutils/vdirsyncer/commit/38599e1666ecab69a3a533860fc0eb1867085f94
My source iCalendar from Mighty Networks seems to use DOS line breaks? \r\nEND:VCALENDAR'
Is that the problem? What can I do?
- Your vdirsyncer version -
0.18 - If applicable, which server software (and which version) you're using
Baikal 0.9.2* Your Python version
Python 3.10.4* Your operating system
Ubuntu 22.04 LTS* Your config file
[pair qwerty]
a = "qwerty_public"
b = "qwerty_private"
collections = null
[storage qwerty_public]
type = "http"
# The URL to your iCalendar file.
url = "https://..."
[storage qwerty_private]
type = "caldav"
# The direct URL to your calendar.
url = "http://10.0.0.50/dav.php/calendars/asd/qwerty-connect-baikal"
# The credentials to your CalDAV server
username = "asd"
password = "asd"
auth = "digest"
- Use
vdirsyncer -vdebugfor debug output. The output is sensitive, but
please attach at least the last few lines before the error (if applicable),
censored as necessary. This is almost always the most useful information.
debug: Sending request...
debug: 415
debug: {'Server': 'nginx/1.21.6', 'Date': 'Sat, 28 May 2022 19:16:52 GMT', 'Content-Type': 'application/xml; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'Cache-Control': 'no-store, no-cache, must-revalidate', 'Pragma': 'no-cache', 'X-Sabre-Version': '4.3.1'}
debug: b'<?xml version="1.0" encoding="utf-8"?>\n<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">\n <s:sabredav-version>4.3.1</s:sabredav-version>\n <s:exception>Sabre\\DAV\\Exception\\UnsupportedMediaType</s:exception>\n <s:message>Validation error in iCalendar: ACTION MUST appear exactly once in a VALARM component</s:message>\n</d:error>\n'
error: Unknown error occurred for qwerty: 415 Client Error: Unsupported Media Type for url: http://10.0.0.50/dav.php/calendars/asd/qwerty-connect-baikal/326afb1c817asdasd30778e1603a8cea5b90c35db002f8b5342e9ee13d4a.ics
error: Use `-vdebug` to see the full traceback.
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/cli/utils.py", line 75, in handle_cli_error
debug: raise e
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 154, in sync
debug: action.run(a_info, b_info, conflict_resolution, partial_sync)
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 177, in run
debug: self._run_impl(a, b)
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/sync/__init__.py", line 207, in _run_impl
debug: href, etag = self.dest.storage.upload(self.item)
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/base.py", line 13, in inner
debug: return f(self, *args, **kwargs)
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/base.py", line 13, in inner
debug: return f(self, *args, **kwargs)
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 548, in upload
debug: return self._put(href, item, None)
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 516, in _put
debug: response = self.session.request(
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/storage/dav.py", line 397, in request
debug: return http.request(method, url, session=self._session, **more)
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/vdirsyncer/http.py", line 174, in request
debug: r.raise_for_status()
debug: File "/root/.local/pipx/venvs/vdirsyncer/lib/python3.10/site-packages/requests/models.py", line 960, in raise_for_status
debug: raise HTTPError(http_error_msg, response=self)
error: 1 out of 2 tasks failed.
Contributor 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.
Research direction
Start with the supplied vdirsyncer -vdebug output and the upload path in vdirsyncer/storage/dav.py, especially upload and _put. Inspect how the source VALARM components are handled before the CalDAV upload and determine the expected behavior for this malformed calendar; done would require an agreed fix or documented limitation with a reproducible test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100