mate-desktop / caja

Caja, the file manager for the MATE desktop
https://mate-desktop.org/
Other
265 stars 143 forks source link

caja doesn't start on mate #1751

Open Shushandr opened 7 months ago

Shushandr commented 7 months ago
$ caja 
Could not register the application: Timeout was reached
$ caja --version
MATE caja 1.26.1
$ caja --check
running caja_self_check_file_utilities
running caja_self_check_file_operations
running caja_self_check_directory
running caja_self_check_file
running caja_self_check_icon_container
running caja_self_check_file_utilities
running caja_self_check_file_operations
running caja_self_check_directory
running caja_self_check_file
running caja_self_check_icon_container

https://github.com/mate-desktop/caja/blob/v1.26.1/src/caja-application.c#L2009 https://developer-old.gnome.org/gio/stable/GApplication.html#g-application-register «the application discovers if it is the primary instance or merely acting as a remote for an already-existing primary instance. This is implemented by attempting to acquire the application identifier as a unique bus name on the session bus using GDBus.» https://docs.gtk.org/gio/method.Application.register.html

org.mate.Caja https://github.com/mate-desktop/caja/blob/v1.26.1/src/caja-application.c#L2378

$ gdbus call --session --dest org.mate.Caja --object-path /org/mate/caja --method org.freedesktop.DBus.Introspectable.Introspect
('<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"\n                      "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">\n<!-- GDBus 2.76.4 -->\n<node>\n</node>\n',)

Rebooting doesn't change anything (the error persists).

Shushandr commented 7 months ago

Expected behaviour

caja should start normally

Actual behaviour

Caja exits with error message (see above)

Steps to reproduce the behaviour

this code does reproduce the behaviour:

#include <stdio.h>
#include <gio/gio.h>

int main(int argc, char *argv[]) {
    GApplication *app;
    GError *error = NULL;

    // # warning: ‘G_APPLICATION_FLAGS_NONE’ is deprecated: Use 'G_APPLICATION_DEFAULT_FLAGS' instead [-Wdeprecated-declarations]
    app = g_application_new ("org.mate.Caja", G_APPLICATION_DEFAULT_FLAGS);

    g_application_register (app, NULL, &error);

    if (error != NULL) {
       g_printerr ("Could not register the application: %s\n", error->message);
       g_error_free (error);
    }
    else
    {
       g_print ("Success\n");
    }

    return 0;
}

MATE general version

$ mate-about --version
MATE Desktop Environment 1.26.0

Package version

1.26.3

Linux Distribution

Gentoo Linux, systemd, Xorg-server

Link to bugreport of your Distribution (requirement)

n/a, because it's source-based distribution, and I compiled it myself

@raveit65 - ?

raveit65 commented 7 months ago

Thank, for given more info. But i can't reproduce it with fedora (stable and rawhide). Caja works well here.

lukefromdc commented 7 months ago

Make sure that ownership of ~/ .config/dconf/user hasn't been transferred to root, change it back if so. Lots of wierd startup errors can come from that and this could be one of them. I would also expect this if for any reason dbus isn't starting.

Shushandr commented 7 months ago
$ ls -1ld ~/.config/dconf/user
-rw-r--r-- 1 user user 40650 nov 25 07:58 /home/user/.config/dconf/user
$ ls -1ld ~/.config/dconf
drwxr-xr-x 2 user user 4096 nov 25 07:58 /home/user/.config/dconf
$ ls -1ld ~/.config
drwxr-xr-x 100 user user 4096 nov  9 20:47 /home/user/.config
$ ls -1ld ~/
drwxr-x--- 199 user portage 12288 nov 26 01:03 /home/user/

I would also expect this if for any reason dbus isn't starting.

/usr/bin/dbus-daemon works

