Boxy-svg doesn't start, and seems to want to do weird things with directories

I have boxy-svg installed (https://snapcraft.io/boxy-svg). When I try to start it, it doesn’t start. Starting it from the command line also doesn’t do anything, either with boxy-svg or snap run boxy-svg.

Weirder yet, I get these lines in journalctl:

Nov 12 23:09:57 dawn audit[1702]: AVC apparmor="DENIED" operation="file_mmap" profile="/snap/core/8039/usr/lib/snapd/snap-confine" name="/usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0" pid=1702 comm="snap-confine" requested_mask="m" denied_mask="m" fsuid=0 ouid=0
Nov 12 23:09:57 dawn kernel: audit: type=1400 audit(1573600197.371:5657): apparmor="DENIED" operation="file_mmap" profile="/snap/core/8039/usr/lib/snapd/snap-confine" name="/usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0" pid=1702 comm="snap-confine" requested_mask="m" denied_mask="m" fsuid=0 ouid=0
Nov 12 23:09:57 dawn audit[1772]: AVC apparmor="DENIED" operation="open" profile="snap.boxy-svg.boxy-svg" name="/media/second_drive/Music/" pid=1772 comm="head" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Nov 12 23:09:57 dawn kernel: audit: type=1400 audit(1573600197.419:5658): apparmor="DENIED" operation="open" profile="snap.boxy-svg.boxy-svg" name="/media/second_drive/Music/" pid=1772 comm="head" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Nov 12 23:09:57 dawn audit[1778]: AVC apparmor="DENIED" operation="rmdir" profile="snap.boxy-svg.boxy-svg" name="/media/second_drive/Music/" pid=1778 comm="rmdir" requested_mask="d" denied_mask="d" fsuid=1000 ouid=1000
Nov 12 23:09:57 dawn kernel: audit: type=1400 audit(1573600197.431:5659): apparmor="DENIED" operation="rmdir" profile="snap.boxy-svg.boxy-svg" name="/media/second_drive/Music/" pid=1778 comm="rmdir" requested_mask="d" denied_mask="d" fsuid=1000 ouid=1000

Now, my machine is set up a little unusually; $HOME/Music is a symlink to /media/second_drive/Music, which is on another drive (mounted at /media/second_drive). I can understand how that might confuse a bit of software. However, I really feel like it ought to not be trying to delete my Music folder! Fortunately it was prevented from doing so, and I don’t know whether this is related to it not starting or not. How might I go about debugging this further?

Update: @popey suggests that this is something that xdg-user-dirs-update does, and that may be at fault for not checking correctly whether my xdg Music folder is a symlink. Perhaps that’s what’s causing the startup failure? If so, maybe it’s a problem in the gnome platform snap; one for @kenvandine perhaps… :slight_smile:

Indeed. This is easy to reproduce. I moved my ~/Music to /data/Music, set a symlink, tested my music still worked with Rhthmbox and started boxy-svg.

$ boxy-svg 
/home/alan/Music was removed, reassigning MUSIC to homedir

Running a second time worked.

Looks like the net result is it updates ~/snap/boxy-svg/current/.config/user-dirs.dirs: to point the MUSIC XDG variable to somewhere it can see.

$ cat ~/snap/boxy-svg/current/.config/user-dirs.dirs
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="/home/alan/Desktop"
XDG_DOWNLOAD_DIR="/home/alan/Downloads"
XDG_TEMPLATES_DIR="/home/alan/Templates"
XDG_PUBLICSHARE_DIR="/home/alan/Public"
XDG_DOCUMENTS_DIR="/home/alan/Documents"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="/home/alan/Pictures"
XDG_VIDEOS_DIR="/home/alan/Videos"

yup! I can confirm that I edited ~/snap/boxy-svg/current/.config/user-dirs.dirs to point a bunch of entries at directories that aren’t symlinks to an external drive that the snap can’t see, and now boxy-svg starts. This still seems like a bug, of course.

23:27 ~ $ cat snap/boxy-svg/current/.config/user-dirs.dirs
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="/home/aquarius/Desktop"
XDG_DOWNLOAD_DIR="/home/aquarius/Downloads"
XDG_TEMPLATES_DIR="/home/aquarius/Templates"
XDG_PUBLICSHARE_DIR="/home/aquarius/Public"
XDG_DOCUMENTS_DIR="/home/aquarius/Documents"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/"
XDG_VIDEOS_DIR="$HOME/"