Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnome-terminal takes too long to launch #3109

Closed
totaam opened this issue May 4, 2021 · 16 comments
Closed

gnome-terminal takes too long to launch #3109

totaam opened this issue May 4, 2021 · 16 comments
Assignees
Labels
documentation Improvements or additions to documentation server
Milestone

Comments

@totaam
Copy link
Collaborator

totaam commented May 4, 2021

It's complaining about a missing dbus service which may have something to do with it.

Eventually something times out and it runs.

Probably affects some other gnome apps I think.

@stdedos
Copy link
Collaborator

stdedos commented May 5, 2021

And here I thought this wasn't your fault 😛

totaam added a commit that referenced this issue May 5, 2021
totaam added a commit that referenced this issue May 6, 2021
detect when the file is not a script and just run it directly
@totaam
Copy link
Collaborator Author

totaam commented May 6, 2021

And here I thought this wasn't your fault

It isn't, honest!

Looks like they've changed something that made it worse, though the underlying issue is far from new.
As per Slow hotkey response in GNOME 3.12 and Terminal appears with much delay when shortcut is used, the solution is to run gnome-keyring-daemon before launching gnome-terminal.
Why does it take so long to timeout and why doesn't it just start gnome-keyring-daemon on demand if it's really needed? Beats me.

The "easy" fix is to just add --source-start=gnome-keyring-daemon.
Not that easy because xpra did not support sourcing commands that aren't shell scripts. Now it does: 62d8ae8.

I can't burden every session and launch gnome-keyring-daemon just in case users are going to be launching a gnome-application later...
So this will have to do, with an entry in the FAQ to make it easier to find: 9038db3

@totaam totaam closed this as completed May 6, 2021
@stdedos
Copy link
Collaborator

stdedos commented May 6, 2021

the solution is to run gnome-keyring-daemon before launching gnome-terminal.

I am wondering (somewhat philosophically tbh right now) if that "scales": Will :0 and whatever :xpra DISPLAY be able to share the gnome-keyring-daemon? Or multiple xpra DISPLAYs?

I think it might have been that each gnome-keyring-daemon "disconnects" the previous ones.

@stdedos
Copy link
Collaborator

stdedos commented May 8, 2021

It is "somewhat" related to #2606

@stdedos
Copy link
Collaborator

stdedos commented May 10, 2021

