Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.4.0 exceptions #1677

Open
glocalglocal opened this issue Jan 13, 2025 · 6 comments
Open

v3.4.0 exceptions #1677

glocalglocal opened this issue Jan 13, 2025 · 6 comments
Labels
need:reporter feedback feedback from reporter required

Comments

@glocalglocal
Copy link

glocalglocal commented Jan 13, 2025

I installed v3.4.0 on Raspbian 10. With Python 3.7.3 I get the web interface but when I attempt to login I get an exception. With Python 3.13.1 I get an exception the moment I run Radicale, After several hours of trying to solve this, I gave up. Any ideas?

$ /usr/bin $ python3 -m radicale --storage-filesystem-folder=/media/user/KINGSTON/MEGA/radicale_data/
[2025-01-13 23:22:34 +0000] [939/Thread-2] [ERROR] An exception occurred during PROPFIND request on '/': Error in section 'owner-write' of rights file '/etc/radicale/rights': Bad value substitution: option 'collection' in section 'owner-write' contains an interpolation key 'login' which is not a valid option name. Raw value: '^%(login)s(/.+)?$'
$ /usr/bin $ python -m radicale --storage-filesystem-folder=/media/user/KINGSTON/MEGA/radicale_data/
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/user/.local/lib/python3.13/site-packages/radicale/__init__.py", line 33, in <module>
    from radicale import config, log, types, utils
  File "/home/user/.local/lib/python3.13/site-packages/radicale/config.py", line 40, in <module>
    from radicale import auth, hook, rights, storage, types, web
  File "/home/user/.local/lib/python3.13/site-packages/radicale/auth/__init__.py", line 37, in <module>
    from radicale import config, types, utils
  File "/home/user/.local/lib/python3.13/site-packages/radicale/types.py", line 56, in <module>
    from radicale import item, storage  # noqa:E402 isort:skip
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.13/site-packages/radicale/item/__init__.py", line 39, in <module>
    from radicale import storage  # noqa:F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.13/site-packages/radicale/storage/__init__.py", line 38, in <module>
    from radicale.item import filter as radicale_filter
  File "/home/user/.local/lib/python3.13/site-packages/radicale/item/filter.py", line 31, in <module>
    from radicale import item, xmlutils
  File "/home/user/.local/lib/python3.13/site-packages/radicale/xmlutils.py", line 32, in <module>
    from radicale import item, pathutils
  File "/home/user/.local/lib/python3.13/site-packages/radicale/pathutils.py", line 76, in <module>
    import ctypes
  File "/usr/local/lib/python3.13/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
$ /usr/bin $ python3 --version
Python 3.7.3
$ /usr/bin $ python --version
Python 3.13.1

EDIT: after some tweaking, using the older python 3.7.3 didn't generate that rights exception, but I keep getting Error: 403 Forbidden in the browser and Thunderbird says the credentials were not accepted. My credentials are saved in ~/.config/radicale/users which is specified in ~/.config/radicale/config as htpasswd_filename = ~/.config/radicale/users

Python 3.13.1 still generates the exception above.

@pbiering
Copy link
Collaborator

Python 3.7.x is no longer supported

And your Python 3.13.1 installation requires a module which looks like missing, see e.g.
https://www.geeksforgeeks.org/how-to-fix-modulenotfounderror-no-module-named-ctypes/

Regarding not accepted password please provide relevant part of debug log.

@glocalglocal
Copy link
Author

Thanks for this. Installing the missing module worked and I get no exception with Python 3.13.1 any more. I am getting the web interface, but when I sign in I get Error: 403 Forbidden.