The problem is that caja is started by mate-session as a desktop manager, and hangs (that's invisible to me as user). Then inside MATE Desktop I launch mate-terminal and inside it I launch second copy of caja. The second copy is unable to connect to the first copy via dbus and gives that timeout message.

i can't reproduce it with fedora (stable and rawhide). Caja works well here.

Please point to instruction/tutorial on debugging caja. What I should do next to diagnose my setup?

raveit65 commented 7 months ago

Debug session start with with Exec=mate-session --debug

[root@mother rave]# cat /usr/share/xsessions/mate.desktop 
[Desktop Entry]
Name[af]=MATE
<cut>
Comment=This session logs you into MATE
Exec=mate-session --debug
TryExec=mate-session
Icon=
Type=Application
DesktopNames=MATE
<cut>
Keywords=launch;MATE;desktop;session;

For some reasons that doesn't work with gdm login manger at my fedora box. Edit: Than take a look in ~.xsession-errors

raveit65 commented 7 months ago

Any info's with journalctl -b0 -r?

Shushandr commented 7 months ago

I mean I want to diagnose why caja itself works wrong for the first time. mate-session says:

mate-session[108911]: DEBUG(+): main: filemanager looking for component: 'caja'
mate-session[108911]: DEBUG(+): GsmUtil: Looking for file 'caja.desktop'
mate-session[108911]: DEBUG(+): GsmUtil: Looking in '/home/user/.local/share/applications'
mate-session[108911]: DEBUG(+): GsmUtil: Looking in '/usr/local/share/applications'
mate-session[108911]: DEBUG(+): GsmUtil: Looking in '/usr/share/applications'
mate-session[108911]: DEBUG(+): GsmUtil: Looking in '/usr/share/gdm/applications'
mate-session[108911]: DEBUG(+): GsmUtil: found in XDG app dirs: '/usr/share/applications/caja.desktop'
mate-session[108911]: DEBUG(+): GsmManager: read /usr/share/applications/caja.desktop

...

mate-session[108911]: DEBUG(+): GsmXSMPClient: Setting up new connection
mate-session[108911]: DEBUG(+): GsmXSMPClient: New client '0x55eed36cdba0 []'
mate-session[108911]: DEBUG(+): GsmStore: Adding object id /org/gnome/SessionManager/Client5 to store
mate-session[108911]: DEBUG(+): GsmManager: Client added: /org/gnome/SessionManager/Client5
mate-session[108911]: DEBUG(+): GsmXSMPClient: Initializing client 0x55eed36cdba0 []
mate-session[108911]: DEBUG(+): GsmXSMPClient: Client '0x55eed36cdba0 []' received RegisterClient(1081539b6db9a1bd93170096997782690500001089110059)
mate-session[108911]: DEBUG(+): GsmManager: Adding new client 1081539b6db9a1bd93170096997782690500001089110059 to session
mate-session[108911]: DEBUG(+): GsmXSMPClient: Sending RegisterClientReply to '0x55eed36cdba0 [1081539b6db9a1bd93170096997782690500001089110059]'
Could not register the application: Timeout was reached
mate-session[108911]: DEBUG(+): GsmXSMPClient: Set properties from client '0x55eed36cdba0 [1081539b6db9a1bd93170096997782690500001089110059]'
mate-session[108911]: DEBUG(+): GsmXSMPClient:   Program = 'caja'
mate-session[108911]: DEBUG(+): GsmXSMPClient:   CloneCommand = '/usr/bin/caja' 
mate-session[108911]: DEBUG(+): GsmXSMPClient:   RestartCommand = '/usr/bin/caja' '--sm-client-id' '1081539b6db9a1bd93170096997782690500001089110059' 
mate-session[108911]: DEBUG(+): GsmXSMPClient:   UserID = 'user'
mate-session[108911]: DEBUG(+): GsmXSMPClient:   ProcessID = '109078'
mate-session[108911]: DEBUG(+): GsmXSMPClient:   RestartStyleHint = 2
mate-session[108911]: DEBUG(+): GsmXSMPClient: Set properties from client '0x55eed36cdba0 [caja 1081539b6db9a1bd93170096997782690500001089110059]'
mate-session[108911]: DEBUG(+): GsmXSMPClient:   _GSM_DesktopFile = 'file:///usr/share/applications/caja.desktop'
mate-session[108911]: DEBUG(+): GsmXsmpServer: ice_io_error_handler (0x55eed3625120)
mate-session[108911]: DEBUG(+): GsmXSMPClient: IceProcessMessagesIOError on '0x55eed36cdba0 [caja 1081539b6db9a1bd93170096997782690500001089110059]'
mate-session[108911]: DEBUG(+): GsmManager: disconnect client
mate-session[108911]: DEBUG(+): GsmManager: disconnect client: /org/gnome/SessionManager/Client5
mate-session[108911]: DEBUG(+): GsmXSMPClient: getting restart style
mate-session[108911]: DEBUG(+): GsmManager: restarting app
mate-session[108911]: DEBUG(+): Re-starting app: /org/gnome/SessionManager/App60
mate-session[108911]: DEBUG(+): GsmAutostartApp: Couldn't stop app: Not running
mate-session[108911]: DEBUG(+): Starting app: /org/gnome/SessionManager/App60
mate-session[108911]: DEBUG(+): GsmAutostartApp: starting caja.desktop: command=/usr/bin/caja startup-id=1081539b6db9a1bd93170096997782690500001089110059
mate-session[108911]: DEBUG(+): GsmAutostartApp: started pid:109086
mate-session[108911]: DEBUG(+): GsmStore: Unreffing object: 0x55eed36cdba0
mate-session[108911]: DEBUG(+): GsmManager: Client removed: /org/gnome/SessionManager/Client5
mate-session[108911]: DEBUG(+): GsmClient: disposing /org/gnome/SessionManager/Client5
mate-session[108911]: DEBUG(+): GsmXSMPClient: xsmp_finalize (0x55eed36cdba0 [caja 1081539b6db9a1bd93170096997782690500001089110059])
mate-session[108911]: DEBUG(+): GsmAutostartApp: (pid:109078) done (status:1)
raveit65 commented 7 months ago

Any useful infos in journalctl --user -b0 -r How did you compile caja? configure log?

raveit65 commented 7 months ago

Which compile/install order did you use for whole mate desktop?

eluancm commented 6 months ago

I was hit by this exact bug. After some experimenting, I found out that, on Gentoo, caja-1.26.3 is not working with gtk+3.24.38 and 3.24.39, but works fine with 3.24.35.

Since this doesn't seem widespred, perhaps something else triggered this incompatibility. Only caja seems to be affected, but it means that I can't install MATE alongside the latest GNOME3.

lukefromdc commented 6 months ago

I have gtk 3.24.38 with the gtk3-classic patches applied and caja starts fine in both my x11 and wayland sessions.

Note that GNOME 3 has partially converted to GTK4 and I would imagine will be entirely on GTK4 by next release. I have them both installed on a modified Debian Unstable and both work

lukefromdc commented 6 months ago

I just verified that I had no trouble starting caja with either the x11 or the wayland session with gtk 3.0 built from today's git master (3.24.39+git20231228)with all usable patches (a few failed) from today's gtk3-classic (again from git master) applied.

I need those patches to get striped treeviews, and to fix some hardcoded options GTK devs set for wayland that don't mesh will with MATE such as forced headerbars on filechoosers.

Shushandr commented 4 months ago

Make sure that ownership of ~/ .config/dconf/user hasn't been transferred to root, change it back if so.

I removed the directory ~/ .config/dconf with rm -rf ~/ .config/dconf.

$ ls -1la ~/ | grep "\.config"
drwxr-xr-x 102 user user         4096 фев 19 07:47 .config

After that I restarted computer. No changes.

I would also expect this if for any reason dbus isn't starting.

dbus is working, because my test app is able to connect to it with different id, and can't with org.mate.Caja.

My current hypothesis is that Caja starts, and hangs somewhere. To debug it I need to disable it's autostart and debug it manually later.

Shushandr commented 4 months ago

$ caja

(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: cannot register existing type 'GTask'
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: cannot register existing type 'GAsyncResult'
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed
(caja:4072): GLib-CRITICAL **: 11:57:30.412: g_once_init_leave: assertion 'result != 0' failed
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
(caja:4072): GLib-CRITICAL **: 11:57:30.412: g_once_init_leave: assertion 'result != 0' failed
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: cannot retrieve class for invalid (unclassed) type ''
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: cannot register existing type 'GInputStream'
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: cannot add private field to invalid (non-instantiatable) type ''
(caja:4072): GLib-CRITICAL **: 11:57:30.412: g_once_init_leave: assertion 'result != 0' failed
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: g_type_register_static: assertion 'parent_type > 0' failed
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: cannot add private field to invalid (non-instantiatable) type ''
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: cannot register existing type 'GSeekable'
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed
(caja:4072): GLib-CRITICAL **: 11:57:30.412: g_once_init_leave: assertion 'result != 0' failed
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.412: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
(caja:4072): GLib-GObject-CRITICAL **: 11:57:30.413: cannot register existing type 'GPollableInputStream'
lukefromdc commented 4 months ago

I am out of ideas and cannot duplicate this. Try creating another user, logging into MATE as that user, and see what caja does. If it still fails there must be something wrong with your build. Maybe try rebuilding caja in that case, or both caja and mate-session-manager?

We are not getting a deluge of similar reports from other Gentoo users either.

Shushandr commented 4 months ago

try rebuilding caja

# emerge -av1 dev-libs/glib  ~x11-libs/gtk+-2.24.33 ~x11-libs/gtk+-3.24.38 caja

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 9.54 s.

[ebuild   R    ] dev-libs/glib-2.76.4:2::gentoo  USE="dbus elf gtk-doc (mime) static-libs sysprof test xattr -debug (-selinux) -systemtap -utils" ABI_X86="(64) -32 (-x32)" 0 KiB
[ebuild   R    ] x11-libs/gtk+-3.24.38:3::gentoo  USE="X colord cups introspection sysprof wayland (-aqua) -broadway -cloudproviders -examples -gtk-doc -test -vim-syntax -xinerama" ABI_X86="(64) -32 (-x32)" 12 108 KiB
[ebuild   R    ] x11-libs/gtk+-2.24.33-r3:2::gentoo  USE="cups introspection (-aqua) -examples -test -vim-syntax -xinerama" ABI_X86="(64) -32 (-x32)" 12 366 KiB
[ebuild   R    ] mate-base/caja-1.26.3::gentoo  USE="introspection mate nls xmp" 0 KiB

Total: 4 packages (4 reinstalls), Size of downloads: 24 473 KiB

Would you like to merge these packages? [Yes/No]

$ find /usr/lib64 -iname libgobject-2.0* | xargs file | sort
/usr/lib64/libgobject-2.0.a:           current ar archive
/usr/lib64/libgobject-2.0.so.0.7600.4: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
/usr/lib64/libgobject-2.0.so.0:        symbolic link to libgobject-2.0.so.0.7600.4
/usr/lib64/libgobject-2.0.so:          symbolic link to libgobject-2.0.so.0

$ ls -1la /usr/lib64/libgobject-2.0.so.0.7600.4
-rwxr-xr-x 1 root root 392296 2024-02-20 01:28:36.565201202 +0300 /usr/lib64/libgobject-2.0.so.0.7600.4

no changes...

lukefromdc commented 4 months ago

I am clean out of ideas on this one, someone else on the team will have to help.Has to be something in your build or install but I am not on gentoo and have no idea what.