Strange permissions and/or links to default directories in home folder (Music, Pictures, Public, Templates and Videos))

Bug #2036597 reported by Martin Randau
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
okular (Ubuntu)
Fix Committed
High
Unassigned

Bug Description

Can't enter these folders. This is on an almost fresh install of Mantic.

martin@ThinkPad-P14s-Gen-3:~$ cd Music
bash: cd: Music: Too many levels of symbolic links

martin@ThinkPad-P14s-Gen-3:~$ ls -l
total 2988
drwxrwxr-x 3 martin martin 4096 Sep 18 12:44 bin
drwxr-xr-x 2 martin martin 4096 Sep 19 13:48 Desktop
drwxr-xr-x 19 martin martin 4096 Sep 18 12:42 Documents
drwxr-xr-x 4 martin martin 4096 Sep 19 13:48 Downloads
drwx------ 5 martin martin 4096 Sep 18 16:24 Dropbox
lrwxrwxrwx 1 martin martin 18 Sep 19 13:56 Music -> /home/martin/Music
lrwxrwxrwx 1 martin martin 21 Sep 19 13:56 Pictures -> /home/martin/Pictures
lrwxrwxrwx 1 martin martin 19 Sep 19 13:56 Public -> /home/martin/Public
drwxrwxr-x 3 martin martin 4096 Sep 18 16:25 R
-rw------- 1 martin martin 3029503 Sep 19 14:08 references.bib
drwx------ 13 martin martin 4096 Sep 19 13:56 snap
lrwxrwxrwx 1 martin martin 22 Sep 19 13:56 Templates -> /home/martin/Templates
lrwxrwxrwx 1 martin martin 19 Sep 19 13:56 Videos -> /home/martin/Videos

ProblemType: Bug
DistroRelease: Ubuntu 23.10
Package: nautilus 1:45~rc-1ubuntu1
ProcVersionSignature: Ubuntu 6.5.0-5.5-generic 6.5.0
Uname: Linux 6.5.0-5-generic x86_64
ApportVersion: 2.27.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Tue Sep 19 14:19:32 2023
InstallationDate: Installed on 2023-09-18 (1 days ago)
InstallationMedia: Ubuntu 23.10 "Mantic Minotaur" - Daily amd64 (20230918)
SourcePackage: nautilus
UpgradeStatus: No upgrade log present (probably fresh install)
usr_lib_nautilus:
 nautilus-dropbox 2019.02.14-1.2
 nautilus-extension-gnome-terminal 3.49.92-2ubuntu1

Revision history for this message
Martin Randau (cmmrandau) wrote :
Revision history for this message
Martin Randau (cmmrandau) wrote :

User-dirs-dirs looked strange:

martin@ThinkPad-P14s-Gen-3:~$ cat .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/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/"
XDG_VIDEOS_DIR="$HOME/"

Changing it to:
martin@ThinkPad-P14s-Gen-3:~$ cat .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/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

and running sudo xdg-user-dirs-update restored the folders with the correct icons. No idea what caused this in the first place.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report. How did you install the system and using what locale? Do you have any specific userdir configuration (nfs, ad auth, ...)?

affects: nautilus (Ubuntu) → xdg-user-dirs (Ubuntu)
Changed in xdg-user-dirs (Ubuntu):
status: New → Incomplete
Revision history for this message
Martin Randau (cmmrandau) wrote :

I installed it with default settings and locale but I just remembered that after install I changed the locale to the English_Danish version. Since the folders are restored now I won't try to replicate the error, but it seems something went wrong when installing a new locale.
BW
Martin

Revision history for this message
Sebastien Bacher (seb128) wrote :

alright, let's see if testing would show other issues, those packages didn't change in an decade though so it's a bit surprising

Revision history for this message
Martin Randau (cmmrandau) wrote :

It happened again:

martin@ThinkPad-P14s-Gen-3:~$ ls -l
total 2992
drwxrwxr-x 3 martin martin 4096 Sep 18 12:44 bin
drwxr-xr-x 2 martin martin 4096 Sep 19 13:48 Desktop
drwxr-xr-x 19 martin martin 4096 Sep 18 12:42 Documents
drwxr-xr-x 4 martin martin 4096 Sep 20 11:31 Downloads
drwx------ 5 martin martin 4096 Sep 19 14:56 Dropbox
lrwxrwxrwx 1 martin martin 18 Sep 20 11:32 Music -> /home/martin/Music
drwxrwxr-x 3 martin martin 4096 Sep 19 15:10 Pictures
lrwxrwxrwx 1 martin martin 19 Sep 20 11:32 Public -> /home/martin/Public
drwxrwxr-x 3 martin martin 4096 Sep 18 16:25 R
-rw------- 1 martin martin 3027062 Sep 19 14:37 references.bib
drwx------ 13 martin martin 4096 Sep 19 13:56 snap
lrwxrwxrwx 1 martin martin 22 Sep 20 11:32 Templates -> /home/martin/Templates
lrwxrwxrwx 1 martin martin 19 Sep 20 11:32 Videos -> /home/martin/Videos