[2025-01-14 11:33:54 +0000] [26486/Thread-11 (process_request_thread)] [INFO] GET response status for '/.web/css/icon.png' in 0.027 seconds: 200 OK
[2025-01-14 11:34:01 +0000] [26486/Thread-12 (process_request_thread)] [INFO] PROPFIND request for '/' received from 127.0.0.1 using 'Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0'
[2025-01-14 11:34:01 +0000] [26486/Thread-12 (process_request_thread)] [INFO] Access to '/' denied for anonymous user
[2025-01-14 11:34:01 +0000] [26486/Thread-12 (process_request_thread)] [INFO] PROPFIND response status for '/' in 0.002 seconds: 401 Unauthorized
[2025-01-14 11:34:01 +0000] [26486/Thread-13 (process_request_thread)] [INFO] PROPFIND request for '/' received from 127.0.0.1 using 'Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0'
[2025-01-14 11:34:01 +0000] [26486/Thread-13 (process_request_thread)] [INFO] Successful login: 'john' (htpasswd)
[2025-01-14 11:34:01 +0000] [26486/Thread-13 (process_request_thread)] [INFO] Access to '/' denied for 'john'
[2025-01-14 11:34:01 +0000] [26486/Thread-13 (process_request_thread)] [INFO] PROPFIND response status for '/' in 0.017 seconds: 403 Forbidden

My rights looks like below. I have a single user, multiple calendars, no tasks, and Radicale runs on a Raspberry Pi that is only accessible locally (and over VPN when I get there) from specified machines, so it's meant to be a fairly simple setup.

# write access to own files for each user
[owner-write]
user: .+
# collection: ^%(login)s(/.+)?$
collection: john
# collection: %(login)s(/.*)?
# permission: 
permissions: RWrw

@pbiering
Copy link
Collaborator

there was no change, but can you try adding above:

# Allow reading root collection for authenticated users
[root]
user: .+
collection:
permissions: R

Compare also with reference example https://github.com/Kozea/Radicale/blob/master/rights

@pbiering pbiering added question need:reporter feedback feedback from reporter required and removed question labels Jan 14, 2025
@glocalglocal
Copy link
Author

With these permissions I was getting 'forbidden'. After some experiments, I am not sure why, but this worked:

[root]
user: .+
collection: .*
permissions: RWrw

More experiments later, I figured out the strange trick required to import calendars from Thunderbird -- that was tricky because TB's weird design choices, not Radicale's fault. Then, DAVx5 worked immediately. Happy days!

Next task: make the whole setup work when I VPN in. Many thanks for all the help. I can now decommission decsync.

@pbiering
Copy link
Collaborator

With these permissions I was getting 'forbidden'. After some experiments, I am not sure why, but this worked:

[root]
user: .+
collection: .*
permissions: RWrw

This permits every user reading every collection, potentially not what was expected. The rights handling has since some time good debug capabilities, one can enable for further analysis:

# Log rights rule which doesn't match on level=debug
#rights_rule_doesnt_match_on_debug = False

@glocalglocal
Copy link
Author

This permits every user reading every collection, potentially not what was expected.

I think you mean this permits every authenticated user reading and writing every collection, because that's how Radicale is behaving now. This is also what I wanted to achieve as a single user with one collection containing 8 calendars. Or am I missing something?

What is strange though is the behaviour below. Access to calendars is sometimes 'denied for anonymous user' as 'unauthorized'. Problem is there is no anonymous or unauthorized user here. Without me changing anything, access to that same calendar is then successful, which is probably why calendars on Thunderbird and Android appear to sync successfully. This happens with different, probably all of the eight calendars at different times. Is it perhaps normal that Radicale rejects legit connection attempts relying on retries?

