Kozea / Radicale

A simple CalDAV (calendar) and CardDAV (contact) server.
https://radicale.org
GNU General Public License v3.0
3.28k stars 430 forks source link

Mixture of collections and collection-root #711

Open Forage opened 6 years ago

Forage commented 6 years ago

Hi,

With the release of Radicale 2 there's talk of /var/lib/radicale/collections/ and /var/lib/radicale/collection-root/. The Radicale 1 export function exports to collection-root again.

It's not necessary causing an issue, but it does cause confusion and forces you to pay attention to not mix the two. It would be good to just stick to one and mention collections only as a side note if collection-root should be considered the new preferred location.

For some reason /var/lib/radicale/collections/collection-root/ is also automagically created. Accessing the web interface will add a nice error to the collection stating [wsgi:error] [pid 24051] [7fa5935ce700] ERROR: An exception occurred during GET request on '/.web/': [Errno 13] Permission denied: '/var/lib/radicale/collections/collection-root'

Forage commented 6 years ago

Things are getting a bit more messy.

For the migration from version 1 to 2 I exported my collection and put the result in /var/lib/radicale/collections/username/. Now my client can't find anything but Radicale decided to create /var/lib/radicale/collections/collection-root/username/ with nothing in it.

I'm on Radicale 2.5 for the moment, and using WSGI with Apache. It is the latter asking me for the login credentials and I set the configuration option type in the auth section to remote_user for Radicale. The web interface asks me for the same credentials again though. Using the web interface could also be the cause of the creation of collection-root/username/ under /var/lib/radicale/collections/.

What should the proper structure be? Just /var/lib/radicale/collections/username or /var/lib/radicale/collection-root/username, no?

Unrud commented 6 years ago

/var/lib/radicale/collections is the default storage folder. It can be changed in the configuration. The folder contains the lock file .Radicale.lock and the root collection in the folder collection-root.

The root collection is not stored directly in the storage folder, but in the sub-folder collection-root. This is different from Radicale 1.x.x. (It's needed for atomic creation, replacement and deletion of the root collection.)

For the migration from version 1 to 2 I exported my collection and put the result in /var/lib/radicale/collections/username/.

You have to keep folder collection-root. The full path must be /var/lib/radicale/collections/collection-root/username/.

With the release of Radicale 2 there's talk of /var/lib/radicale/collections/ and /var/lib/radicale/collection-root/.

Where does the documentation mention /var/lib/radicale/collection-root/? That should be fixed.

Forage commented 6 years ago

Thank you for your reply.

It does not explicitly state /var/lib/radicale/collection-root/ but just collection-root. This without the full path anywhere. For me this implies /var/lib/radicale/collection-root/ (being used to Radicale 1).

So there can be something else next to collection-root if I understand correctly? What would that be?

Unrud commented 6 years ago

So there can be something else next to collection-root if I understand correctly? What would that be?

Radicale creates the lock file .Radicale.lock and temporary files .Radicale.tmp-... in the same folder. If you are using versioning, the folder may also contain files from a version control system.

DenisVS commented 5 years ago

This is a most important issue! I spend over 5 hours trying to find out why my server responded by 404 error! Please, write down about in FAQ, User manual and elsewhere! Holy shit...

adrien-n commented 5 years ago

Hi,

I'm coming here after upgrading to debian stable (although I should say that it seems fedora ran into the same issue, only a few months earlier). It's quite likely there will be quite a few people encountering the same issue and asking about it very soon.

I've had to install radicale 1 through pip but export doesn't work:

# radicale --export-storage radicale-export
INFO: Exporting storage for Radicale 2.0.0 to 'radicale-export'
ERROR: Failed to find child collections of '/adrien': generator raised StopIteration

Is it possible to just move the old storae to the new location considering that I was using the default storage backend or should this be never attempted?

More specifically, the following sentence of the documentation made me wonder if there could be compatibility:

This new storage is close to the multifilesystem, but it’s now thread-safe, with atomic writes and file locks.

This seems to imply that the format has not changed and that only the way to write the data has.

tjyrinki commented 5 years ago

I agree that documenation could be improved to be crystal clear on the directories question. Debian helpfully had the following news item before starting an upgrade to Debian 10:


But also that failed to specify where exactly the exported collection-root should be placed. Only by googling to this bug report and reading the comment by Unrud gave me the answer that it's /var/lib/radicale/collections/collection-root

jonassmedegaard commented 5 years ago

Quoting Timo Jyrinki (2019-09-04 10:31:16)

I agree that documenation could be improved to be crystal clear on the directories question. Debian helpfully had the following news item before starting an upgrade to Debian 10:

But also that failed to specify where exactly the exported collection-root should be placed. Only by googling to this bug report and reading the comment by Unrud gave me the answer that it's /var/lib/radicale/collections/collection-root

Debian package maintainer here.

Thanks for your feedback, Timo!

In future, please consider filing bugreports against the Debian package when you notice something being suboptimal there.

I have now updated the NEWS entry. Thanks again.

--

tjyrinki commented 5 years ago

Awesome, Jonas, thank you! I was more thinking updating the 1to2 page for all Radicale users, but yes I formatted the comment like it sounded as a bug against the Debian's NEWS item. Regardless, thank you and that'll help Debian users to migrate!