Snap does not respect directory settings

Tested it and I can correct my previous post: it does indeed happen after launching the app. The install process in itself doesn’t do anything to the home directory…

I’m not sure of the exact cause, but there are likely a few things going on here:

  1. strict confined snaps have $HOME set to ~/snap/<pkgname>/<rev>, so would not generally find the host system ~/.config/user-dirs.dirs file by default:

    james@scruffy:~$ echo ~/.config/user-dirs.dirs
    /home/james/.config/user-dirs.dirs
    james@scruffy:~$ snap run --shell iagno
    To run a command as administrator (user "root"), use "sudo <command>".
    See "man sudo_root" for details.
    
    james@scruffy:/home/james$ echo ~/.config/user-dirs.dirs
    /home/james/snap/iagno/14/.config/user-dirs.dirs
    
  2. snapcraft-desktop-helpers does run xdg-user-dirs-update to generate a user-dirs.dirs file for the confined application. But the paths in that file are all $HOME relative, so shouldn’t alter anything in the user’s home directory:

    james@scruffy:~$ snap run --shell iagno
    To run a command as administrator (user "root"), use "sudo <command>".
    See "man sudo_root" for details.
    
    james@scruffy:/home/james$ /snap/iagno/current/gnome-platform/usr/bin/xdg-user-dir DOCUMENTS
    /home/james/snap/iagno/14/Documents
    

So I wonder if the application in question is resetting $HOME itself? It would still see its own user-dirs.dirs file because snapcraft-desktop-helpers sets $XDG_CONFIG_HOME, but would treat those paths as relative to the real home directory.

Another piece of information:

When I launch VLC now (after removing the english-named directories), I get the following lines in Journal:

jan 16 19:47:50 mobileaeris vlc_vlc.desktop[26340]: /home/michalmaria/Desktop was removed, reassigning DESKTOP to homedir
jan 16 19:47:50 mobileaeris vlc_vlc.desktop[26340]: /home/michalmaria/Downloads was removed, reassigning DOWNLOAD to homedir
jan 16 19:47:50 mobileaeris vlc_vlc.desktop[26340]: /home/michalmaria/Templates was removed, reassigning TEMPLATES to homedir
jan 16 19:47:50 mobileaeris vlc_vlc.desktop[26340]: /home/michalmaria/Public was removed, reassigning PUBLICSHARE to homedir
jan 16 19:47:50 mobileaeris vlc_vlc.desktop[26340]: /home/michalmaria/Documents was removed, reassigning DOCUMENTS to homedir
jan 16 19:47:50 mobileaeris vlc_vlc.desktop[26340]: /home/michalmaria/Music was removed, reassigning MUSIC to homedir
jan 16 19:47:50 mobileaeris vlc_vlc.desktop[26340]: /home/michalmaria/Pictures was removed, reassigning PICTURES to homedir
jan 16 19:47:50 mobileaeris vlc_vlc.desktop[26340]: /home/michalmaria/Videos was removed, reassigning VIDEOS to homedir

Hi! Are there any news about this issue? It’s very annoying for those not using English localization, is there something that can be done to help fixing this (for example system logs etc.)?

Cheers

Hi, yes I suffer the same, I really don’t know if it will fix it soon

Yes… i really hope that it will be fixed before Ubuntu 18.04 release, i think that problems like this are a big hindrance to snap adoption, it makes a good software look unpolished and unfinished.

There is also a bug report on Launchpad https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1746710, maybe clicking the “Yes, it affects me” link will make the bug more visible to the developers.

Thanks for that! :slight_smile:

Almost 6 months later it’s still happening. In my case on Ubuntu MATE 18.04, steps:

  • sudo snap install libreoffice

  • open one of the LibreOffice applications

  • check /home folder and see the new folders created

  • ls command shows this:

    Área de Trabalho Documentos Downloads Modelos Música Public snap Videos
    Desktop Documents Imagens Music Pictures Público Templates Vídeos

Multiple reports:

1 Like

User friendly != annoy the user

And if you remove the snap (sudo snap remove libreoffice), the folders are not removed.

So… several months, multiple reports, there’s probably thousands of people right now with duplicated folders thinking that snaps are garbage.

Please, I ask for more attention on fixing this issue, thank you.

1 Like

now install the new version of libreoffice as snap and update snapd and continue with the same error of the home folder, that shame, that incredible of Canonical (again)

Refer https://github.com/ubuntu/snapcraft-desktop-helpers/pull/103 for more details.

This is a remote part used at build time. The fix is released, and we’ve rebuilt all the snaps we maintain to take advantage of the fix. If there is a specific snap you’d like to see the fix in, I’d suggest filing a bug requesting a rebuild of the snap.

The issue with extra folders seems to be fixed, libreoffice snap doesn’t create the folders. I installed other snaps and they didn’t create extra folders too.

Ubuntu 18.04    
Package: snapd
Version: 2.32.9+18.04
1 Like

I am still having the problem. Installed inkscape and, after first launch, english locale home folders were created in my spanish locale installation.

Contact the maintainer to rebuild the package and it should be fixed.

I forgot to mention that my /home is in another drive now, maybe it’s related to that somehow? I don’t know, let’s wait for more feedback.

Hello @kenvandine, can you check this? I believe that you were the one that made some commits on GitHub.

Looks like some people still experience the issue. It’s working for me now, but I have /home on a different drive. Before 18.04 I tested on the same drive and had this issue too.

Thank you.

What version is your snapd?

Open a terminal and type

apt version snapd
and Enter

This info might be useful when a dev see this post.

nope, please use the snap version command instead. The deb version of snapd does not tell you what the actually running version is since (at least on Ubuntu) snapd re-execs itself to the binary shipped in the core snap.

1 Like

Just tested on Linux Mint, no issues, no extra folders.

snap version
snap       2.33.1
snapd      2.33.1
series     16
linuxmint  19
kernel     4.15.0-24-generic

But again, my /home is in another drive, I don’t know how it will behave in the same drive.