Wayland Crash when forcing native wayland

Steps to reproduce

Running the latest Obsidian AppImage with wayland enabled:
./Obsidian-1.4.5.AppImage --ozone-platform=wayland --enable-features=UseOzonePlatform,WaylandWindowDecorations
Try to open a vault or click some UI elements and Obsidian crashes.

Did you follow the troubleshooting guide? [Y]

Expected result

No crashes

Actual result

Obsidian seems to crash intermittently after a few seconds.
On a clean install, with no files in ~/.config/obsidian, the “welcome window” opens as expected with no immediate crash.
After clicking “Open Vault” and selecting a folder, Obsidian segfaults:

ben@benlaptopf ~/Applications/ % ./Obsidian-1.4.5.AppImage --ozone-platform=wayland --enable-features=UseOzonePlatform,WaylandWindowDecorations
2023-09-09 21:12:16 Loading main app package /tmp/.mount_ObsidifGR2cd/resources/obsidian.asar
Error: ENOENT: no such file or directory, open '/var/home/ben/.config/obsidian/obsidian.json'
    at Object.openSync (node:fs:601:3)
    at Object.func [as openSync] (node:electron/js2c/asar_bundle:2:1822)
    at Object.readFileSync (node:fs:469:35)
    at t.readFileSync (node:electron/js2c/asar_bundle:2:9165)
    at /tmp/.mount_ObsidifGR2cd/resources/obsidian.asar/main.js:1:3390
    at L (/tmp/.mount_ObsidifGR2cd/resources/obsidian.asar/main.js:1:2117)
    at B (/tmp/.mount_ObsidifGR2cd/resources/obsidian.asar/main.js:1:3371)
    at module.exports (/tmp/.mount_ObsidifGR2cd/resources/obsidian.asar/main.js:6:3411)
    at loadApp (/tmp/.mount_ObsidifGR2cd/resources/app.asar/main.js:294:3)
    at Object.<anonymous> (/tmp/.mount_ObsidifGR2cd/resources/app.asar/main.js:446:12) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/var/home/ben/.config/obsidian/obsidian.json'
}
2023-09-09 21:12:16 Checking for update using Github
2023-09-09 21:12:16 Success.
2023-09-09 21:12:16 Latest version is 1.4.5
2023-09-09 21:12:16 App is up to date.
Error: ENOENT: no such file or directory, open '/var/home/ben/.config/obsidian/997ef8bee388e233.json'
    at Object.openSync (node:fs:601:3)
    at Object.func [as openSync] (node:electron/js2c/asar_bundle:2:1822)
    at Object.readFileSync (node:fs:469:35)
    at t.readFileSync (node:electron/js2c/asar_bundle:2:9165)
    at /tmp/.mount_ObsidifGR2cd/resources/obsidian.asar/main.js:1:3390
    at L (/tmp/.mount_ObsidifGR2cd/resources/obsidian.asar/main.js:1:2117)
    at B (/tmp/.mount_ObsidifGR2cd/resources/obsidian.asar/main.js:1:3371)
    at H (/tmp/.mount_ObsidifGR2cd/resources/obsidian.asar/main.js:25:1074)
    at t (/tmp/.mount_ObsidifGR2cd/resources/obsidian.asar/main.js:25:10271)
    at IpcMainImpl.<anonymous> (/tmp/.mount_ObsidifGR2cd/resources/obsidian.asar/main.js:25:6511) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/var/home/ben/.config/obsidian/997ef8bee388e233.json'
}
zsh: segmentation fault (core dumped)  ./Obsidian-1.4.5.AppImage --ozone-platform=wayland 

This also occurs when I try to click on the Help icon on the “welcome window” to open the sandbox vault.

Strangely, running obsidian again with the exact same arguments opens the vault which was just selected with no immediate crash but mousing over any UI elements causes the same crash.
Then running Obsidian any subsequent times causes an immediate crash / segfault. To get obsidian to launch again I need to rm -rf ~/.config/obsidian.

