Bug 195394 - x11/gnome-terminal fails to start
Summary: x11/gnome-terminal fails to start
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-gnome mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-25 23:31 UTC by mikhail.rokhin
Modified: 2018-10-26 13:17 UTC (History)
11 users (show)

See Also:
mikhail.rokhin: maintainer-feedback? (gnome)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mikhail.rokhin 2014-11-25 23:31:50 UTC
CURRENT, New Gnome3, both amd64/i386

 gnome-terminal
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Terminal exited with status 8
Comment 1 Bugzilla Automation freebsd_committer 2014-11-25 23:31:50 UTC
Auto-assigned to maintainer gnome@FreeBSD.org
Comment 2 gustau.perez 2014-11-26 06:16:03 UTC
Does this happen when starting gnome3 with gdm? Or is this with other login managers like slim?
Comment 3 mikhail.rokhin 2014-11-26 13:56:07 UTC
(In reply to gustau.perez from comment #2)
> Does this happen when starting gnome3 with gdm? Or is this with other login
> managers like slim?
gdm, kdm
Comment 4 rkoberman 2014-11-27 06:43:31 UTC
I see the same error with mate-terminal when attempting to either --save-config or --load-config. gdm is not involved. (I don't use any dm. I use startx.)
Comment 5 Shawn Webb 2014-12-02 03:06:36 UTC
Reproduced on my end, too. Custom package repo. Running 11-CURRENT/amd64.
Comment 6 Dennis Glatting 2014-12-27 18:55:03 UTC
I "solved" this problem in one of two ways. I'm not sure which was the impacting, but the gnome-terminal problem went away after doing it.

1) Setting LANG in a console login shell before starting KDM.
    => setenv LANG en_US.UTF-8

2) Setting lang in my user .login_conf.
    => me: \
         :lang=en_US.UTF-8:
Comment 7 Ruslan Makhmatkhanov freebsd_committer 2014-12-28 17:41:09 UTC
I tried all this and everything in google and it didn't helped. Meanwhile, gnome-terminal is working fine for brand-new user, but fails to start with the same error message for old user (gnome2 user). 

