etesync / etesync-dav

This is a CalDAV and CardDAV adapter for EteSync
https://www.etesync.com
GNU General Public License v3.0
285 stars 45 forks source link

MacOS - etesync-dav - "Wrong password for user." error #262

Open flewid opened 2 years ago

flewid commented 2 years ago

Hello,

I am self hosting etesync on my server. Followed all the step to set it up.

When logging in through the web interface (https://pim.etesync.com/pim/contacts) everything works.

However, when trying to setup etesync-dav on my local machine I receive an error.

I run the app with -D to get debug info

then hit http://localhost:37358/

I enter

user: username i created on server password: same password i used on account creation url: https://my.server.com

then I receive "Wrong password for user."

I know the password is correct as it works fine through pim.etesync.com using the same URL.

The debug log displays this, which isn't super helpful;'

[2022-04-06 13:55:17 -0400] [82595/Thread-15] [DEBUG] Sanitized script name: ''
[2022-04-06 13:55:17 -0400] [82595/Thread-15] [DEBUG] Sanitized path: '/favicon.ico'
[2022-04-06 13:55:17 -0400] [82595/Thread-15] [INFO] Access to '/favicon.ico' denied for anonymous user
[2022-04-06 13:55:17 -0400] [82595/Thread-15] [DEBUG] Asking client for authentication
[2022-04-06 13:55:17 -0400] [82595/Thread-15] [DEBUG] Response content:
Access to the requested resource forbidden.
[2022-04-06 13:55:17 -0400] [82595/Thread-15] [INFO] GET response status for '/favicon.ico' in 0.002 seconds: 401 Unauthorized
[2022-04-06 13:55:23 -0400] [82595/Thread-16] [INFO] POST request for '/.web/add/' received from ::1 using 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 Safari/537.36'
[2022-04-06 13:55:23 -0400] [82595/Thread-16] [DEBUG] Request headers:
{'CONTENT_LENGTH': '311',
 'CONTENT_TYPE': 'application/x-www-form-urlencoded',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
 'HTTP_ACCEPT_LANGUAGE': 'en-GB,en-US;q=0.9,en;q=0.8',
 'HTTP_CACHE_CONTROL': 'max-age=0',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': '**masked**',
 'HTTP_HOST': 'localhost:37358',
 'HTTP_ORIGIN': 'http://localhost:37358',
 'HTTP_REFERER': 'http://localhost:37358/.web/add/',
 'HTTP_SEC_FETCH_DEST': 'document',
 'HTTP_SEC_FETCH_MODE': 'navigate',
 'HTTP_SEC_FETCH_SITE': 'same-origin',
 'HTTP_SEC_FETCH_USER': '?1',
 'HTTP_SEC_GPC': '1',
 'HTTP_UPGRADE_INSECURE_REQUESTS': '1',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) '
                    'AppleWebKit/537.36 (KHTML, like Gecko) '
                    'Chrome/99.0.4844.88 Safari/537.36',
 'PATH_INFO': '/.web/add/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '::1',
 'REMOTE_HOST': '',
 'REQUEST_METHOD': 'POST',
 'SCRIPT_NAME': '',
 'SERVER_NAME': '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa',
 'SERVER_PORT': '37358',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.2',
 'wsgi.errors': <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>,
 'wsgi.file_wrapper': <class 'wsgiref.util.FileWrapper'>,
 'wsgi.input': <_io.BufferedReader name=9>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}
