Gtk-WARNING cannot open display: :0 [Core22-ubuntu22-arm64]

Hi all,

Need help with: Debugging snap “my-snap” when crashing due to “Gtk-WARNING cannot open display: :0”

Context:

  1. I’m building a snap (“my-snap”) based on core22, with the “gnome” extension, on an arm64 machine targeting execution on Raspberry Pi 4. The app is based on Tauri 1.5.
  2. Development machine is Ubuntu 22.04 running on an arm64 VM.
  3. The app’s resulting build generates a .deb package that runs correctly on the dev machine.
  4. When building the “my-snap” snap using snapcraft, and installing it on the target machine I get the following error just before it crashes:

Gtk-WARNING **: 11:36:17.951: cannot open display: :0

  1. Trying to debug it, I installed the “my-snap” with the --devmode
  2. Using ‘devmoe’, the snap runs correctly.

That leads me to think that this is a confinment issue with GTK, and I’m looking for more leads.

After a long search, seeking help from the community. Thanks!

Tou are most likely missing the x11 plug or similar… try using snappy-debug from the same named snap package, run it alongside your app in a second terminal, it should make suggestions about missing plugs in your snap.

Thanks @ogra for the swift response and useful lead. It helped me find that indeed the wayland plug wasn’t connected. It was under my impresseion that these auto connect.

1 Like