I finally was able to fix this by removing stale dmrc file from /var/cache/gdm/<user>/dmrc.
Comment 8 mikhail.rokhin 2015-04-08 08:14:18 UTC
(In reply to Ruslan Makhmatkhanov from comment #7)

My /var/cache/gdm/ is empty, but still the problem persist

localhost:~ # gnome-terminal 
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Terminal exited with status 8
Comment 9 mikhail.rokhin 2015-04-08 08:17:44 UTC
(In reply to Dennis Glatting from comment #6)

Doesn't help
Comment 10 miguelmclara 2015-12-10 15:38:52 UTC
I'm seeing the same while using starx or slim, locale is set to en_US.UTF-8
Comment 11 miguelmclara 2015-12-10 16:02:07 UTC
Hum.. so staring with dbus-launch gnome-terminal works, but the interesting part is that I am using Lumina and this was working until some time ago because I start dbus in xnitrc (can't be sure if this as after a gnome/gnome-terminal update

An I do see the process started with dbus-launch --exit-with-session:

miguelc          1607   0.0  0.0   26328      0  -  IW   -          0:00.00 dbus-launch --exit-with-session Lumina-DE

Also other gnome tools start just fine
Comment 12 w.schwarzenfeld freebsd_triage 2018-01-12 02:35:30 UTC
Is this still relevant?
Comment 13 rkoberman 2018-01-12 03:23:59 UTC
(In reply to w.schwarzenfeld from comment #12)
After regenerating my save file, it has worked without any problems. As I mentions, my case was using hte mate-terminal fork, so may vary from the gnome-terminal case.
Comment 14 Stefan B. 2018-01-29 20:14:33 UTC
(In reply to w.schwarzenfeld from comment #12)

Yes, I can confirm that the bug is still relevant with Gnome 3.18 from "latest" 11.1Release repo.

The only way to start gnome-terminal still is 'dbus-launch gnome-terminal' if not running Gnome itself (I use FVWM).
Comment 15 Ting-Wei Lan 2018-01-30 09:16:41 UTC
(In reply to Stefan B. from comment #14)
Do you have a session dbus-daemon running? If no then I think this is not a valid issue. GNOME Terminal (and many other GNOME apps) requires D-Bus to work. It is not an optional dependency that can be disabled.
Comment 16 Stefan B. 2018-01-30 11:17:54 UTC
(In reply to Ting-Wei Lan from comment #15)

No. Didn't expect this to be necessary. Mate-terminal works fine without, as well as all KDE, Qt and Gtk apps I use.
I know this is outside the topic of bugzilla, but may I ask which daemons need to be started via .xinitrc to make Gnome apps behave well?
Comment 17 Ting-Wei Lan 2018-01-30 12:44:51 UTC
(In reply to Stefan B. from comment #16)
GNOME Terminal is a D-Bus activated service, and gnome-terminal is the client program to activate the service, gnome-terminal-server. You can find its D-Bus service file at /usr/local/share/dbus-1/services/org.gnome.Terminal.service. https://wiki.gnome.org/Apps/Terminal/Debugging

I think running your window manager or desktop environment under dbus-launch is sufficient. gnome-session re-executes itself under dbus-launch when it cannot find DBUS_SESSION_BUS_ADDRESS environment variable.
Comment 18 John Hein 2018-01-30 18:09:50 UTC
I have a running dbus under mate [1].  It fails unless I use dbus-launch (which effectively starts a new dbus session) [2].

Same failure described by the OP:

% /usr/local/bin/gnome-terminal
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Terminal exited with status 8

A while ago (years) I tried using gnome (3) for the session (now I use mate) and had the same error.  I don't know right now if it's still a problem when running under a gnome session.  I'll try the next time I restart my desktop session.  If not, I suppose this could be considered a mate bug, but it seems like gnome-terminal should be a little more resilient and be able to set up dbus session things itself in an existing session.

[1] 
% env | grep DBUS
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-DdHesoN6XE,guid=f89b8ac5e5b73e7f004625b05a5cf6b3
% dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
method return time=1517333841.467683 sender=org.freedesktop.DBus -> destination=:1.183 serial=3 reply_serial=2
   array [
      string "org.freedesktop.DBus"
      string ":1.7"
      string ":1.8"
      string ":1.9"
      string "org.mate.Panel"
      string "org.mate.PowerManager"
      string "org.gtk.vfs.Daemon"
      string "org.mate.ScreenSaver"
      string "org.mate.panel.applet.NotificationAreaAppletFactory"
      string "org.mate.panel.applet.ClockAppletFactory"
      string "org.Gnome.SessionManager"
 .
 .



[2] 'dbus-launch gnome-terminal' works fine (but starts a new session bus instance of dbus-daemon).
Comment 19 Ting-Wei Lan 2018-01-31 09:57:08 UTC
(In reply to John Hein from comment #18)
There is a list of exit status on GNOME Terminal FAQ:
https://wiki.gnome.org/Apps/Terminal/FAQ#Terminal_fails_to_start

It says exit status 8 means you were not using a UTF-8 locale. Was your dbus-daemon running in a UTF-8 locale?
Comment 20 John Hein 2018-02-14 17:35:02 UTC
(In reply to Ting-Wei Lan from comment #19)

No, the slim display manager was started without LANG set to anything (even if you select gnome as the session environment).  Adding lang=en_US.UTF-8 to /etc/login.conf seems to do the trick.

Thanks for finding that.  That has to be the worst error message ever.  Okay, probably not _the_ worst.

So if you use gdm as your display manager + gnome session environment, it appears to inject a UTF-8 locale for dbus's environment somehow (presumably if you don't have one set for the system).

But if you use slim for a display manager and mate for the desktop environment, LANG is not set to anything.  Setting lang in /etc/login.conf to a UTF-8 locale (I only tested en_US.UTF-8 & de_DE.UTF-8) fixes it.  I did test with slim and 'lang=C' in login.conf, and that also made gnome-terminal fail the same way (exited with status 8).
Comment 21 Ting-Wei Lan 2018-02-15 13:51:03 UTC
(In reply to John Hein from comment #20)
Yes, I agree that the error message is bad, and debugging is not easy unless you run gnome-terminal-server manually. gdm set the locale from /usr/local/etc/gdm/locale.conf. It is set to en_US.UTF-8 by default in order to satisfy the need of gnome-terminal.

Personally I seldom see the problem because I always use a UTF-8 locale. I think the best solution is to change the default locale of new installation to a UTF-8 locale, but it is probably not going to happen. Python is also going to coerce the default C locale to a UTF-8 locale to avoid Unicode-handling issues.
Comment 22 Steve Wills freebsd_committer 2018-10-26 13:17:10 UTC
I had this issue when using sddm+plasma5 when I decided to try gnome-terminal and the only solution I could find was setting LANG and LC_* variables (not sure exactly which ones) in ~/.xprofile. I think this works because /usr/local/share/sddm/scripts/Xsession reads that file before calling dbus-run-session. Perhaps that will help others.