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

Error when starting etesync-dav service: cannot import name 'URLField' from 'wtforms' #251

Closed wiktor-k closed 2 years ago

wiktor-k commented 2 years ago

Hi,

I've just installed etesync-dav on Arch via etesync-dav AUR package and started the service via systemctl --user start etesync-dav.service.

Unfortunately when visiting http://localhost:37358/.web I see only A server error occurred. Please contact the administrator. and the console contains:

systemd[4353]: Started Cal/CardDAV frontend for Etesync.
etesync-dav[60018]: [2022-01-20 13:26:56 +0100] [60018/Thread-2 (process_request_thread)] [ERROR]
   An exception occurred during GET request on '/.web': cannot import name 'URLField' from 'wtforms' (/usr/lib/python3.10/site-packages/wtforms/__init__.py)

I'm no Python developer but I see wtforms being installed before etesync-dav:

(20/22) installing python-wtforms

Is this a versioning problem?

For the record:

$ pacman -Qi python-wtforms
Name            : python-wtforms
Version         : 2.3.3-3

and

$ pacman -Qi etesync-dav
Name            : etesync-dav
Version         : 0.32.1-1

Thanks in advance for help!

tasn commented 2 years ago

Python-wtforms 3.0.0 is out and the Arch package is outdated unfortunately. :( This is the commit that updated to the lastest version: https://github.com/etesync/etesync-dav/commit/ca2a35bb8573077780dd3e487aeca9290f437d15

Either downgrade etesync-dav to an older version or get arch to finally update https://archlinux.org/packages/community/any/python-wtforms/ or try to install the latest version of python-wtf from AUR.

wiktor-k commented 2 years ago

Hmm... that's unfortunate. I figured out that if the service starts as a user service I could just install the dependencies in the exact versions required using pip install -r requirements.txt where the file came from your repository.

One thing that didn't work is that it still failed with An exception occurred during GET request on '/.web': No module named 'wtforms.fields.html5' but I found a similar error on Stackoverflow where they mentioned that the module has been changed in version 3.x. Using WTForms==2.3.3 fixed the error and everything is working. This is surprising as requirements.txt has WTForms in version >= 3 but since this is working now I'm not keen on debugging this further :)

Thanks for your help! I'm closing the issue since now "it works on my machine" :)

tasn commented 2 years ago

It's really just arch being old unfortunately. :(