Unable to sync .var folder

Desktop client doesn’t sync ~/.var folder properly. It only syncs one folder which is:
~/.var/app/com.nextcloud.desktopclient.nextcloud !

  • I tried to restart sync process but it didn’t affect on the result.
  • I reset sync process by deleting .var folder in Server side and “Remove folder sync connection” then adding "Folder sync connection once again but it didn’t affect on the result too :frowning:
  • I tried to remove all the ignores but still get same result.

May you please help me. I googled for many hours but I didn’t get any result.

.sync-exclude.lst (server & client version are matched)

app/io.github.kotatogram/data/
app/org.telegram.desktop/data/
app/com.nextcloud.desktopclient.nextcloud/config/

tree of folders:

:~/.var$ tree -d -L 2
.
└── app
    ├── com.github.elth0r0.iqpuzzle
    ├── com.github.git_cola.git-cola
    ├── com.github.micahflee.torbrowser-launcher
    ├── com.github.qarmin.czkawka
    ├── com.github.tchx84.Flatseal
    ├── com.github.unrud.VideoDownloader
    ├── com.github.vkohaupt.vokoscreenNG
    ├── com.nextcloud.desktopclient.nextcloud
    ├── com.rafaelmardojai.Blanket
    ├── com.visualstudio.code
    ├── fr.handbrake.ghb
    ├── io.dbeaver.DBeaverCommunity
    ├── io.freetubeapp.FreeTube
    ├── io.github.kotatogram
    ├── io.github.peazip.PeaZip
    ├── net.cozic.joplin_desktop
    ├── net.filebot.FileBot
    ├── net.supertuxkart.SuperTuxKart
    ├── no.mifi.losslesscut
    ├── org.chromium.Chromium
    ├── org.ferdium.Ferdium
    ├── org.filezillaproject.Filezilla
    ├── org.flameshot.Flameshot
    ├── org.gnome.Cheese
    ├── org.gnome.EasyTAG
    ├── org.gnome.meld
    ├── org.gnome.World.PikaBackup
    ├── org.goldendict.GoldenDict
    ├── org.kde.digikam
    ├── org.kde.krita
    ├── org.kde.okular
    ├── org.keepassxc.KeePassXC
    ├── org.nmap.Zenmap
    ├── org.qbittorrent.qBittorrent
    ├── org.remmina.Remmina
    ├── org.telegram.desktop
    └── rest.insomnia.Insomnia

38 directories

Server side:

  • NC: 24.0.5
  • Ubuntu 20.04 x64
  • Nginx:
nginx version: nginx/1.22.0
built with OpenSSL 1.1.1f  31 Mar 2020
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-X2AZGW/nginx-1.22.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module

Client side

  • Linux Mint 21 XFCE
  • NC client (flatpak): 3.6.0
  • Flatpak permissions:
$ flatpak info --show-permissions com.nextcloud.desktopclient.nextcloud
[Context]
shared=network;ipc;
sockets=x11;wayland;
devices=dri;
filesystems=/home/laptop/.themes;host-etc;xdg-run/Nextcloud:create;home;host;xdg-config/kdeglobals:ro;host-os;/usr/share/themes;
persistent=../;

[Session Bus Policy]
com.canonical.AppMenu.Registrar=talk
org.kde.kconfig.notify=talk
org.kde.KGlobalSettings=talk
org.kde.StatusNotifierWatcher=talk
org.freedesktop.Notifications=talk
org.freedesktop.secrets=talk
org.kde.*=own

[Environment]
TMPDIR=/var/tmp
GTK_THEME=Mint-Y-Dark-Aqua
QT_STYLE_OVERRIDE=Adwaita-dark

I was having the exact same issue as you. I couldn’t sync anything in ~/.var either.

This is actually due to Flatpak permissions. It sandboxes what applications are allowed to do.

I recommend installing Flatseal and checking your Nextcloud settings there. You should have the option to enable “All user files” or a more granular approach using “Other files”.

I know it’s been some time since your post. I hope this helps you or at the very least helps the next wary traveler who visits this post :smile:

Thanks for the reply. Actually I already use flatseal even I set all the permissions you mentioned above. But didn’t work!

May you send to me a screenshot or flatpak info --show-permissions com.nextcloud.desktopclient.nextcloud result of your flatpak permissions because this issue didn’t solve since forever.

I applied the following permissions:

$ flatpak info --show-permissions com.nextcloud.desktopclient.nextcloud
[Context]
shared=network;ipc;
sockets=x11;wayland;
devices=dri;
filesystems=/home/admino/.themes;host-etc;xdg-run/Nextcloud:create;/home/admino/.var;home;host;xdg-config/kdeglobals:ro;host-os;/usr/share/themes;

[Session Bus Policy]
com.canonical.AppMenu.Registrar=talk
org.kde.kconfig.notify=talk
org.kde.KGlobalSettings=talk
org.kde.StatusNotifierWatcher=talk
org.freedesktop.Notifications=talk
org.freedesktop.secrets=talk
org.kde.*=own

[Environment]
TMPDIR=/var/tmp
GTK_THEME=Mint-Y-Dark-Aqua
QT_STYLE_OVERRIDE=Adwaita-dark

You could try ~/.var/app (instead of just ~/.var), as that seems to be where flatpak mounts an empty directory: flatpak does not see under ~/.var/app even with --filesystem=host · Issue #2735 · flatpak/flatpak · GitHub

However, this workaround could probably stop working at any time, if flatpak changes something about the way in which it internally mounts things. If you have to sync the entire ~/.var you might be better off with a non-sandboxed Nextcloud Client. However, I’d not recommend synchronizing the entire ~/.var anyway, there are probably a lot of cache and host-local files in there.