[2025-01-15 22:14:09 +0000] [26137/Thread-284 (process_request_thread)] [INFO] Access to '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' denied for anonymous user
[2025-01-15 22:14:09 +0000] [26137/Thread-284 (process_request_thread)] [INFO] HEAD response status for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' in 0.003 seconds: 401 Unauthorized
[2025-01-15 22:14:09 +0000] [26137/Thread-285 (process_request_thread)] [INFO] GET request for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' received from 192.xxx.xxx.xxx using 'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-15 22:14:09 +0000] [26137/Thread-285 (process_request_thread)] [INFO] Access to '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' denied for anonymous user
[2025-01-15 22:14:09 +0000] [26137/Thread-285 (process_request_thread)] [INFO] GET response status for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' in 0.003 seconds: 401 Unauthorized
[2025-01-15 22:14:09 +0000] [26137/Thread-286 (process_request_thread)] [INFO] PROPFIND request for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' with depth '0' received from 192.xxx.xxx.xxx using 'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-15 22:14:09 +0000] [26137/Thread-286 (process_request_thread)] [INFO] Access to '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' denied for anonymous user
[2025-01-15 22:14:09 +0000] [26137/Thread-286 (process_request_thread)] [INFO] PROPFIND response status for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' with depth '0' in 0.003 seconds: 401 Unauthorized
[2025-01-15 22:14:10 +0000] [26137/Thread-287 (process_request_thread)] [INFO] PROPFIND request for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' with depth '0' received from 192.xxx.xxx.xxx using 'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-15 22:14:10 +0000] [26137/Thread-287 (process_request_thread)] [INFO] Access to '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' denied for anonymous user
[2025-01-15 22:14:10 +0000] [26137/Thread-287 (process_request_thread)] [INFO] PROPFIND response status for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' with depth '0' in 0.002 seconds: 401 Unauthorized
[2025-01-15 22:14:28 +0000] [26137/Thread-288 (process_request_thread)] [INFO] HEAD request for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' received from 192.xxx.xxx.xxx using 'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-15 22:14:28 +0000] [26137/Thread-288 (process_request_thread)] [INFO] Access to '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' denied for anonymous user
[2025-01-15 22:14:28 +0000] [26137/Thread-288 (process_request_thread)] [INFO] HEAD response status for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' in 0.002 seconds: 401 Unauthorized
[2025-01-15 22:14:29 +0000] [26137/Thread-289 (process_request_thread)] [INFO] HEAD request for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' received from 192.xxx.xxx.xxx using 'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-15 22:14:29 +0000] [26137/Thread-289 (process_request_thread)] [INFO] Successful login: 'john' (htpasswd)
[2025-01-15 22:14:36 +0000] [26137/Thread-290 (process_request_thread)] [INFO] PROPFIND request for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' with depth '0' received from 192.xxx.xxx.xxx using 'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-15 22:14:36 +0000] [26137/Thread-290 (process_request_thread)] [INFO] Access to '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' denied for anonymous user
[2025-01-15 22:14:36 +0000] [26137/Thread-290 (process_request_thread)] [INFO] PROPFIND response status for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' with depth '0' in 0.002 seconds: 401 Unauthorized
[2025-01-15 22:14:37 +0000] [26137/Thread-291 (process_request_thread)] [INFO] PROPFIND request for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' with depth '0' received from 192.xxx.xxx.xxx using 'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-15 22:14:37 +0000] [26137/Thread-291 (process_request_thread)] [INFO] Successful login: 'john' (htpasswd)
[2025-01-15 22:14:37 +0000] [26137/Thread-291 (process_request_thread)] [INFO] PROPFIND response status for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' with depth '0' in 0.036 seconds: 207 Multi-Status
[2025-01-15 22:14:42 +0000] [26137/Thread-289 (process_request_thread)] [INFO] HEAD response status for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' in 13.506 seconds: 200 OK

[2025-01-16 09:16:31 +0000] [26137/Thread-437 (process_request_thread)] [INFO] Access to '/john/thunderbird_60c81687-7588-fc90-8049-67fcdc08ad7e/' denied for anonymous user
[2025-01-16 09:16:31 +0000] [26137/Thread-437 (process_request_thread)] [INFO] PROPFIND response status for '/john/thunderbird_60c81687-7588-fc90-8049-67fcdc08ad7e/' with depth '0' in 0.002 seconds: 401 Unauthorized
[2025-01-16 09:16:31 +0000] [26137/Thread-438 (process_request_thread)] [INFO] PROPFIND request for '/john/thunderbird_60c81687-7588-fc90-8049-67fcdc08ad7e/' with depth '0' received from 192.yyy.yyy.yyy using 'DAVx5/4.4.5-ose (dav4jvm; okhttp/4.12.0) Android/14'
[2025-01-16 09:16:31 +0000] [26137/Thread-438 (process_request_thread)] [INFO] Successful login: 'john' (htpasswd)
[2025-01-16 09:16:31 +0000] [26137/Thread-438 (process_request_thread)] [INFO] PROPFIND response status for '/john/thunderbird_60c81687-7588-fc90-8049-67fcdc08ad7e/' with depth '0' in 0.175 seconds: 207 Multi-Status
[2025-01-16 09:16:31 +0000] [26137/Thread-439 (process_request_thread)] [INFO] PROPFIND request for '/john/anniversary_9ee275d0-0546-a779-5222-b8b612e8ea98/' with depth '0' received from 192.yyy.yyy.yyy using 'DAVx5/4.4.5-ose (dav4jvm; okhttp/4.12.0) 