but this time, .config/user-dirs.dirs is not changed, or the changes to correct I made before are still there, e.g., XDG_VIDEOS_DIR="$HOME/Videos".

In fact, even though I changed the locale to en_DK, Settings still show the default en_US and locale seems to be a mix?

martin@ThinkPad-P14s-Gen-3:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_DK.UTF-8
LC_TIME=en_DK.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_DK.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_DK.UTF-8
LC_NAME=en_DK.UTF-8
LC_ADDRESS=en_DK.UTF-8
LC_TELEPHONE=en_DK.UTF-8
LC_MEASUREMENT=en_DK.UTF-8
LC_IDENTIFICATION=en_DK.UTF-8
LC_ALL=

Revision history for this message
Sebastien Bacher (seb128) wrote :

The timestamp indicates those were created at 11:32, do you know what you did on the system around that time? is that when you turned the computer on/started the session?

Revision history for this message
Martin Randau (cmmrandau) wrote :
Download full text (31.2 KiB)

No, the laptop had been up and running for some time there. Here's journalctl from 11:32:

Sep 20 11:31:49 ThinkPad-P14s-Gen-3 gnome-shell[3636]: Meta.Rectangle is deprecated, use Mtk.Rectangle instead
Sep 20 11:31:49 ThinkPad-P14s-Gen-3 gnome-shell[3636]: Meta.Rectangle is deprecated, use Mtk.Rectangle instead
Sep 20 11:31:51 ThinkPad-P14s-Gen-3 kernel: audit: type=1400 audit(1695202311.035:244): apparmor="DENIED" operation="open" class="file" profile="snap.firefox.firefox" name="/etc/fstab" pid=6542 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Sep 20 11:31:51 ThinkPad-P14s-Gen-3 dbus-daemon[1487]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.172' (uid=1000 pid=6542 comm="/snap/firefox/3145/usr/lib/firefox/firefox" label="snap.firefox.firefox (enforce)")
Sep 20 11:31:51 ThinkPad-P14s-Gen-3 systemd[1]: Starting systemd-hostnamed.service - Hostname Service...
Sep 20 11:31:51 ThinkPad-P14s-Gen-3 dbus-daemon[1487]: [system] Successfully activated service 'org.freedesktop.hostname1'
Sep 20 11:31:51 ThinkPad-P14s-Gen-3 systemd[1]: Started systemd-hostnamed.service - Hostname Service.
Sep 20 11:31:51 ThinkPad-P14s-Gen-3 kernel: audit: type=1107 audit(1695202311.383:245): pid=1487 uid=101 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.173" pid=6542 label="snap.firefox.firefox" peer_pid=7747 peer_label="unconfined"
                                             exe="/usr/bin/dbus-daemon" sauid=101 hostname=? addr=? terminal=?'
Sep 20 11:31:51 ThinkPad-P14s-Gen-3 kernel: audit: type=1107 audit(1695202311.383:246): pid=1487 uid=101 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.173" pid=6542 label="snap.firefox.firefox" peer_pid=7747 peer_label="unconfined"
                                             exe="/usr/bin/dbus-daemon" sauid=101 hostname=? addr=? terminal=?'
Sep 20 11:31:51 ThinkPad-P14s-Gen-3 gnome-shell[3636]: Meta.Rectangle is deprecated, use Mtk.Rectangle instead
Sep 20 11:31:58 ThinkPad-P14s-Gen-3 gnome-shell[3636]: Meta.Rectangle is deprecated, use Mtk.Rectangle instead
Sep 20 11:31:58 ThinkPad-P14s-Gen-3 gnome-shell[3636]: Meta.Rectangle is deprecated, use Mtk.Rectangle instead
Sep 20 11:32:07 ThinkPad-P14s-Gen-3 gnome-shell[3636]: Meta.Rectangle is deprecated, use Mtk.Rectangle instead
Sep 20 11:32:07 ThinkPad-P14s-Gen-3 gnome-shell[3636]: Meta.Rectangle is deprecated, use Mtk.Rectangle instead
Sep 20 11:32:07 ThinkPad-P14s-Gen-3 gnome-shell[3636]: Meta.Rectangle is deprecated, use Mtk.Rectangle instead
Sep 20 11:32:07 ThinkPad-P14s-Gen-3 gnome-shell[3636]: meta_window_set_stack_position_no_sync: assertion 'window->stack_position >= 0' failed
Sep 20 11:32:08 ThinkPad-P14s-Gen-3 gnome-shell[3636]: Meta.Rectangle is deprecated, use Mtk.Rectangle instead
Sep 20 11:32:08 Th...

Revision history for this message
Martin Randau (cmmrandau) wrote :

.config/user-dirs.dirs is rewritten at boot and logout/login and xdg-user-dirs-update after correcting the file and logout/login does not re-create the folders. It's not nautilus-dropbox since removing it does not stop the error from occurring. Attaching a log from a boot where before rebooting I had corrected user-dirs.dirs. When I logged in, my changes were gone and the folders were again links to themselves. Note that Pictures and Documents were not changed to links, probably because these were non-empty.

