The caprine application does not start

I just downloaded goats and it doesn’t start. The problem seems similar to other applications, I have these logs on my desktop PC, I have the document folder moved to the external disk, if I start the app on the notebook where all the folders are on the home, it works.

$ cat .config/user-dirs.dirs 
XDG_DESKTOP_DIR="$HOME/Scrivania"
XDG_DOCUMENTS_DIR="/media/emanu/dati/Documenti"
XDG_DOWNLOAD_DIR="/media/emanu/dati/Scaricati"
XDG_MUSIC_DIR="/media/emanu/dati/Musica"
XDG_PICTURES_DIR="/media/emanu/dati/Immagini"
XDG_PUBLICSHARE_DIR="$HOME/Pubblici"
XDG_TEMPLATES_DIR="$HOME/Modelli"
XDG_VIDEOS_DIR="/media/emanu/dati/Video"
cat /etc/fstab
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=b383c3a8-39dd-4edd-98e1-0217a87d266a /               btrfs   defaults,noatime,compress=zstd:1,autodefrag,subvol=@ 0       0
# /boot/efi was on /dev/sda1 during installation
UUID=76C5-B080  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sda2 during installation
UUID=b383c3a8-39dd-4edd-98e1-0217a87d266a /home           btrfs   defaults,noatime,compress=zstd:1,autodefrag,subvol=@home 0       0
LABEL=dati1 /media/emanu/dati btrfs defaults,noatime,compress=zstd,autodefrag 0 0
dic 02 00:35:06 emanuc kernel: audit: type=1400 audit(1575243306.589:206): apparmor="DENIED" operation="open" profile="snap.caprine.caprine" name="/media/emanu/dati/Documenti/" pid=51217 comm="head" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
dic 02 00:35:06 emanuc audit[51220]: AVC apparmor="DENIED" operation="rmdir" profile="snap.caprine.caprine" name="/media/emanu/dati/Documenti/" pid=51220 comm="rmdir" requested_mask="d" denied_mask="d" fsuid=1000 ouid=1000
dic 02 00:35:06 emanuc kernel: audit: type=1400 audit(1575243306.593:207): apparmor="DENIED" operation="rmdir" profile="snap.caprine.caprine" name="/media/emanu/dati/Documenti/" pid=51220 comm="rmdir" requested_mask="d" denied_mask="d" fsuid=1000 ouid=1000

It works if I enable the permissions for the external disk, but I don’t want to enable them for this application …

$ snap run caprine

(caprine:62130): GdkPixbuf-WARNING **: 00:40:45.477: Cannot open pixbuf loader module file '/home/emanu/snap/caprine/common/.cache/gdk-pixbuf-loaders.cache': No such file or directory

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > /home/emanu/snap/caprine/common/.cache/gdk-pixbuf-loaders.cache
to make things work again for the time being.
GLib-GIO-Message: 00:40:47.011: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
(electron) 'getName function' is deprecated and will be removed. Please use 'name property' instead.

did you run the command it suggested you try?

Yes, but the application only starts if I give permission to removable disks.
I don’t have the problem on the notebook where the document folders, Images etc … are on the home.
Why does the application need to access the My Documents folder?
I make a video to better explain the problem.

https://www.youtube.com/watch?v=PDJQeluRtb0

I also have the problem with the “instagramport” application, “App Outlet” and certainly in others, but these two don’t have the option for permission for external disks, so I can’t start them.
How come some applications don’t start if “Documents” is not in the expected position (/home/user/Documents) but in (/media/user/disk/Documents)?
Why do many other applications start up?

dic 04 17:55:01 emanuc xdg-desktop-por[33171]: Failed to get application states: GDBus.Error:org.freedesktop.portal.Error.Failed: Could not get window list: Cannot invoke method; proxy is for the well-known name org.gnome.Shell without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag
dic 04 17:55:27 emanuc xdg-desktop-por[3890]: Failed to get application states: GDBus.Error:org.freedesktop.portal.Error.Failed: Could not get window list: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: App introspection not allowed
dic 04 17:55:35 emanuc audit[50652]: AVC apparmor=“DENIED” operation=“open” profile=“snap.instagramport.instagramport” name="/media/emanu/dati/Documenti/" pid=50652 comm=“head” requested_mask=“r” denied_mask=“r” fsuid=1000 ouid=1000
dic 04 17:55:35 emanuc kernel: audit: type=1400 audit(1575478535.205:204): apparmor=“DENIED” operation=“open” profile=“snap.instagramport.instagramport” name="/media/emanu/dati/Documenti/" pid=50652 comm=“head” requested_mask=“r” denied_mask=“r” fsuid=1000 ouid=1000
dic 04 17:55:35 emanuc kernel: audit: type=1400 audit(1575478535.209:205): apparmor=“DENIED” operation=“rmdir” profile=“snap.instagramport.instagramport” name="/media/emanu/dati/Documenti/" pid=50655 comm=“rmdir” requested_mask=“d” denied_mask=“d” fsuid=1000 ouid=1000
dic 04 17:55:35 emanuc audit[50655]: AVC apparmor=“DENIED” operation=“rmdir” profile=“snap.instagramport.instagramport” name="/media/emanu/dati/Documenti/" pid=50655 comm=“rmdir” requested_mask=“d” denied_mask=“d” fsuid=1000 ouid=1000

i’d assume you have an entry for that dir in your ~/.config/user-dirs.dirs which forces GTK to actually try to use it …

Thanks for the reply.
Yes

:~$ htop
emanu@emanuc:~$ cat ~/.config/user-dirs.dirs
XDG_DESKTOP_DIR="$HOME/Scrivania"
XDG_DOCUMENTS_DIR="/media/emanu/dati/Documenti"
XDG_DOWNLOAD_DIR="/media/emanu/dati/Scaricati"
XDG_MUSIC_DIR="/media/emanu/dati/Musica"
XDG_PICTURES_DIR="/media/emanu/dati/Immagini"
XDG_PUBLICSHARE_DIR="$HOME/Pubblici"
XDG_TEMPLATES_DIR="$HOME/Modelli"
XDG_VIDEOS_DIR="/media/emanu/dati/Video"

Is there something wrong with this?

Even “standard-notes” does not start, the problem is the same.

well, you force the system to look at the external drive for pics, docs, downloads and videos … so indeed if you do this your GTK apps will need access to this when starting … (i think non snapped apps will also always create these dirs forcefully if you have a blank USB stick plugged in and you start a GTK app) i dont think hardcoding these dirs like that is a good idea …

if you move the ~/.config/user-dirs.dirs file away for a test, do the apps start then ?

Yes, if I restore that file in its original configuration, it works.
I have always had this configuration with the documents folder, images etc … (On the / and /home I have a SSD of only 240 GB, so I need to put documents etc on the bigger external disk) always on the external disk, and the applications snaps have always worked (I have been using snap since Ubuntu introduced them) and lately it is complaining.
I did another test: I removed the permission for the home, but the application also complains that it wants to access the Documents folder, but if I remove the permission for the home, it does not have access only to: /home/user/snap/app/folder?

well, that the apps do not start at all when removable-media is unconnected is probably a bug … maybe it should fall back to ~/snap/<snapname>/<current>/ … perhaps @jamesh has some idea what should happen here …

I want to specify many other applications working normally, for example Chromium browser starts normally, even if I don’t enable permission to external disks, the problem is only with some applications.

As you can see from the screenshot Chromium does not have permission for external disks, but starts up.