[2022-04-06 13:55:23 -0400] [82595/Thread-16] [DEBUG] Sanitized script name: ''
[2022-04-06 13:55:23 -0400] [82595/Thread-16] [DEBUG] Sanitized path: '/.web/add/'
Logging in
[2022-04-06 13:55:24 -0400] [82595/Thread-16] [INFO] POST response status for '/.web/add/' in 1.402 seconds: 200 OK
[2022-04-06 13:55:24 -0400] [82595/Thread-17] [INFO] GET request for '/favicon.ico' received from ::1 using 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 Safari/537.36'
[2022-04-06 13:55:24 -0400] [82595/Thread-17] [DEBUG] Request headers:
{'CONTENT_LENGTH': '',
 'CONTENT_TYPE': 'text/plain',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
 'HTTP_ACCEPT_LANGUAGE': 'en-GB,en-US;q=0.9,en;q=0.8',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': '**masked**',
 'HTTP_HOST': 'localhost:37358',
 'HTTP_REFERER': 'http://localhost:37358/.web/add/',
 'HTTP_SEC_FETCH_DEST': 'image',
 'HTTP_SEC_FETCH_MODE': 'no-cors',
 'HTTP_SEC_FETCH_SITE': 'same-origin',
 'HTTP_SEC_GPC': '1',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) '
                    'AppleWebKit/537.36 (KHTML, like Gecko) '
                    'Chrome/99.0.4844.88 Safari/537.36',
 'PATH_INFO': '/favicon.ico',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '::1',
 'REMOTE_HOST': '',
 'REQUEST_METHOD': 'GET',
 'SCRIPT_NAME': '',
 'SERVER_NAME': '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa',
 'SERVER_PORT': '37358',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.2',
 'wsgi.errors': <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>,
 'wsgi.file_wrapper': <class 'wsgiref.util.FileWrapper'>,
 'wsgi.input': <_io.BufferedReader name=9>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}
[2022-04-06 13:55:24 -0400] [82595/Thread-17] [DEBUG] Sanitized script name: ''
[2022-04-06 13:55:24 -0400] [82595/Thread-17] [DEBUG] Sanitized path: '/favicon.ico'
[2022-04-06 13:55:24 -0400] [82595/Thread-17] [INFO] Access to '/favicon.ico' denied for anonymous user
[2022-04-06 13:55:24 -0400] [82595/Thread-17] [DEBUG] Asking client for authentication
[2022-04-06 13:55:24 -0400] [82595/Thread-17] [DEBUG] Response content:
Access to the requested resource forbidden.
[2022-04-06 13:55:24 -0400] [82595/Thread-17] [INFO] GET response status for '/favicon.ico' in 0.001 seconds: 401 Unauthorized
flewid commented 2 years ago

Oddly enough, I also just tried installing it on my qnap nas through constainer station using docker. And I still receive the 'wrong password for user' error

tasn commented 2 years ago

The instructions can be a bit confusing, but there are multiple passwords. The main page though should use the account password (same as pim.etesync.com) so not sure what's going on.

flewid commented 2 years ago

Yep - understand that once i sign in through localhost, it'll give me a different password that I use from my local apps - is that right?

flewid commented 2 years ago

Also, do you have a docker compose script handy so I can install this on the NAS separately and access from any computer on the lan?

tasn commented 2 years ago

Happy to accept a PR for adding a docker compose, but nothing at the moment.

flewid commented 2 years ago

Okay I've gotten it working with Docker using this compose

######## 
# etesync-dav
########

version: "3"
services:
  etesync:
    image: etesync/etesync-dav
    container_name: etesync
    environment:
      - PUID=1002
      - PGID=100
      - TZ=America/Toronto
      - ETESYNC_DATA_DIR=/data
      - ETESYNC_SERVER_HOSTS=0.0.0.0:37358,[::]:37358
      - GPG_KEY=E3FF2839C048B25C084DEBE9B26995E310250568
      - LANG=C.UTF-8
      - PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - PYTHON_GET_PIP_SHA256=6665659241292b2147b58922b9ffe11dda66b39d52d8a6f3aa310bc1d60ea6f7
      - PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/a1675ab6c2bd898ed82b1f58c486097f763c74a9/public/get-pip.py
      - PYTHON_PIP_VERSION=21.1.3
      - PYTHON_VERSION=3.8.11
    volumes:
      - /share/Configs/docker/etesync-dav:/config
    ports:
          - 37358:37358
    restart: unless-stopped

However, I still have the "Wrong password for user. " error.

Just to run through what I've done;

  1. Installed etesync on my server w/ apache + ssl
  2. logged into the admin and created a user
  3. Connected to it from your website, created a password
  4. All works fine (I can import calendars, contacts, edit, etc)
  5. Then I run the -dav daemon, connect and input the same password I use to connect through the web interface

Am I using the wrong password or something?

flewid commented 2 years ago

okay my mistake on this one. i was trying to use as the admin user on etesync - when I tried all of this as a regular user it worked fine.

So there should be some sort of 'hey dummy you're using the admin account please login with a user account' notice

flewid commented 2 years ago

