Cant run obsidian, and it deleted important directories

Steps to reproduce

I eradicated the faulty software from my system. Don’t know, and don’t want, to reproduce it.

root@system-4:~# snap run obsidian --enable-features=UseOzonePlatform --ozone-platform=wayland
2025-01-06 18:45:04 Loading main app package /snap/obsidian/40/resources/obsidian.asar
Ignored: Error: ENOENT: no such file or directory, open ‘/root/snap/obsidian/40/.config/obsidian/obsidian.json’
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
[7902:0106/184504.517441:ERROR:wayland_connection.cc(198)] Failed to connect to Wayland display: No such file or directory (2)
[7902:0106/184504.517742:ERROR:ozone_platform_wayland.cc(264)] Failed to initialize Wayland platform
[7902:0106/184504.517756:ERROR:env.cc(258)] The platform failed to initialize. Exiting.
Segmentation fault (core dumped)
root@system-4:~# snap run obsidian --enable-features=UseOzonePlatform --ozone-platform=wayland
/root/Desktop was removed, reassigning DESKTOP to homedir
/root/Downloads was removed, reassigning DOWNLOAD to homedir
/root/Templates was removed, reassigning TEMPLATES to homedir
/root/Public was removed, reassigning PUBLICSHARE to homedir
/root/Documents was removed, reassigning DOCUMENTS to homedir
/root/Music was removed, reassigning MUSIC to homedir
/root/Pictures was removed, reassigning PICTURES to homedir
/root/Videos was removed, reassigning VIDEOS to homedir

Did you follow the troubleshooting guide? [Y/N]

Expected result

Just wanted the software to launch and run on Ubuntu Server 24.04 with swaywm and Wayland

Actual result

Software failed to launch and erased some content from my system

Environment


Additional information

It reminds me of the xdg-user-dirs and xdg-user-dirs-update though.

Got this with the help of Nils on Element Ubuntu Support : 482500 – Installing Okular from snap breaks home directory

The above is a potential solution as the fix has been released but not used by the snap app devs.

We haven’t changed the way we build our snap. So where does this bug come from?

Which snap did you use exactly?

Install Obsidian on Linux | Snap Store. As for the rest, read the bug report. It’s a known KDE bug, and it seems that the devs need to include/use the fix.

Furthermore, I have been trying to run the snap app under sway and Wayland it won’t start. Don’t know how to debug that though.