Systemd[737]: Failed to start Update XDG user dir configuration

Hey, I have this error in my journal and I’m unable to find how to fix it

juin 06 15:21:16 henmir-fa706qr systemd[737]: xdg-user-dirs-update.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'exit-code'.
juin 06 15:21:16 henmir-fa706qr systemd[737]: Failed to start Update XDG user dir configuration.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 27 and the job result is failed.

This a fresh install and I’ve spent some time fixing every little error shown in the journal but I can’t find anything on the web for this one :dizzy_face:

From what I understand wdg-user-dirs-update has sometthing to do with the default folders in /home, but I don’t understand why it is failing and what I can do to correct it

If this helps, doing journalctl -b | grep xdg-user-dirs-update returns :

juin 06 15:21:16 henmir-fa706qr xdg-user-dirs-update[744]: Can't save user-dirs.dirs
juin 06 15:21:16 henmir-fa706qr systemd[737]: xdg-user-dirs-update.service: Main process exited, code=exited, status=1/FAILURE
juin 06 15:21:16 henmir-fa706qr systemd[737]: xdg-user-dirs-update.service: Failed with result 'exit-code'.

Seems normal,
first guess: the integrated sandbox for “user” → timing problem, it starts later.
second guess: do not use autologin for one day.
You tried in terminal?: xdg-user-dirs-update
Following will not be helpful, I presume:
https://wiki.archlinux.org/title/XDG_user_directories
https://manpages.ubuntu.com/manpages/trusty/man1/xdg-user-dirs-update.1.html

1 Like

first guess: the integrated sandbox for “user” → timing problem, it starts later.

What do you mean with “integrated sandbox” ? :thinking:

second guess: do not use autologin for one day.

I don’t use autologin so we’re clear on this side ^^

You tried in terminal?: xdg-user-dirs-update

Yes and it seems o have worked, didn’t show any error

Following will not be helpful, I presume

Well, as you guessed I’ve already seen these pages and it did not help me. But I might be missing something.
In fact these pages only made me wonder what is the point of having this run at every startup on a single user machine, maybe you would be able to enlighten me ? :sweat_smile:
Like I understand the point of having it run once when setting up the system for the first time but unless there’s multiple users is really useful to have it run every-time ?

It is a user service which updates user dirs from this file:

cat ~/.config/user-dirs.dirs

No idea, but it is probably not there or is not writable.

2 Likes

This is what I get when I run this command

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"

So it is present but it seems it is unable to save it. As far as I know it is not a read only file so I don’t realy know what to do there :sweat_smile:

Do i even need it ? I don’t see what’s the point of having it run every-time my computer boots up, it’s not like the directories are going to disapear suddenly.
Or am I missing something ? :thinking:

$ LANG=C stat ~/.config/user-dirs.dirs
  File: /home/user/.config/user-dirs.dirs
  Size: 640       	Blocks: 8          IO Block: 4096   regular file
Device: 0,41	Inode: 9060453     Links: 1
Access: (0600/-rw-------)  Uid: ( 1000/    user)   Gid: ( 1000/    user)
Access: 2022-06-06 19:45:24.229607780 +0200
Modify: 2022-06-06 19:45:24.229607780 +0200
Change: 2022-06-06 19:45:24.229607780 +0200
 Birth: 2022-06-06 19:45:24.229607780 +0200

The whole point about this is localization. Lets say you switch the desktop language, then the folder names are updated as well.

1 Like

That’s what I get when using this command :

  File: /home/henmir/.config/user-dirs.dirs
  Size: 633             Blocks: 8          IO Block: 4096   regular file
Device: 0,41    Inode: 315         Links: 1
Access: (0600/-rw-------)  Uid: ( 1000/  henmir)   Gid: ( 1000/  henmir)
Access: 2022-06-07 19:46:01.739356421 +0200
Modify: 2022-06-05 21:31:05.450875137 +0200
Change: 2022-06-05 21:31:05.450875137 +0200
 Birth: 2022-06-05 21:31:05.450875137 +0200

So like I thought it is not read only

Ah okay, I’ve also seen that some apps seem to have issue when it is disabled (Which one ? It is a mystery :sweat_smile:)

Well it is quite frustrating to not find the reason of the issue. If you have any other idea I’m happy to listen to it !

