edit: I have tried using mkdir /var/lib/radicale and /var/lib/radicale/collections (with and without -p), chown radicale:radicale /var/lib/radicale (and collections) with and without -R, and the same for chmod 770 and chmod g-w,o-rwx. NOTHING WORKS!!! I just want to self-host a calendar…

I’ve also tried removing the “strict” security settings from my config, but no luck.

maybe the warning that preceded the permission denied is helpful? I don’t know why is is “not existing” though, I’ve already tried using mkdir and chown…

[2025-05-01 13:34:06 +0800] [6537] [WARNING] Storage location: '/var/lib/radicale/collections' not existing, create now
[2025-05-01 13:34:06 +0800] [6537] [CRITICAL] An exception occurred during server startup: [Errno 13] Permission denied: '/var/lib/radicale/collections'

original post:

I am following the steps of the radicale documentation and have got to running it as a service. However, when I ran radicale it failed to start. When I tried to run radicale manually, I get a permission denied error

[CRITICAL] An exception occurred during server startup: [Errno 13] Permission denied: '/var/lib/radicale/collections'

I have tried manually using mkdir to create /var/lib/radicale/collections and setting the owner using chown -R radicale:radicale to the “radicale” user, and I have also tried using chmod -R 770.

my config (/etc/radicale/config)

[auth]
type = htpasswd
htpasswd_filename = /etc/radicale/users
htpasswd_encryption = autodetect

delay = 1

[server]
hosts = 0.0.0.0:5232, [::]:5232

max_connections = 20
max_content_length = 100000000
# 100 MB
timeout = 30
# 30 seconds

[storage]
filesystem_folder = /var/lib/radicale/collections

my radicale.service (/etc/systemd/system/radicale.service

[Unit]
Description=A simple CalDAV (calendar) and CardDAV (contact) server
After=network.target
Requires=network.target

[Service]
ExecStart=/usr/bin/env python3 -m radicale
Restart=on-failure
User=radicale
# Deny other users access to the calendar data
UMask=0027
# Optional security settings
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
NoNewPrivileges=true
ReadWritePaths=/var/lib/radicale/ /var/cache/radicale/

[Install]
WantedBy=multi-user.target
  • Morethanevil@lemmy.fedifriends.social
    link
    fedilink
    English
    arrow-up
    11
    ·
    4 days ago

    The user “radicale” needs access to the folder Permission denied says it clearly.

    sudo chown -R radicale:radicale /var/lib/radicale

    This should fix it

    • sbird@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 days ago

      just tried it both with sudo and as root, also tried it with /var/lib/radicale/collections. The error still occurs, and there’s a warning note that says that the directory doesn’t exist and is being created even though I’ve already created it with mkdir

    • irmadlad@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      4 days ago

      May have to chown /var/lib/radicale/collections as well:

      ls -ld /var/lib/radicale/collections

      If the directory doesn’t exist, create it:

      sudo mkdir -p /var/lib/radicale/collections
      sudo chown radicale:radicale /var/lib/radicale/collections
      
      sudo chown radicale:radicale /var/lib/radicale/collections
      sudo chmod 750 /var/lib/radicale/collections
      
      

      At least that’s what my notes say.

    • sbird@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 days ago

      I’ll try that, but I’m pretty sure I’ve done that already. I might be wrong though, thanks! (maybe I did the command wrong)

  • vfscanf@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    5
    ·
    4 days ago

    I don’t know if you’re using debian but I encountered the same issue. The wiki has instructions to fix this (section create essential directories):

    Debian wiki

      • vfscanf@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 day ago

        Can you maybe give us a ls -Al of /var/lib/radicale and /var/lib/radicale/collections to double check the permissions? I just looked at the systemd documentation and the service definition looks ok.

      • vfscanf@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        1 day ago

        I suspect its got something to do with the systemd service definition. You may have to tweak the parameters under “optional security settings” to make it work. Or maybe you could start radicale manually from the command line, just for testing, and see if that works

    • sbird@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 days ago

      ooh that seems really helpful, thanks :D

      I’ll try that once I come home