pimutils / vdirsyncer

📇 Synchronize calendars and contacts.
https://vdirsyncer.pimutils.org/
Other
1.57k stars 163 forks source link

An exception occurred during PROPFIND request on '/': type object 'Collection' has no attribute 'user' #856

Open sergeyklay opened 3 years ago

sergeyklay commented 3 years ago

Something went wrong when I sync my contacts. Debug output:

$ vdirsyncer -vdebug sync
debug: Using 1 maximal workers.
Syncing my_contacts
debug: PROPFIND http://localhost:37358/
debug: {'User-Agent': 'vdirsyncer/0.16.8', 'Content-Type': 'application/xml; charset=UTF-8', 'Depth': '1'}
debug: b'<?xml version="1.0" encoding="utf-8" ?>\n            <D:propfind xmlns:D="DAV:">\n                <D:prop>\n                    <D:resourcetype/>\n                    <D:getcontenttype/>\n                    <D:getetag/>\n                </D:prop>\n            </D:propfind>\n            '
debug: Sending request...
debug: 500
debug: {'Date': 'Thu, 03 Dec 2020 13:06:56 GMT', 'Server': 'WSGIServer/0.2 CPython/3.8.1', 'Content-Length': '59', 'Content-Type': 'text/plain'}
debug: b'A server error occurred.  Please contact the administrator.'
error: Unknown error occurred for my_contacts: 500 Server Error: Internal Server Error for url: http://localhost:37358/
error: Use `-vdebug` to see the full traceback.
debug:   File "/home/egrep/.local/lib/python3.8/site-packages/vdirsyncer/cli/tasks.py", line 62, in sync_collection
debug:     sync.sync(
debug:   File "/home/egrep/.local/lib/python3.8/site-packages/vdirsyncer/sync/__init__.py", line 135, in sync
debug:     b_nonempty = b_info.prepare_new_status()
debug:   File "/home/egrep/.local/lib/python3.8/site-packages/vdirsyncer/sync/__init__.py", line 44, in prepare_new_status
debug:     for href, etag in self.storage.list():
debug:   File "/home/egrep/.local/lib/python3.8/site-packages/vdirsyncer/storage/dav.py", line 630, in list
debug:     response = self.session.request('PROPFIND', '', data=data,
debug:   File "/home/egrep/.local/lib/python3.8/site-packages/vdirsyncer/storage/dav.py", line 388, in request
debug:     return http.request(method, url, session=self._session, **more)
debug:   File "/home/egrep/.local/lib/python3.8/site-packages/vdirsyncer/http.py", line 162, in request
debug:     r.raise_for_status()
debug:   File "/home/egrep/.local/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status
debug:     raise HTTPError(http_error_msg, response=self)
error: 1 out of 2 tasks failed.

Config:

[general]
status_path = "~/.local/state/vdirsyncer/"

[pair my_contacts]
a = "my_contacts_local"
b = "my_contacts_remote"
collections = null
metadata = ["displayname"]
conflict_resolution = ["command", "diff"]

[storage my_contacts_local]
type = "filesystem"
path = "~/.local/share/contacts"
fileext = ".vcf"

[storage my_contacts_remote]
type = "carddav"
url = "http://localhost:37358/"
username = "redacted"
password = "redacted"
$ systemctl status --user etesync-dav
● etesync-dav.service - Cal/CardDAV frontend for Etesync
     Loaded: loaded (/home/egrep/.config/systemd/user/etesync-dav.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2020-12-03 14:58:44 EET; 12min ago
   Main PID: 110329 (etesync-dav)
     CGroup: /user.slice/user-1000.slice/user@1000.service/etesync-dav.service
             ├─110329 /usr/local/bin/etesync-dav
             └─110331 /usr/local/bin/etesync-dav

Dec 03 14:58:44 saturn systemd[1427]: Started Cal/CardDAV frontend for Etesync.
Dec 03 14:58:54 saturn etesync-dav[110331]: [2020-12-03 14:58:54 +0200] [110331/Thread-1] [ERROR] An exception occurred during PROPFIND request on '/': type object 'Collection' has no attribute 'user'
Dec 03 15:00:21 saturn etesync-dav[110331]: [2020-12-03 15:00:21 +0200] [110331/Thread-3] [ERROR] An exception occurred during PROPFIND request on '/': type object 'Collection' has no attribute 'user'
Dec 03 15:01:48 saturn etesync-dav[110331]: [2020-12-03 15:01:48 +0200] [110331/Thread-4] [ERROR] An exception occurred during PROPFIND request on '/': type object 'Collection' has no attribute 'user'
Dec 03 15:02:05 saturn etesync-dav[110331]: [2020-12-03 15:02:05 +0200] [110331/Thread-9] [ERROR] An exception occurred during PROPFIND request on '/': type object 'Collection' has no attribute 'user'
Dec 03 15:06:56 saturn etesync-dav[110331]: [2020-12-03 15:06:56 +0200] [110331/Thread-10] [ERROR] An exception occurred during PROPFIND request on '/': type object 'Collection' has no attribute 'user'

Take a look at:

An exception occurred during PROPFIND request on '/': type object 'Collection' has no attribute 'user'


sergeyklay commented 3 years ago

Setting up collection fixes the issue:

  [general]
  status_path = "~/.local/state/vdirsyncer/"

  [pair my_contacts]
  a = "my_contacts_local"
  b = "my_contacts_remote"
- collections = null
+ collections = ["from a", "from b"]
  metadata = ["displayname"]
  conflict_resolution = ["command", "diff"]

  [storage my_contacts_local]
  type = "filesystem"
  path = "~/.local/share/contacts"
  fileext = ".vcf"

  [storage my_contacts_remote]
  type = "carddav"
  url = "http://localhost:37358/"
  username = "redacted"
  password = "redacted"

As far as I can tell, this is a very unobvious behavior, as well as error message. It's by design?