[2025-01-16 09:17:09 +0000] [26137/Thread-445 (process_request_thread)] [INFO] PROPFIND response status for '/john/work_9f92b0c1-ff23-866d-826f-9ed4275209a8/' with depth '0' in 14.362 seconds: 207 Multi-Status
^A[2025-01-16 11:26:25 +0000] [26137/Thread-446 (process_request_thread)] [INFO] PROPFIND request for '/john/thunderbird_60c81687-7588-fc90-8049-67fcdc08ad7e/' with depth '0' received from 192.zzz.zzz.zzz using 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-16 11:26:25 +0000] [26137/Thread-446 (process_request_thread)] [INFO] Access to '/john/thunderbird_60c81687-7588-fc90-8049-67fcdc08ad7e/' denied for anonymous user
[2025-01-16 11:26:25 +0000] [26137/Thread-447 (process_request_thread)] [INFO] PROPFIND request for '/john/anniversary_9ee275d0-0546-a779-5222-b8b612e8ea98/' with depth '0' received from 192.zzz.zzz.zzz using 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-16 11:26:25 +0000] [26137/Thread-446 (process_request_thread)] [INFO] PROPFIND response status for '/john/thunderbird_60c81687-7588-fc90-8049-67fcdc08ad7e/' with depth '0' in 0.006 seconds: 401 Unauthorized
[2025-01-16 11:26:25 +0000] [26137/Thread-447 (process_request_thread)] [INFO] Access to '/john/anniversary_9ee275d0-0546-a779-5222-b8b612e8ea98/' denied for anonymous user
[2025-01-16 11:26:25 +0000] [26137/Thread-447 (process_request_thread)] [INFO] PROPFIND response status for '/john/anniversary_9ee275d0-0546-a779-5222-b8b612e8ea98/' with depth '0' in 0.005 seconds: 401 Unauthorized
[2025-01-16 11:26:25 +0000] [26137/Thread-448 (process_request_thread)] [INFO] PROPFIND request for '/john/thunderbird_60c81687-7588-fc90-8049-67fcdc08ad7e/' with depth '0' received from 192.zzz.zzz.zzz using 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-16 11:26:25 +0000] [26137/Thread-449 (process_request_thread)] [INFO] PROPFIND request for '/john/anniversary_9ee275d0-0546-a779-5222-b8b612e8ea98/' with depth '0' received from 192.zzz.zzz.zzz using 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'
[2025-01-16 11:26:25 +0000] [26137/Thread-448 (process_request_thread)] [INFO] Successful login: 'john' (htpasswd)
[2025-01-16 11:26:25 +0000] [26137/Thread-449 (process_request_thread)] [INFO] Successful login: 'john' (htpasswd)
[2025-01-16 11:26:25 +0000] [26137/Thread-448 (process_request_thread)] [INFO] PROPFIND response status for '/john/thunderbird_60c81687-7588-fc90-8049-67fcdc08ad7e/' with depth '0' in 0.147 seconds: 207 Multi-Status
[2025-01-16 11:26:25 +0000] [26137/Thread-450 (process_request_thread)] [INFO] OPTIONS request for '/john/' received from 192.zzz.zzz.zzz using 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Thunderbird/128.6.0'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need:reporter feedback feedback from reporter required
Projects
None yet
Development

No branches or pull requests

2 participants