pimutils / pimutils/vdirsyncer
iCloud discovery fails with 401 https://p34-caldav.icloud.com/.well-known/caldav
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 185
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 1
Description
Before you submit bug reports: https://vdirsyncer.pimutils.org/en/stable/contributing.html
Things to include in your bugreport:
-
Your vdirsyncer version
vdirsyncer, version 0.16.7 -
If applicable, which server software (and which version) you're using
Ubuntu groovy -
Your Python version
Python 3.8.6 -
Your operating system
Ubuntu groovy -
Your config file
# An example configuration for vdirsyncer.
#
# Move it to ~/.vdirsyncer/config or ~/.config/vdirsyncer/config and edit it.
# Run `vdirsyncer --help` for CLI usage.
#
# Optional parameters are commented out.
# This file doesn't document all available parameters, see
# http://vdirsyncer.pimutils.org/ for the rest of them.
[general]
# A folder where vdirsyncer can store some metadata about each pair.
status_path = "~/.vdirsyncer/status/"
# CALDAV
[pair toni_calendar]
a = "ics_local"
b = "icloud"
collections = ["from a", "from b"]
# Calendars also have a color property
metadata = ["displayname", "color"]
[storage ics_local]
type = "filesystem"
path = "~/.calendars/"
fileext = ".ics"
[storage icloud]
type = "caldav"
url = "https://my-url"
username = "***"
password = "***"
- 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.
error: Unknown error occured: 401 Client Error: Unauthorized for url: https://p34-caldav.icloud.com/.well-known/caldav
error: Use `-vdebug` to see the full traceback.
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/cli/utils.py", line 341, in _worker
debug: func(wq=self)
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/cli/tasks.py", line 82, in discover_collections
debug: rv = collections_for_pair(pair=pair, **kwargs)
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/cli/discover.py", line 75, in collections_for_pair
debug: rv = list(expand_collections(
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/cli/discover.py", line 163, in expand_collections
debug: collections = get_b_discovered()
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/cli/discover.py", line 133, in get_self
debug: return self._discovered
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/utils.py", line 170, in __get__
debug: obj.__dict__[self.__name__] = result = self.fget(obj)
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/cli/discover.py", line 142, in _discovered
debug: return handle_storage_init_error(self._cls, self._config)
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/cli/discover.py", line 138, in _discovered
debug: discovered = list(self._cls.discover(**self._config))
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/storage/dav.py", line 267, in discover
debug: for c in self.find_collections():
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/storage/dav.py", line 227, in find_collections
debug: return self._find_collections_impl(self.find_home())
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/storage/dav.py", line 203, in find_home
debug: url = self.find_principal()
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/storage/dav.py", line 174, in find_principal
debug: return self._find_principal_impl(self._well_known_uri)
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/storage/dav.py", line 187, in _find_principal_impl
debug: response = self.session.request('PROPFIND', url, headers=headers,
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/storage/dav.py", line 390, in request
debug: return http.request(method, url, session=self._session, **more)
debug: File "/usr/lib/python3/dist-packages/vdirsyncer/http.py", line 163, in request
debug: r.raise_for_status()
debug: File "/usr/lib/python3/dist-packages/requests/models.py", line 941, in raise_for_status
debug: raise HTTPError(http_error_msg, response=self)
error: 1 out of 1 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 iCloud configuration and the discovery path in vdirsyncer/storage/dav.py, especially find_principal(), find_home(), and the request that receives the 401 response. Reproduce the failure with the reported vdirsyncer, Python, and Ubuntu versions, then determine the cause and verify that iCloud discovery no longer fails or that the resulting behavior is clearly handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100