Environment

I can only access my own vault for a few seconds to get the below output as I can’t access the sandbox vault.
SYSTEM INFO:
Obsidian version: v1.4.5
Installer version: v1.4.5
Operating system: #1 SMP PREEMPT_DYNAMIC Sat Sep 2 16:36:06 UTC 2023 6.4.14-200.fc38.x86_64
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: Big Sur Aesthetic v0.0.0
Snippets enabled: 1
Restricted mode: off
Plugins installed: 30
Plugins enabled: 20
1: Advanced new file v1.5.1
2: Contextual Typography v2.2.5
3: Core Search Assistant v0.9.2
4: Editor Syntax Highlight v0.1.3
5: Excalidraw v1.9.9
6: Kanban v1.5.3
7: Linter v1.17.0
8: Note Refactor v1.7.1
9: Style Settings v1.0.6
10: Tag Wrangler v0.5.11
11: Quick Latex for Obsidian v2.6.2
12: Desmos v0.6.6
13: Paste image rename v1.6.1
14: Extended MathJax v0.4.1
15: Advanced Tables v0.19.0
16: Short links v1.1.3
17: Table Generator v1.3.1
18: Better Word Count v0.9.6
19: Wordy v1.0.0
20: Duplicate Line v1.4.1


I’m running Fedora Silverblue with the latest Obsian AppImage v1.4.5

Additional information

This issue also appears to materialise itself through the flatpak version but I know this is not officially maintained so is somewhat irrelevant. Github Issue

It looks to me like it’s an issue introduced by an electron update between Obsidian v1.3.7 and v1.4.5 as there are many bug reports across various projects relating to wayland and electron crashes with electron v25.x.
A possible solution would be downgrading to the last known working electron version?

2 Likes

This is possible as the other day I was looking at VScode’s wayland bug reports and they were lamenting frequent crashes.

I suggest you run Obsidian using x11, or xwayland, until the pair electron/wayland is mature. They are not there yet, we other bug reports involving Obsidian not working well under wayland.

1 Like

Thanks, I have a high res laptop monitor so unfortunately I can’t use Xwayland due to the blurry scaling issue. Until this is fixed i think I’ll just need to stay on Obsidian v1.3.7

For anyone else coming across this, using the flatpak this command will take you back to the last working version which uses electron 24.3.1:

flatpak update --commit=df4ad574288b02356d5318f6d5c1edd1d7d88320a5c08d96472d695cd509bff4 md.obsidian.Obsidian

Or use the previous AppImage version downloadable from the official github.

4 Likes

Setting “Window frame style” to “Hidden” in Settings/Appearance (as opposed to “Native”) seems to prevent segfault on launch. The app does segfault for me when I quit it, but it seems functional otherwise.

i noticed this as well but it was still segfaulting for me when hovering over random things so I’m currently still on the old version

Any information on this? I am unable to launch Obsidian because it crashes on startup and my stacktrace looks similar:

2023-11-13 11:44:58 Loading main app package /tmp/.mount_obsidiAl4Ikl/resources/obsidian.asar
2023-11-13 11:44:59 Checking for update using Github
2023-11-13 11:44:59 Success.
2023-11-13 11:44:59 Latest version is 1.4.16
2023-11-13 11:44:59 App is up to date.
Debug: Enabling Wayland backend
Deleting cache directory: /home/andreasbackx/.var/app/md.obsidian.Obsidian/config/obsidian/GPUCache
Debug: Will run Obsidian with the following arguments: --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations
Debug: Additionally, user gave: --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto
2023-11-13 11:45:03 Loading main app package /app/resources/obsidian.asar
LaunchProcess: failed to execvp:
xdg-settings
Error: ENOENT: no such file or directory, open '/home/andreasbackx/.var/app/md.obsidian.Obsidian/config/obsidian/46410bd304928bd7.json'
    at Object.openSync (node:fs:601:3)
    at Object.func [as openSync] (node:electron/js2c/asar_bundle:2:1869)
    at Object.readFileSync (node:fs:469:35)
    at t.readFileSync (node:electron/js2c/asar_bundle:2:9212)
    at /app/resources/obsidian.asar/main.js:1:3390
    at R (/app/resources/obsidian.asar/main.js:1:2117)
    at E (/app/resources/obsidian.asar/main.js:1:3371)
    at N (/app/resources/obsidian.asar/main.js:25:1074)
    at se (/app/resources/obsidian.asar/main.js:25:3516)
    at /app/resources/obsidian.asar/main.js:25:11880 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/andreasbackx/.var/app/md.obsidian.Obsidian/config/obsidian/46410bd304928bd7.json'
}
2023-11-13 11:45:03 Checking for update using Github
2023-11-13 11:45:03 Success.
2023-11-13 11:45:03 Latest version is 1.4.16
2023-11-13 11:45:03 App is up to date.
/app/bin/obsidian.sh: line 62:    14 Segmentation fault      (core dumped) zypak-wrapper /app/obsidian $@ ${EXTRA_ARGS[@]}

Want to update this with my latest info because I think my previous logs were because it was trying to go from AppImage to Flatpak due to one of my personal scripts. I’ve now rules that out however and on AppImage I am not getting logs but a straight segfault:

2023-11-13 13:00:27 Loading main app package /tmp/.mount_obsidixro5Tx/resources/obsidian.asar
2023-11-13 13:00:27 Checking for update using Github
2023-11-13 13:00:28 Success.
2023-11-13 13:00:28 Latest version is 1.4.16
2023-11-13 13:00:28 App is up to date.

~ took 20.0s                                                                                                                                                                                                [13:00]
➜ echo $?
139

I can reliably trigger this by opening the vault selection screen. Then it will crash within 5 seconds for me.

yip, i’m still getting this on latest update 1.4.16. Reliably happens on vault selection screen but other random things seem to trigger it.
Still happens on flatpak, appimage and the native Nix package so its not a sandboxing issue

Also, for some reason Obsidian seg faults regardless of how it is closed. Running in a terminal and then clicking the close button gives:
segmentation fault (core dumped) obsidian --enable-features=ozone --ozone-platform=wayland

This makes it harder to workout whats actually going on

I upgraded today and had the same problem. I’m running on wayland and it crashes on the Vault selection screen. Upgrading to the older version with Electron 24 works.

I’m not sure how to get the logs, when I run it in the terminal I just get:

2023-11-22 13:25:06 Loading updated app package /home/argo/.config/obsidian/obsidian-1.4.16.asar
2023-11-22 13:25:06 Checking for update using Github

and then it crashes when I pick a vault. there is no error message

Just want to leave an update, running:

rm -rf .config/obsidian/GPUCache

Fixed the problem for me.

@argonaut’s update does not fix it in my case unfortunately.

@WhiteNoise with Wayland being adopted as a first party citizen on Linux now. Is it possible to look at improving Wayland support here? Falling back to XWayland is a bad experience due to it not supporting hidpi displays. I’m unsure if it did not support fractional scaling or scaling in general. Regardless, Obsidian is not really usable right now on Wayland.

I tried reaching out about this via email on 13/11/2023 considering Obsidian lists “Priority Support” under the commercial license which I have in addition to Obsidian Sync. Though I never got a reply except an automated one saying: " Please note that we only respond to inquiries about commercial licenses, your account, payment, add-on services (Obsidian Sync and Obsidian Publish) and security-related issues (i.e., potential vulnerabilities in Obsidian).".

Is it possible to update this “priority support” mention on the website at least as this is is false advertising the “priority support”?
image

I am sorry you didn’t get a reply. You should have been redirect to searching/posting on the forum.

Is your expectation that priority support means that we expedite your feature requests and bug reports?

Regarding native wayland on linux. Electron, the upstream project we use, still has some unresolved problems with wayland. Until those problems are fixed, xwayland is the way to go.

