Webdav/davfs2 mount - 503 Service Unavailable

Have installed NextcloudPi and everything seemed to be working, I can connect to my Nextcloud instance’s domain name via web browser and log in fine. I can connect with the Nextcloud Android app and transfer files fine. Then I tried to setup a webdav/davfs2 mount in Linux and when trying to mount it I get this:

/sbin/mount.davfs: Mounting failed.
503 Service Unavailable

This is what I have in /etc/fstab

https://[mydomainname]/remote.php/dav/files/ncp /mnt/nextcloud  davfs     _netdev,gid=groupname,uid=username,rw,auto       0       0

And I’ve got this in /etc/davfs2/secrets

https://[mydomainname]/remote.php/dav/files/ncp/ ncp [myapppassword]

I thought it might be due to firewall or other NextcloudPi security implementations. But I’ve tried disabling UFW and fail2ban to no avail.

It’s quite odd because I had a Nextcloud instance which I manually set up (i.e. not NextcloudPi) a while back on the exact same RPi device on my exact same home network and webdav worked without issue.

It’s also quite odd because if I just type https://[mydomainname]/remote.php/dav/files/ncp/ into a web browser I don’t get a 503 error I get This is the WebDAV interface. It can only be accessed by WebDAV clients such as the Nextcloud desktop sync client. which would seem to imply that the service is available.

The answer was to set n_cookies to 0 (the default) in /etc/davfs2/davfs2.conf on the client side. It disables cookie exchange between server and client. No idea why that makes it work though, I just tried it and it did!

Hi @binbash , thanks for sharing.
I always use this howto
It is same thing you did initially to set it up. I never needed to edit dav2fs.conf tho.