I did some searching directly inside the journal without any filter and this is what I found around the error

juin 08 17:30:47 henmir-fa706qr systemd[770]: Reached target Sockets.
juin 08 17:30:47 henmir-fa706qr systemd[770]: Reached target Basic System.
juin 08 17:30:47 henmir-fa706qr systemd[1]: Started User Manager for UID 966.
juin 08 17:30:47 henmir-fa706qr audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=user@966 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
juin 08 17:30:47 henmir-fa706qr systemd[770]: Starting Update XDG user dir configuration...
juin 08 17:30:47 henmir-fa706qr systemd[1]: Started Session c1 of User sddm.
juin 08 17:30:47 henmir-fa706qr xdg-user-dirs-update[778]: Can't save user-dirs.dirs
juin 08 17:30:47 henmir-fa706qr systemd[770]: xdg-user-dirs-update.service: Main process exited, code=exited, status=1/FAILURE
juin 08 17:30:47 henmir-fa706qr systemd[770]: xdg-user-dirs-update.service: Failed with result 'exit-code'.
juin 08 17:30:47 henmir-fa706qr systemd[770]: Failed to start Update XDG user dir configuration.
juin 08 17:30:47 henmir-fa706qr systemd[770]: Reached target Main User Target.
juin 08 17:30:47 henmir-fa706qr systemd[770]: Startup finished in 124ms.
juin 08 17:30:47 henmir-fa706qr audit[768]: USER_START pid=768 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:session_open grantors=pam_unix,pam_systemd acct="sddm" exe="/usr/lib/sddm/sddm-helper" hostname=? addr=? terminal=:0 res=su>
juin 08 17:30:47 henmir-fa706qr sddm[679]: Greeter session started successfully
juin 08 17:30:47 henmir-fa706qr sddm-greeter[779]: High-DPI autoscaling not Enabled

and then later a successful attempt to do the update:

juin 08 17:31:00 henmir-fa706qr systemd[1]: Started User Manager for UID 1000.
juin 08 17:31:00 henmir-fa706qr systemd[826]: Starting Update XDG user dir configuration...
juin 08 17:31:00 henmir-fa706qr systemd[1]: Started Session 2 of User henmir.
juin 08 17:31:00 henmir-fa706qr systemd[826]: Finished Update XDG user dir configuration.
juin 08 17:31:00 henmir-fa706qr systemd[826]: Reached target Main User Target.
juin 08 17:31:00 henmir-fa706qr systemd[826]: Startup finished in 151ms.

So the update is indeed working. It’s just it tries a first time, fail and later is able to do it.
My guess would be that something loads between the attempts which it needs to work properly but what would it be ?

juin 08 17:31:00 henmir-fa706qr kernel: audit: type=1006 audit(1654702260.128:67): pid=826 uid=0 old-auid=4294967295 auid=1000 tty=(none) old-ses=4294967295 ses=3 res=1
juin 08 17:31:00 henmir-fa706qr systemd[826]: pam_unix(systemd-user:session): session opened for user henmir(uid=1000) by (uid=0)
juin 08 17:31:00 henmir-fa706qr systemd[826]: pam_env(systemd-user:session): deprecated reading of user environment enabled
juin 08 17:31:00 henmir-fa706qr audit[826]: USER_START pid=826 uid=0 auid=1000 ses=3 msg='op=PAM:session_open grantors=pam_loginuid,pam_loginuid,pam_keyinit,pam_systemd_home,pam_limits,pam_unix,pam_permit,pam_mail,pam_systemd,pam_env a>
juin 08 17:31:00 henmir-fa706qr audit: BPF prog-id=22 op=LOAD

I see that my session only open after the first attempt, if I understand correctly the file causing the issue is -rw for my user session, so could it be the source of the problem ?

I can reproduce this issue in KDE Wayland on another device.

A solution would be possible:

How to stop running $ xdg-user-dirs-update at every reboot or every KDE SDDM login

Edit /etc/xdg/user-dirs.conf to change

enabled=True

to

enabled=False

OR

Just remove the systemd service /usr/lib/systemd/user/xdg-user-dirs-update.service for home users only.

NOTE: These change will be reset after reinstalling xdg-user-dirs