Could you elaborate about the unresolved problems. I have multiple electron applications running without problems on wayland. One thing I noticed is that Obsidian uses pretty old version of electron (25) where current one is 28, maybe updating dependency would help?

We will update to a newer version of electron in the next cycle. However, I am not confided that all issues have been solved upstream, especially the drag and drop one.

Posting here because my post was closed

In my case obsidian doesn’t launch at all. I don’t even see “Select vault” screen.


Steps to reproduce

  1. Use Wayland
  2. Start obsidian in terminal: obsidian
  3. Get error:
2024-01-31 16:31:19 Loading main app package /usr/lib/obsidian/obsidian.asar
[11795:0131/193119.640822:ERROR:bus.cc(399)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[11795:0131/193119.640885:ERROR:bus.cc(399)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[11795:0131/193119.640898:ERROR:bus.cc(399)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[11795:0131/193119.640906:ERROR:bus.cc(399)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
2024-01-31 16:31:19 Checking for update using Github
[11795:0131/193119.679818:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.portal.Settings.Read: object_path= /org/freedesktop/portal/desktop: unknown error type: 
[11943:0131/193119.783965:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[11943:0131/193119.784060:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[11943:0131/193119.784180:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[11943:0131/193119.784215:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[11943:0131/193119.784242:ERROR:shared_image_factory.cc(673)] CreateSharedImage: could not create backing.
[11943:0131/193119.784268:ERROR:shared_image_factory.cc(527)] DestroySharedImage: Could not find shared image mailbox
[11943:0131/193119.784315:ERROR:gpu_service_impl.cc(1010)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[11795:0131/193119.789935:ERROR:gpu_process_host.cc(954)] GPU process exited unexpectedly: exit_code=8704
[11948:0131/193119.812509:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
2024-01-31 16:31:19 Success.
2024-01-31 16:31:19 Latest version is 1.5.3
2024-01-31 16:31:19 App is up to date.
[11974:0131/193119.907682:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[11974:0131/193119.907748:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[11974:0131/193119.907856:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[11974:0131/193119.907890:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[11974:0131/193119.907919:ERROR:shared_image_factory.cc(673)] CreateSharedImage: could not create backing.
[11974:0131/193119.907976:ERROR:shared_image_factory.cc(527)] DestroySharedImage: Could not find shared image mailbox
[11974:0131/193119.908030:ERROR:gpu_service_impl.cc(1010)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[11948:0131/193119.910441:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[11795:0131/193119.912246:ERROR:gpu_process_host.cc(954)] GPU process exited unexpectedly: exit_code=8704
[11994:0131/193120.023154:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[11994:0131/193120.023234:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[11994:0131/193120.023347:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[11994:0131/193120.023387:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[11994:0131/193120.023419:ERROR:shared_image_factory.cc(673)] CreateSharedImage: could not create backing.
[11994:0131/193120.023453:ERROR:shared_image_factory.cc(527)] DestroySharedImage: Could not find shared image mailbox
[11994:0131/193120.023522:ERROR:gpu_service_impl.cc(1010)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[11795:0131/193120.028642:ERROR:gpu_process_host.cc(954)] GPU process exited unexpectedly: exit_code=8704
[11948:0131/193120.118290:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.

obsidian --ozone-platform=wayland --ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations

Doesn’t change anything

Did you follow the troubleshooting guide?

Yes, but I can’t even launch obsidian so it’s not applicable.

Expected result

Obsidian launching

Actual result

Obsidian crashing

Environment

Artix Linux, wayland
Nvidia Driver Version: 545.29.06
GPU: Nvidia GTX 1080
Obsidian pacman version: 1.5.3-4
Wayland pacman version: 1.22.0-1

Obsidian 1.5.8 now comes with electron 28 which has fixed the crashing for me. Everything seems to work perfectly with the exception of dragging tabs but i believe that’s an electron issue.

Seems to be fixed in new obsidian version!