Revision history for this message
Martin Randau (cmmrandau) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

it's weird but hard to tell what is rewritting the configuration. Do you have any non standard software you installed?

Revision history for this message
Martin Randau (cmmrandau) wrote :

No, this is a fresh Mantic minimal install from 18/9 with all software installed as snaps, except from MATLAB (propriety), RStudio (deb), thinlinc (deb) and nautilus-dropbox (deb).

As I wrote above, I noticed that locale seems to be a mix of en_US and en_DK and that even though I set it to en_DK in Settings, it reverts to en_US.

martin@ThinkPad-P14s-Gen-3:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_DK.UTF-8
LC_TIME=en_DK.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_DK.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_DK.UTF-8
LC_NAME=en_DK.UTF-8
LC_ADDRESS=en_DK.UTF-8
LC_TELEPHONE=en_DK.UTF-8
LC_MEASUREMENT=en_DK.UTF-8
LC_IDENTIFICATION=en_DK.UTF-8
LC_ALL=

Revision history for this message
Martin Randau (cmmrandau) wrote (last edit ):

Seems like others recently have had the same issue on 22.04: https://askubuntu.com/questions/1483018/home-user-desktop-and-public-folders-show-as-type-link-broken-inode-symlink

Also on 20.04: https://askubuntu.com/questions/1482903/home-directories-turned-into-symbolic-links-without-telling-me-the-reason

These posts are recent ~1 month. Temporary fix is to have at least one file in the folders so as to avoid them being deleted.

Revision history for this message
Gabriele (prodeguerriero) wrote :

Dropping an update here, [same as I did on Stack Exchange](https://askubuntu.com/a/1490412/1105829):

I bumped into the same issue, and I was lucky enough to remember that the only change I made to my system today was to install [okular](https://github.com/KDE/okular).

The fix above works fine, as long as I don't open okular. If I do, and then reboot, I am back to square one.

Note that another user is suggesting that [adding hidden files to the folders prevents this from happening](https://askubuntu.com/questions/1488100/okular-breaking-home-directories-links).

I cannot find any mention of this bug in the KDE bug tracker, so maybe I'll try to add a new one in the coming days. I hope this helps.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Gabriele for sharing that. @Martin, do you also have okular installed?

Revision history for this message
Martin Randau (cmmrandau) wrote :

Yes, in fact, I had just installed the snap version when the error occurred! Great catch, Gabriele! :D

Revision history for this message
Sebastien Bacher (seb128) wrote :

Reassigning to okular, it might be worth reporting the issue also upstream

affects: xdg-user-dirs (Ubuntu) → okular (Ubuntu)
Changed in okular (Ubuntu):
importance: Undecided → High
status: Incomplete → New
Revision history for this message
Oliver Calder (ocalder) wrote :

I just encountered this issue as well when I installed the okular snap. It overwrote my Desktop directory to `Desktop -> /home/<myuser>/Desktop`, same with Public, and resulted in the contents of my home directory being visible on my desktop, which is not desirable obviously.

The version of okular I installed was:
latest/stable: 23.08.4 2023-12-10 (148)

I replaced the broken links with empty directories and rebooted, but `.config/user-dirs.dirs` was still incorrect (I hadn't yet uninstalled okular, but I had not opened it in a few days either).

I manually edited `.config/user-dirs.dirs` and ran `sudo xdg-user-dirs-update`, and my homedir contents are still visible on my desktop. I will reboot to see if the problem is resolved after this.

Revision history for this message
Oliver Calder (ocalder) wrote :

After a reboot, my homedir contents are no longer displayed on my desktop.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in okular (Ubuntu):
status: New → Confirmed
Revision history for this message
Mateusz Stachowski (stachowski-mateusz) wrote :

This bug isn't a bug related to just one snap. It affects all snaps that set HOME to $SNAP_REAL_HOME.

It is a bug of snapd or the gnome-sdk as reported by Popey.

https://github.com/ubuntu/gnome-sdk/issues/188

https://github.com/popey/dosbox-staging-snap/issues/12

https://forum.snapcraft.io/t/setting-home-in-snap-to-user-home-seems-to-cause-all-empty-user-dirs-to-become-broken-symlinks/39463

Revision history for this message
Mateusz Stachowski (stachowski-mateusz) wrote :

Good news this bug has been resolved.

https://github.com/ubuntu/gnome-sdk/issues/188

The fix is currently in the candidate channel of gnome-42-2204 content snap. I can confirm from my own testing it indeed fixes this bug.

Revision history for this message
Mateusz Stachowski (stachowski-mateusz) wrote :

It turns out the bug isn't resolved.

I don't why I thought that Gnome extension will resolve the problem in KDE snap.

This is obviously a KDE program so the fix must be applied to the KDE extension.

Revision history for this message
KDE (kde-community) wrote :
Changed in okular (Ubuntu):
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.