Skip to main content

4. Fixing "Caldav" and "Carddav Errors"

On almost every nextcloud installtion via docker so far, I have seen this error pop up. This may cause issues when trying to sync contacts or calendar events through apps. For this reason, we need to edit a text file to fix the error

Error:

nextcloud_error.png

How to Fix This Error:

In order to fix this error, we are going to have to execute into the nextcloud container. Enter the following commands:

docker exec -it nextcloud /bin/bash

You should observer your terminal change into something like this: root@f78959f71f14:/var/www/html#

Then enter:

cd /etc/apache2/sites-enabled
apt update
apt install nano
nano 000-default.conf

You should see a text file like so:

nextcloud-apache-file.png

Underneath <\VirtualHost>, copy and paste the following ENSURING you change cloud.kvis.uk to your own domain

Redirect 301 /.well-known/carddav https://cloud.kvis.uk/remote.php/dav
Redirect 301 /.well-known/caldav https://cloud.kvis.uk/remote.php/dav
Redirect 301 /.well-known/webdav https://cloud.kvis.uk/remote.php/dav
Redirect 301 /.well-known/webfinger https://cloud.kvis.uk/index.php
Redirect 301 /.well-known/nodeinfo https://cloud.kvis.uk/index.php

It should then look something like this:

nextcloud-editted-apache-fike.png

Then enter Ctrl + X,y and Enter

Type exit to return to your host terminal.

To start nextcloud again enter docker restart nextcloud

And this time when you check the overview page, there should be no errors! There might be an error complaining about /.well-known/webfinger and /.well-known/nodeinfo but they do not affect any functionality and can thus be safely ignored. Proceed to the next page, for increasing the maximum size limit when uploading files.