Bug 2183622 - xdg-desktop-portal-gnome[10529]: Failed to initialize display server connection: Unsupported or missing session type ''
Summary: xdg-desktop-portal-gnome[10529]: Failed to initialize display server connecti...
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: xdg-desktop-portal-gnome
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: David King
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-31 20:43 UTC by Xose Vazquez Perez
Modified: 2023-10-12 17:32 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-10-12 17:32:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Xose Vazquez Perez 2023-03-31 20:43:45 UTC
Running in X11, versions:
xorg-x11-server-Xorg-1.20.14-21.fc38.x86_64
xdg-desktop-portal-gnome-44~rc-1.fc38.x86_64


"journalctl --user -xeu xdg-desktop-portal-gnome.service" shows:

---cut---
Mar 31 22:38:36 chuchi systemd[889]: Starting xdg-desktop-portal-gnome.service - Portal service (GNOME implementation)...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has begun execution.
░░ 
░░ The job identifier is 478.
Mar 31 22:38:36 chuchi xdg-desktop-portal-gnome[10529]: Failed to initialize display server connection: Unsupported or missing session type ''
Mar 31 22:38:36 chuchi systemd[889]: xdg-desktop-portal-gnome.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit UNIT has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Mar 31 22:38:36 chuchi systemd[889]: xdg-desktop-portal-gnome.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'exit-code'.
Mar 31 22:38:36 chuchi systemd[889]: Failed to start xdg-desktop-portal-gnome.service - Portal service (GNOME implementation).
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 478 and the job result is failed.
---cut---

Thanks.

Comment 1 Jonas Ådahl 2023-03-31 20:58:53 UTC
Are you running it from within a GNOME session, or how/from where do you run it?

Comment 2 Xose Vazquez Perez 2023-03-31 21:24:58 UTC
I use WindowMaker from console (init 3 -> shell -> startx),
and xdg-desktop-portal-gnome is started automatically by systemd.

----
$ cat ~/.xinitrc
exec wmaker
----

BTW, there are no errors in f37.


I don't know if it is related to this ubuntu bug:
https://bugs.launchpad.net/ubuntu/+source/xdg-desktop-portal-gnome/+bug/2008428
https://bugs.launchpad.net/ubuntu/+source/xdg-desktop-portal-gnome/+bug/2008165
https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/commit/deae633


Thanks.

Comment 3 Jonas Ådahl 2023-03-31 21:51:53 UTC
xdg-desktop-portal-gnome is intended to be used within GNOME, and it's not supported to run it outside. I suggest changing your setup to rely only on xdg-desktop-portal-gtk for e.g. the file chooser portal instead.

With that said, you can trick xdg-desktop-portal-gnome to work in an X11 only environment by setting XDG_SESSION_TYPE to "x11" in the systemd user service launch environment, before it's launched, e.g. with `systemctl --user set-environment`.

Comment 4 Cristian Ciupitu 2023-04-03 17:03:26 UTC
I'm having the same issue. I'm using KDM to start an XFCE session and google-chrome-stable-111.0.5563.146-1.x86_64 from the official Google repository tries to start xdg-desktop-portal-gnome.service.

This is what I have installed:
  xdg-desktop-portal-1.16.0-2.fc38.x86_64
  xdg-desktop-portal-gnome-44~rc-1.fc38.x86_64
  xdg-desktop-portal-gtk-1.14.1-2.fc38.x86_64
  xdg-desktop-portal-wlr-0.6.0-4.fc38.x86_64
  xdg-utils-1.1.3-13.fc38.noarch
In case that matters, I have upgraded from Fedora 37 to 38.

Running
    systemctl --user set-environment XDG_SESSION_TYPE=x11
fixes the issue, but there must be a better way.

Comment 5 Jonas Ådahl 2023-04-03 17:36:31 UTC
Try the builds from here: https://bugzilla.redhat.com/show_bug.cgi?id=2176759#c13

Comment 6 Cristian Ciupitu 2023-04-05 14:50:33 UTC
Thank you!
See https://bugzilla.redhat.com/show_bug.cgi?id=2176759#c19


Note You need to log in before you can comment on or make changes to this bug.