Webdav automatic reconnection

Occasionally, I create a temporary webdav server on my phone to transfer files. I then open nautilus, connect to the temporary url, disconnect immediately after finishing the file transfers I need and stop the server.

However, many times, Gnome Files tries to connect automatically to the server without me trying to. What is happening and how to disable this behaviour?

Hello.

Can you explain this more? When and what happens?

Days after having used the temporary WebDAV connection, I find an entry in the sidebar for it where the USB drives, etc. usually show.
If I try to open it, it doesn’t show anything because the server isn’t on. I usually simply unmount it and that usually works, but this morning it kept telling me that it is busy and had to choose unmount anyway.

Oh? It shouldn’t be in the sidebar if you connected to it the regular way.

How exactly did you connect to it? Can you remember the steps?

I mean, for it to be found in the sidebar, it would be an online account (configured in Settings → Online Accounts) or a kernel level mount (instead of FUSE-level gvfs mount).

Does the server have a password? If so, did you choose to remember it always?

I create the local webdav server through an app on my mobile, it is not “online” outside my local network and connect to it in Nautilus by going to “Other locations” and type the dav://ip_address_of_server/name url. The IP address changes depending of where I am. I never ticked any box to remember addresses, but nautilus seems to remember the addresses. Remembering is one thing; connecting automatically apparently at random is another.

Days after having used the temporary WebDAV connection, I find an entry in the sidebar for it where the USB drives, etc. usually show.
If I try to open it, it doesn’t show anything because the server isn’t on. I usually simply unmount it and that usually works, but this morning our kept telling me that it is busy and had to choose unmount anyway

I see. This suggests something is connecting to it on startup. I don’t know whether it is nautilus or any other app.

When you say if claims to be busy, does it tell which app is keeping it busy? Or any other details?

Did you open anything from the server in another app?

Do you have any gnome-shell extensions installed? Does disabling them fix the iasue?

Have you added your dav server to the search locations?

If, when you reboot your computer, you don’t open nautilus but instead open another app such as LibreOffice and use its “Open File” dialog, is the dav server found on its sidebar?

It doesn’t always connect and haven’t identified what triggers it. I never used the dav server except in Nautilus.
I do have a number of extensions installed, but since it happens at random, if I disable them, I won’t be sure that an extension is causing this issue.
I didn’t add the server to the search locations.
The next time it connects, I’ll try to reboot and open libreoffice, open file.

In the meantime, I removed all the remembered dav addresses from Nautilus.

I can confirm that the automatic connection is happening automatically at boot time. There is no entry in /etc/fstab.
I discovered that it if my mobile is not connected to the same wi-fi network, the entry doesn’t show. This is most probably related to KDE Connect on my phone and gsconnect extension. However, when I try to open the entry, it complains that I do not have the necessary permissions.

What you can try is to use dbus-monitor cmd to find out who calls mount operation, e.g. gio mount smb://foo/bar triggers the following:

$ dbus-monitor "member=MountLocation"
method call time=1710340164.453975 sender=:1.467 -> destination=:1.7 serial=59 path=/org/gtk/vfs/mounttracker; interface=org.gtk.vfs.MountTracker; member=MountLocation
   struct {
      array of bytes "/" + \0
      array [
         dict entry(
            string "server"
            variant                array of bytes "foo" + \0
         )
         dict entry(
            string "share"
            variant                array of bytes "bar" + \0
         )
         dict entry(
            string "type"
            variant                array of bytes "smb-share" + \0
         )
      ]
   }
   struct {
      string ":1.467"
      object path "/org/gtk/gvfs/mountop/0"
   }

Then find out the PID of the sender, e.g:

$ dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetConnectionUnixProcessID 'string::1.467'
method return time=1710339880.419542 sender=org.freedesktop.DBus -> destination=:1.459 serial=4294967295 reply_serial=2
   uint32 38054

Finally, see the exact command, e.g.:

$ tr "\0" " " < /proc/38054/cmdline
gio mount smb://foo/bar