It seems that the example shown in b9dd191 (i.e. gnome-keyring-daemon --start) is actually the correct way to do such an initialization.
-- So there goes my philosophical argument (there's also --replace)

Given the difference of gnome-keyring-daemon --login and gnome-keyring-daemon --start, "I would think" that it should be safe to run, and it shouldn't really waste resources (or IOPS).
... ofc, as always, there's the question "and what will happen if gnome-keyring-daemon --login was not already executed when gnome-keyring-daemon --start is run" ...

Hopefully the gnome-keyring-daemon handles that, and gnome-keyring-daemon --start fails loudly to investigate further. However, for my purposes, that (modified) FAQ seems just the perfect override.

@totaam totaam added this to the 4.2 milestone May 18, 2021
@totaam totaam added documentation Improvements or additions to documentation server labels May 18, 2021
@stdedos
Copy link
Collaborator

stdedos commented Jun 14, 2021

I have source-start = gnome-keyring-daemon --start and I am responded with:

Error: cannot find file 'gnome-keyring-daemon --start' to source.

Did you test the codepath? 😕

Server: Focal/r29304

PS: It would be nice if the first line on the log file was: $datetime: xpra's version signature

@totaam
Copy link
Collaborator Author

totaam commented Jun 19, 2021

@stdedos that's now fixed, we now identify scripts vs executables and handle arguments properly.

@stdedos
Copy link
Collaborator

stdedos commented Jun 21, 2021

Since you fixed the #3139 (I saw the git-logs 😛), you may opt in for a full beta re-release.

Or opt in to handle #3175, #3176 first

@stdedos
Copy link
Collaborator

stdedos commented Jun 30, 2021

Unfortunately, I am still seeing:

$ grep -vFf ~/xpra-v.grep display-\:2-20210629-152502.log | bat
2021-06-29 15:25:02,973 pointer device emulation using XTest
2021-06-29 15:25:03,095 serving html content from '/usr/share/xpra/www'
2021-06-29 15:25:03,097 Error: cannot find file 'gnome-keyring-daemon --start' to source
2021-06-29 15:25:03,114 found previous Xpra instance
2021-06-29 15:25:03,116 created unix domain socket '/run/user/1000/xpra/u-h'
2021-06-29 15:25:03,116 created unix domain socket '/run/xpra/u-h'
2021-06-29 15:25:03,117 created unix domain socket '/home/u/.xpra/u-h'
2021-06-29 15:25:03,119 xvfb pid=450345
2021-06-29 15:25:07,090 loaded 104 start menu entries from 13 sub-menus in 1.6 seconds
2021-06-29 15:25:07,183 D-Bus notification forwarding is available

(Xpra:1548378): Gtk-CRITICAL **: 15:25:07.229: gtk_widget_realize: assertion 'widget->priv->anchored || GTK_IS_INVISIBLE (widget)' failed
2021-06-29 15:25:07,309 watching for applications menu changes in:
2021-06-29 15:25:07,309  '/home/u/.local/share/flatpak/exports/share/applications'
2021-06-29 15:25:07,309  '/usr/local/share/applications'
2021-06-29 15:25:07,309  '/usr/share/applications'
2021-06-29 15:25:07,310  '/var/lib/snapd/desktop/applications'
2021-06-29 15:25:07,319 printer forwarding enabled using postscript and pdf
2021-06-29 15:25:07,327 started command 'ibus-daemon --xim -v -r --panel=disable' with pid 1548697
2021-06-29 15:25:07,335 started command 'ibus-daemon --xim -v -r --panel=disable' with pid 1548698
2021-06-29 15:25:07,361 xpra is ready.

(ibus-daemon:1548697): GLib-WARNING **: 15:25:07.369: GChildWatchSource: Exit status of a child process was requested but ECHILD was received by waitpid(). See the documentation of g_child_watch_source_new() for possible causes.
2021-06-29 15:25:07,611 found 1 vaapi codecs: h264
2021-06-29 15:25:07,642 62.6GB of system memory
2021-06-29 15:25:08,717 OpenGL is supported on display ':2'
2021-06-29 15:25:08,717  using 'llvmpipe (LLVM 11.0.0, 256 bits)' renderer

(ibus-daemon:1548698): IBUS-WARNING **: 15:25:08.717: 15:25:08.717691: The parent process died.
2021-06-29 15:25:08,739 child 'ibus-daemon --xim -v -r --panel=disable' with pid 1548698 has terminated
2021-06-29 15:25:09,807  request id 1, selection=PRIMARY, target=TARGETS
2021-06-29 15:25:11,190 xpra X11 seamless version 4.3-r29319 (g819f81e7e) 64-bit
....

Server: 4.3-r29319 / Client: 4.3-r29346

@totaam
Copy link
Collaborator Author

totaam commented Jun 30, 2021

Try with -d exec and the latest builds, it should will show a more helpful error and debug messages.

Strange that you have 2 ibus-daemons starting:

started command 'ibus-daemon --xim -v -r --panel=disable' with pid 1548697
started command 'ibus-daemon --xim -v -r --panel=disable' with pid 1548698

@stdedos
Copy link
Collaborator

stdedos commented Jun 30, 2021

Strange that you have 2 ibus-daemons starting:

started command 'ibus-daemon --xim -v -r --panel=disable' with pid 1548697
started command 'ibus-daemon --xim -v -r --panel=disable' with pid 1548698

Maybe I interpreted the command you gave me in #3167 (comment) somehow wrongly, or ran it too many times ... idk 😕

@stdedos
Copy link
Collaborator

stdedos commented Jul 1, 2021

Try with -d exec and the latest builds, it should will show a more helpful error and debug messages.

Have you forgotten to build the Focal beta? I still don't see anything.
Or did you mean with the r29319 (819f81e)?

$ xpra upgrade :2 -d exec
...
2021-07-01 11:41:14,161 init_packet_handlers() COMMANDS_SIGNALS=('SIGINT', 'SIGTERM', 'SIGHUP', 'SIGKILL', 'SIGUSR1', 'SIGUSR2'), start new commands=False
2021-07-01 11:41:14,161 pointer device emulation using XTest
2021-07-01 11:41:14,251 serving html content from '/usr/share/xpra/www'
2021-07-01 11:41:14,251 ChildReaper(None)
2021-07-01 11:41:14,252 Error: cannot find file 'gnome-keyring-daemon --start' to source
2021-07-01 11:41:14,266 Warning: no window manager found
2021-07-01 11:41:14,266  on display :2 using EWMH window 0x2c00005
2021-07-01 11:41:14,266 Error: xpra server not found
EOF

and

$ xpra recover :2 -d exec
...
init_packet_handlers() COMMANDS_SIGNALS=('SIGINT', 'SIGTERM', 'SIGHUP', 'SIGKILL', 'SIGUSR1', 'SIGUSR2'), start new commands=False
pointer device emulation using XTest
serving html content from '/usr/share/xpra/www'
ChildReaper(None)
Error: cannot find file 'gnome-keyring-daemon --start' to source
created unix domain socket '/run/user/1000/xpra/u-h-2'
created unix domain socket '/run/xpra/u-h-2'
created unix domain socket '/home/u/.xpra/u-h-2'
xvfb pid=450345
parsing xdg menu data for prefix None with XDG_CONFIG_DIRS=None
do_load_xdg_menu_data()
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xpra/platform/xposix/xdg_helper.py", line 250, in do_load_xdg_menu_data
    menu = parse()
  File "/usr/lib/python3/dist-packages/xdg/Menu.py", line 1137, in parse
    return XMLMenuBuilder(debug).parse(filename)
  File "/usr/lib/python3/dist-packages/xdg/Menu.py", line 626, in parse
    raise ParsingError('File not found', "/etc/xdg/menus/%s" % candidate)
xdg.Exceptions.ParsingError: ParsingError in file '/etc/xdg/menus/debian-menu.menu', File not found
parsing xdg menu data for prefix '' with XDG_CONFIG_DIRS=None
do_load_xdg_menu_data()
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xpra/platform/xposix/xdg_helper.py", line 250, in do_load_xdg_menu_data
    menu = parse()
  File "/usr/lib/python3/dist-packages/xdg/Menu.py", line 1137, in parse
    return XMLMenuBuilder(debug).parse(filename)
  File "/usr/lib/python3/dist-packages/xdg/Menu.py", line 626, in parse
    raise ParsingError('File not found', "/etc/xdg/menus/%s" % candidate)
xdg.Exceptions.ParsingError: ParsingError in file '/etc/xdg/menus/debian-menu.menu', File not found
parsing xdg menu data for prefix 'gnome-' with XDG_CONFIG_DIRS=None
Applications.getEntries()=(<xdg.Menu.Menu object at 0x7f05a856b970>, <xdg.Menu.Menu object at 0x7f05a856b4c0>, <xdg.Menu.Menu object at 0x7f05a85379d0>, <xdg.Menu.Menu object at 0x7f05a8537e50>, <xdg.Menu.Menu object at 0x7f05a8543640>, <xdg.Menu.Menu object at 0x7f05a8546df0>, <xd
g.Menu.Menu object at 0x7f05a84e3b20>, <xdg.Menu.Menu object at 0x7f05a8534b50>, <xdg.Menu.Menu object at 0x7f05a85374f0>, <xdg.Menu.Menu object at 0x7f05a8546940>, <xdg.Menu.Menu object at 0x7f05a8546f40>, <xdg.Menu.Menu object at 0x7f05a856b850>, <xdg.Menu.Menu object at 0x7f05a8
4d9160>, <xdg.Menu.Menu object at 0x7f05a856b970>, <xdg.Menu.Menu object at 0x7f05a856b4c0>, <xdg.Menu.Menu object at 0x7f05a85379d0>, <xdg.Menu.Menu object at 0x7f05a8537e50>, <xdg.Menu.Menu object at 0x7f05a8543640>, <xdg.Menu.Menu object at 0x7f05a8546df0>, <xdg.Menu.Menu object
 at 0x7f05a84e3b20>, <xdg.Menu.Menu object at 0x7f05a8534b50>, <xdg.Menu.Menu object at 0x7f05a85374f0>, <xdg.Menu.Menu object at 0x7f05a8546940>, <xdg.Menu.Menu object at 0x7f05a8546f40>, <xdg.Menu.Menu object at 0x7f05a856b850>, <xdg.Menu.Menu object at 0x7f05a84d9160>, <xdg.Menu
.Separator object at 0x7f05a84fce20>, org.gnome.Software.desktop)
Name=Accessories (<class 'str'>)
GenericName= (<class 'str'>)
Comment=Desktop accessories (<class 'str'>)
Path=Accessories (<class 'str'>)
Icon=applications-utilities (<class 'str'>)
properties(Accessories)={'Name': 'Accessories', 'GenericName': '', 'Comment': 'Desktop accessories', 'Path': 'Accessories', 'Icon': 'applications-utilities'}
glob(/home/u/.local/share/icons/*/*/categories/applications-utilities.png) matches 0 filenames
...

(Also #3176)

@totaam
Copy link
Collaborator Author

totaam commented Jul 3, 2021

Strange that you have 2 ibus-daemons starting:

started command 'ibus-daemon --xim -v -r --panel=disable' with pid 1548697
started command 'ibus-daemon --xim -v -r --panel=disable' with pid 1548698

Maybe I interpreted the command you gave me in #3167 (comment) somehow wrongly, or ran it too many times ... idk

Actually, I have managed to reproduce it, only with upgrade and this is now fixed: 239fc98. (was using the same array for two different things - which wasn't a problem until ibus-daemon got added)

@stdedos
Copy link
Collaborator

stdedos commented Jul 5, 2021

gnome-keyring-daemon --start error disappeared after the upgrade 😀

@cpatulea
Copy link
Contributor

For what it's worth, I had the same symptoms (gnome-terminal starts slowly), but the cause seems to have been different. Clue was in xpra server log:

Unable to create /home/catalinp/.dbus/session-bus

For some reason, I had a ~/.dbus owned by root:

drwx------   3 root     root         4,096 Nov 17  2014  .dbus

Deleted that, and now gnome-terminal starts normally.

@totaam
Copy link
Collaborator Author

totaam commented Dec 31, 2023

A ~/.dbus/session-bus socket owned by root is usually caused by running as root via sudo or su without the login flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation server
Projects
None yet
Development

No branches or pull requests

3 participants