I'm noticing these issues on the container log, is there a way to fix?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/etesync_dav/radicale/storage.py", line 84, in run
    etesync.sync()
  File "/usr/local/lib/python3.8/site-packages/etesync_dav/local_cache/__init__.py", line 92, in sync
    self.sync_collection(collection.uid)
  File "/usr/local/lib/python3.8/site-packages/etesync_dav/local_cache/__init__.py", line 158, in sync_collection
    self.pull_collection(uid)
  File "/usr/local/lib/python3.8/site-packages/etesync_dav/local_cache/__init__.py", line 196, in pull_collection
    cache_col.save()
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 6601, in save
    rows = self.update(**field_dict).where(self._pk_expr()).execute()
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 1911, in inner
    return method(self, database, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 1982, in execute
    return self._execute(database)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 2479, in _execute
    cursor = database.execute(self)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3173, in execute
    return self.execute_sql(sql, params, commit=commit)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3167, in execute_sql
    self.commit()
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 2933, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 191, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3160, in execute_sql
    cursor.execute(sql, params or ())
peewee.OperationalError: database is locked
[2022-04-07 21:49:47 -0400] [1/Thread-3152] [ERROR] An exception occurred during REPORT request on '/matt/MKnGtm4cHMc7wBBz17cL8kQV1wko6P3o/': database is locked
[2022-04-07 21:50:37 -0400] [1/Thread-474] [ERROR] database is locked
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3160, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.OperationalError: database is locked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/etesync_dav/radicale/storage.py", line 84, in run
    etesync.sync()
  File "/usr/local/lib/python3.8/site-packages/etesync_dav/local_cache/__init__.py", line 90, in sync
    self.sync_collection_list()
  File "/usr/local/lib/python3.8/site-packages/etesync_dav/local_cache/__init__.py", line 115, in sync_collection_list
    collection.save()
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 6601, in save
    rows = self.update(**field_dict).where(self._pk_expr()).execute()
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 1911, in inner
    return method(self, database, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 1982, in execute
    return self._execute(database)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 2479, in _execute
    cursor = database.execute(self)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3173, in execute
    return self.execute_sql(sql, params, commit=commit)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3167, in execute_sql
    self.commit()
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 2933, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 191, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3160, in execute_sql
    cursor.execute(sql, params or ())
peewee.OperationalError: database is locked
[2022-04-07 21:50:37 -0400] [1/Thread-3174] [ERROR] An exception occurred during REPORT request on '/matt/MKnGtm4cHMc7wBBz17cL8kQV1wko6P3o/': database is locked
[2022-04-07 21:55:16 -0400] [1/Thread-3177] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 21:55:17 -0400] [1/Thread-3179] [ERROR] An exception occurred during DELETE request on '/matt/21JVuUF43NdxGyb8IqQsaMxa_TpmfOkk/': 'Collection' object has no attribute 'delete'
[2022-04-07 22:03:18 -0400] [1/Thread-3181] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 22:03:18 -0400] [1/Thread-3183] [ERROR] An exception occurred during MKCOL request on '/matt/408BE5A7-1101-4E34-B741-71266ACEDE20/': <Model: CollectionEntity> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."local_user_id", "t1"."uid", "t1"."eb_col", "t1"."new", "t1"."dirty", "t1"."deleted", "t1"."stoken", "t1"."local_stoken" FROM "collectionentity" AS "t1" WHERE (("t1"."local_user_id" = ?) AND (("t1"."uid" = ?) AND NOT "t1"."deleted")) LIMIT ? OFFSET ?
Params: [1, '408BE5A7-1101-4E34-B741-71266ACEDE20', 1, 0]
[2022-04-07 22:11:36 -0400] [1/Thread-3185] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 22:11:36 -0400] [1/Thread-3187] [ERROR] An exception occurred during DELETE request on '/matt/21JVuUF43NdxGyb8IqQsaMxa_TpmfOkk/': 'Collection' object has no attribute 'delete'
[2022-04-07 22:18:08 -0400] [1/Thread-3200] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 22:18:08 -0400] [1/Thread-3202] [ERROR] An exception occurred during DELETE request on '/matt/21JVuUF43NdxGyb8IqQsaMxa_TpmfOkk/': 'Collection' object has no attribute 'delete'
[2022-04-07 22:26:13 -0400] [1/Thread-3226] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 22:26:13 -0400] [1/Thread-3228] [ERROR] An exception occurred during DELETE request on '/matt/21JVuUF43NdxGyb8IqQsaMxa_TpmfOkk/': 'Collection' object has no attribute 'delete'
[2022-04-07 22:34:25 -0400] [1/Thread-3252] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 22:34:25 -0400] [1/Thread-3254] [ERROR] An exception occurred during MKCOL request on '/matt/408BE5A7-1101-4E34-B741-71266ACEDE20/': <Model: CollectionEntity> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."local_user_id", "t1"."uid", "t1"."eb_col", "t1"."new", "t1"."dirty", "t1"."deleted", "t1"."stoken", "t1"."local_stoken" FROM "collectionentity" AS "t1" WHERE (("t1"."local_user_id" = ?) AND (("t1"."uid" = ?) AND NOT "t1"."deleted")) LIMIT ? OFFSET ?
Params: [1, '408BE5A7-1101-4E34-B741-71266ACEDE20', 1, 0]
[2022-04-07 22:42:27 -0400] [1/Thread-3274] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 22:42:27 -0400] [1/Thread-3276] [ERROR] An exception occurred during MKCOL request on '/matt/408BE5A7-1101-4E34-B741-71266ACEDE20/': <Model: CollectionEntity> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."local_user_id", "t1"."uid", "t1"."eb_col", "t1"."new", "t1"."dirty", "t1"."deleted", "t1"."stoken", "t1"."local_stoken" FROM "collectionentity" AS "t1" WHERE (("t1"."local_user_id" = ?) AND (("t1"."uid" = ?) AND NOT "t1"."deleted")) LIMIT ? OFFSET ?
Params: [1, '408BE5A7-1101-4E34-B741-71266ACEDE20', 1, 0]
[2022-04-07 22:50:36 -0400] [1/Thread-3295] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 22:50:37 -0400] [1/Thread-3297] [ERROR] An exception occurred during DELETE request on '/matt/21JVuUF43NdxGyb8IqQsaMxa_TpmfOkk/': 'Collection' object has no attribute 'delete'
[2022-04-07 22:58:40 -0400] [1/Thread-3312] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 22:58:40 -0400] [1/Thread-3314] [ERROR] An exception occurred during DELETE request on '/matt/21JVuUF43NdxGyb8IqQsaMxa_TpmfOkk/': 'Collection' object has no attribute 'delete'
[2022-04-07 23:06:42 -0400] [1/Thread-3316] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 23:06:42 -0400] [1/Thread-3318] [ERROR] An exception occurred during DELETE request on '/matt/21JVuUF43NdxGyb8IqQsaMxa_TpmfOkk/': 'Collection' object has no attribute 'delete'
[2022-04-07 23:14:43 -0400] [1/Thread-3320] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 23:14:44 -0400] [1/Thread-3322] [ERROR] An exception occurred during MKCOL request on '/matt/408BE5A7-1101-4E34-B741-71266ACEDE20/': <Model: CollectionEntity> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."local_user_id", "t1"."uid", "t1"."eb_col", "t1"."new", "t1"."dirty", "t1"."deleted", "t1"."stoken", "t1"."local_stoken" FROM "collectionentity" AS "t1" WHERE (("t1"."local_user_id" = ?) AND (("t1"."uid" = ?) AND NOT "t1"."deleted")) LIMIT ? OFFSET ?
Params: [1, '408BE5A7-1101-4E34-B741-71266ACEDE20', 1, 0]
[2022-04-07 23:22:53 -0400] [1/Thread-3324] [WARNING] Unsupported REPORT method 'D:principal-search-property-set' on '/' requested
[2022-04-07 23:22:54 -0400] [1/Thread-3326] [ERROR] An exception occurred during MKCOL request on '/matt/408BE5A7-1101-4E34-B741-71266ACEDE20/': <Model: CollectionEntity> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."local_user_id", "t1"."uid", "t1"."eb_col", "t1"."new", "t1"."dirty", "t1"."deleted", "t1"."stoken", "t1"."local_stoken" FROM "collectionentity" AS "t1" WHERE (("t1"."local_user_id" = ?) AND (("t1"."uid" = ?) AND NOT "t1"."deleted")) LIMIT ? OFFSET ?
Params: [1, '408BE5A7-1101-4E34-B741-71266ACEDE20', 1, 0]