Skip to content

Confusing "Permission denied" when data directory doesn't exist #2163

Description

@okurka12

Scenario

Be me, entirely new to Radicale, setting it up as a docker container. Somehow I mismatch the directory specifications in config and compose. It shows me Permission denied, so I just force root user to resolve it. What could possibly go wrong?

How it happened

So for example in docker-compose I am mounting /var/lib/radicale but I specified /data in the config (don't ask, maybe I copied some config from somewhere, maybe AI hallucinated it, whatever). The logs look like this:

[2026-06-14 01:00:49 +0000] [1] [INFO] Storage location: '/data/collections'
[2026-06-14 01:00:49 +0000] [1] [WARNING] Storage location: '/data/collections' does not exist, creating now
[2026-06-14 01:00:49 +0000] [1] [ERROR] Directory permissions: path='/' owner=root(0) group=root(0) mode=40755 / Effective user: user=radicale(1000) groups=radicale(1000),radicale(1000)
[2026-06-14 01:00:49 +0000] [1] [CRITICAL] An exception occurred during server startup: [Errno 13] Permission denied: '/data'

I look at the last line and see Permission denied. I don't think much about it, I just add user: "0:0" to my compose file, it works, I get on with my life.

What I don't realize is that instead of storing the persisnent data in the mounted directory, it stores them in a dicrectory that it itself created within the container. Then my server restarts a week later during an unattended upgrade and the data is gone? 😅 (Luckily i could just export everything from thunderbird offline cache, but it still gave me a little heart attack)

Conclusion

Maybe this is a skill issue on my side but I think it could be improved how this error is communicated to prevent others from doing what I just did. Perhaps Radicale could be smart and refuse to operate if both the configured directory doesn't exist and it is running in a container.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions