Nautilus ( GNOME ) webdav integration in the right way

Nextcloud version: 19.0.6snap1
Operating system and version: Ubuntu 20.04.1 for both server and desktop

The issue you are facing:

Trying to find the proper way to use nc’s webdav on the nautilus on the ubuntu desktop. I want a mount point that is universal so the user can mount any user from nextcloud > like username/password.

The second goal is a single sing-on setup to mount nc’s webdav on login.

Problems:

1. Connecting with URL from NC’s manual. ( davs://HOST/remote.php/dav/files/USER/ )

Nautilus is making a mount point shortcut automatically to davs://HOST/remote.php/dav/ ! So If you click that you are moved to location with folders: addressbooks, avatars, calendars, comments, files, principals …

So you have not access to files folders with permission error: “This location could not be displayed. Sorry, could not display all the contest of “files”: HTTP-error: Method Not Allowed”

Also spamming to logs:

{“reqId”:"",“level”:0,“time”:“2021-01-19T11:07:57+00:00”,“remoteAddr”:"",“user”:"–",“app”:“webdav”,“method”:“HEAD”,“url”:"/remote.php/dav/files/",“message”:{“Exception”:“Sabre\DAV\Exception\NotAuthenticated”,“Message”:“No public access to this resource., No ‘Authorization: Basic’ header found. Either the client didn’t send one, or the server is misconfigured, No ‘Authorization: Bearer’ header found. Either the client didn’t send one, or the server is mis-configured, No ‘Authorization: Basic’ header found. Either the client didn’t send one, or the server is misconfigured”,“Code”:0,“Trace”:[{“file”:"/snap/nextcloud/25104/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",“line”:89,“function”:“beforeMethod”,“class”:“Sabre\DAV\Auth\Plugin”,“type”:"->",“args”:[{“class”:“Sabre\HTTP\Request”},{“class”:“Sabre\HTTP\Response”}]},{“file”:"/snap/nextcloud/25104/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:458,“function”:“emit”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:[“beforeMethod:HEAD”,[{“class”:“Sabre\HTTP\Request”},{“class”:“Sabre\HTTP\Response”}]]},{“file”:"/snap/nextcloud/25104/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:251,“function”:“invokeMethod”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:[{“class”:“Sabre\HTTP\Request”},{“class”:“Sabre\HTTP\Response”}]},{“file”:"/snap/nextcloud/25104/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:319,“function”:“start”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:[]},{“file”:"/snap/nextcloud/25104/htdocs/apps/dav/lib/Server.php",“line”:320,“function”:“exec”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:[]},{“file”:"/snap/nextcloud/25104/htdocs/apps/dav/appinfo/v2/remote.php",“line”:35,“function”:“exec”,“class”:“OCA\DAV\Server”,“type”:"->",“args”:[]},{“file”:"/snap/nextcloud/25104/htdocs/remote.php",“line”:167,“args”:["/snap/nextcloud/25104/htdocs/apps/dav/appinfo/v2/remote.php"],“function”:“require_once”}],“File”:"/snap/nextcloud/25104/htdocs/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",“Line”:161,“CustomMessage”:"–"},“userAgent”:“gvfs/1.44.1”,“version”:“19.0.6.2”}

Workaround is to use davs://HOST/remote.php/webdav/
But then you are getting lots of logs like this.

{“reqId”:"",“level”:0,“time”:“2021-01-19T11:06:02+00:00”,“remoteAddr”:"",“user”:"",“app”:“no app in context”,“method”:“MOVE”,“url”:"/remote.php/webdav/",“message”:“Deprecated event type for {”[object] (OCP\SabrePluginEvent)":{"*statusCode":200,"*message":"","*server":{"[object] (OCA\DAV\Connector\Sabre\Server)":{“tree”:"[object] (OCA\DAV\Connector\Sabre\ObjectTree)","*baseUri":"/remote.php/webdav/",“httpResponse”:"[object] (Sabre\HTTP\Response)",“httpRequest”:"[object] (Sabre\HTTP\Request)",“sapi”:"[object] (Sabre\HTTP\Sapi)","*plugins":[],“transactionType”:null,“protectedProperties”:{"…":“Over 20 items, aborting normalization”},“debugExceptions”:false,“resourceTypeMapping”:[],“enablePropfindDepthInfinity”:true,“xml”:"[object] (Sabre\DAV\Xml\Service)","*listeners":{"…":“Over 20 items, aborting normalization”},"*wildcardListeners":[],"*listenerIndex":[],"*logger":null}},“Symfony\Contracts\EventDispatcher\EventpropagationStopped”:false}}: null",“userAgent”:“gvfs/1.38.1”,“version”:“19.0.6.2”}

{“reqId”:"",“level”:0,“time”:“2021-01-19T11:06:02+00:00”,“remoteAddr”:"",“user”:"",“app”:“no app in context”,“method”:“PROPFIND”,“url”:"/remote.php/webdav/",“message”:“Deprecated event type for {”[object] (OCP\SabrePluginEvent)":{"*statusCode":200,"*message":"","*server":{"[object] (OCA\DAV\Connector\Sabre\Server)":{“tree”:"[object] (OCA\DAV\Connector\Sabre\ObjectTree)","*baseUri":"/remote.php/webdav/",“httpResponse”:"[object] (Sabre\HTTP\Response)",“httpRequest”:"[object] (Sabre\HTTP\Request)",“sapi”:"[object] (Sabre\HTTP\Sapi)","*plugins":[],“transactionType”:null,“protectedProperties”:{"…":“Over 20 items, aborting normalization”},“debugExceptions”:false,“resourceTypeMapping”:[],“enablePropfindDepthInfinity”:true,“xml”:"[object] (Sabre\DAV\Xml\Service)","*listeners":{"…":“Over 20 items, aborting normalization”},"*wildcardListeners":[],"*listenerIndex":[],"*logger":null}},“Symfony\Contracts\EventDispatcher\EventpropagationStopped”:false}}: null",“userAgent”:“gvfs/1.38.1”,“version”:“19.0.6.2”}

2. Using davfs2 real mount point with libpam-mount

That is the best option so far. There actually only one problem with it. It is thumbnailing every file and make huge traffic over the internet. Nautilus do not have option to disable thumbnails for spesific mount point. Someway they have implemented that davs:// network mount. I have no idea how.

Good things with davfs2 is caching, compression, gui optimized usage, user controlled refresh times. Maybe I should take down thumbnailing for whole system.

3. Ubuntu own network account integration spamming also unnessary reguest to /remote.php/caldav example and also logs like mentioned above. You lost universal login possibility to login with any account on nextcloud and storing password permanently in the keyring. This is the worst.

I use the 3rd option without any issues or log spam. And i don’t see that storing the password in gnome keyring is less secure than typing it into a login promt of a 3rd party software instead or maybe even copy it in via clipboard. The opposite is the case actually. Never tried option 1 and 2 though.

It is not ultimate solution when you have example 20 computer. Then every computer have to have local home folders that have to be in sync. The goal is here is going to more like userless computers without any user files on it.

LDAP server that have user back-end to the desktop login and nc is way to go. But if the guest user without LDAP login user wants mount some NC’s webdav the option 1. is for that.

Actually I find bug with option 3. If you type username with your email then the service is working but it is giving brute force warnings at nextcloud server.

1 Like

just tried it in Nautilus with davs://cloud.mydomain.tld/remote.php/dav/files/myuser/. I see only my files, can navigate through folders and open files. Everything is working as expected and no error messages in the log. I Use Arch Linux with GNOME 3.38.3.

Did you copy the url from the files app in your browser? Maybe there is something wrong with the config of your webserver/reverse proxy or http rewrite rules in the config.php. Is the mobile app working without any issuses?

Yes, it is working at first time, but click the bookmark on the left side panel. It is using prefix /remote.php/dav/

@ clear linux / gnome vanilla / 3.38.2

Not for me. If i set a bookmark and hover with the mouse over it is showing the full url (davs://cloud.mydomain.tld/remote.php/dav/files/myuser/). I can also unmount it, then click on the bookmark and it asks me for the username and password again. If I enter my credentials it gets mounted again and everything is working like before. Sorry if that doesn’t help you. But something ist wrong either with your server config or on your client(s).

Maybe it has something to do with this

https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#pretty-urls

or maybe this is of use:

https://docs.nextcloud.com/server/20/admin_manual/issues/general_troubleshooting.html#troubleshooting-webdav

Sorry if I’am not more specific but I can not reproduce the errors on my setup.

1 Like

Hi @raun0,

I am able to replicate this issue under Ubuntu 20.04.1 / Gnome 3.36.8.

1 Like

Hi @raun0,

I’ve also spun up a Lightsail instance and installed NC using snap. I have then connected using webdav from my Ubuntu desktop, and the issue persists.

The question then becomes, is this a NC or Gnome issue. I’ll try connecting from chrome.

Something make a desission use /remote.php/dav prefix over /remote.php/dav/files/USER/

Program name is GIO. (Gnome Input/Output) is a library, designed to present programmers with a modern and usable interface to a virtual file system.

attributes:
  filesystem::type: webdav
  filesystem::remote: TRUE
  gvfs::backend: dav

display name: dav
edit name: dav
nimi: dav
tyyppi: directory
uri: dav://<removed>:8282/remote.php/dav
local path: /run/user/1000/gvfs/dav:host=<removed>,port=8282,ssl=false,prefix=%2Fremote.php%2Fdav
unix mount: gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000
attributes:
  standard::type: 2
  standard::name: dav
  standard::display-name: dav
  standard::edit-name: dav
  standard::icon: inode-directory, folder, inode-directory-symbolic, folder-symbolic
  standard::content-type: inode/directory
  standard::fast-content-type: inode/directory
  standard::symbolic-icon: inode-directory-symbolic, folder-symbolic, inode-directory, folder
  id::filesystem: dav:host=192.168.1.10,port=8282,ssl=false,prefix=%2Fremote.php%2Fdav
  access::can-trash: FALSE

Actually this parameter makes nautilus acting without thumbnails.
filesystem::remote: TRUE

I think so that is not writable attributed when using the davfs2 mount point. :mask:

With regard to mounting the endpoint using webdav / dav

As you mentioned above using davs://HOST/remote.php/webdav/ resolves the issue.
I don’t however get any additional log input.

So do you think the issue is a problem with NC using an incorrect / different route for /webdav and /dav?

At least it is misleading. The manual says to use /dav/files/USER for nautilus and /webdav is “for windows”.

I don’t know am I imagine but it feels like /dev/files/USER/ work snappier.

This is when Integrated Online account has added from settings, it is using /webdav :

attributes:
  filesystem::free: 18446744073709551613
  filesystem::type: webdav
  filesystem::remote: TRUE
  filesystem::used: 16611051
  gvfs::backend: dav

display name: webdav
edit name: webdav
nimi: webdav
tyyppi: directory
uri: dav://<removed>@<removed>:8282/remote.php/webdav
local path: /run/user/1000/gvfs/dav:host=<removed>,port=8282,ssl=false,user=<removed>,prefix=%2Fremote.php%2Fwebdav
unix mount: gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000
attributes:
  standard::type: 2
  standard::name: webdav
  standard::display-name: webdav
  standard::edit-name: webdav
  standard::icon: inode-directory, folder, inode-directory-symbolic, folder-symbolic
  standard::content-type: inode/directory
  standard::fast-content-type: inode/directory
  standard::symbolic-icon: inode-directory-symbolic, folder-symbolic, inode-directory, folder
  etag::value: "6008110fc174a"
  id::filesystem: dav:host=<removed>,port=8282,ssl=false,user=<removed>,prefix=%2Fremote.php%2Fwebdav
  access::can-trash: FALSE
  time::modified: 1611141391
  time::modified-usec: 0

I did a little more testing…

If I add it via “Settings -> Online Accounts” for me the URL looks like this davs://username@HOST/remote.php/webdav …and it’s working for me. But you are right, if it’s mounted this way, you can’t make a bookmark in Nautilus. The Bookmark wouldn’t work once the virtual drive is unmounted. But also a bookmark is not necessary in this case, because the drive stays persistent in the sidebar anyways, when it was added via Online-Accounts.

The other, maybe better way to mount your nextcloud files in Nautilus is going to “Other Locations” and than enter the full URL (davs://HOST/remote.php/dav/files/USER) in the input box “connect to server:” at the bottom of the window. If you mount it like this, the virtual drive uses the the exact URL and also the bookmarks in nautilus are working.

I also found this:

It is for Ubuntu 16.04 but apart from the fact that the GUI has changed and in Gnome you have to click on “other locations” to get to “add server” nothing has changed

@raun0 I’d personally like to just see davs://HOST/remote.php/dav just like davs://HOST/remote.php/webdav (every additional key-stroke has the potential for error!)

@bb77 When I use the webdav endpoint I am able to create a bookmark under Nautilus.

This is the method that fails for me… the dav endpoint is truncated davs://HOST/remote.php/dav

So are you saying you are entering davs://username@HOST/remote.php/dav/files/USER but then your version of Nautilus is transposing it to davs://username@HOST/remote.php/webdav ? That certainly isn’t the case under Ubuntu 20.04 and Nautilus.

So are you saying you are entering davs://username@HOST/remote.php/dav/files/USER but then your version of Nautilus is transposing it to davs://username@HOST/remote.php/webdav ? That certainly isn’t the case under Ubuntu 20.04 and Nautilus.

No. when I use the GNOME-Accounts setup i enter only https://cloud.mydomain.tld and that gets transported to davs://username@HOST/remote.php/webdav in Nautilus. If I mount it via “Add Server” directly in Nautilus I use davs://HOST/remote.php/dav/files/USER and that stays this way, also in the bookmarks.

EDIT:
The second one is davs://HOST/remote.php/dav/files/USER instead of davs://user@HOST/remote.php/dav/files/USER. I corrected the text.

Logs is caused from this issue:

I have no idea is this caused by nextcloud or gvfs.