Guake / guake

Drop-down terminal for GNOME
https://guake.github.io
GNU General Public License v2.0
4.41k stars 575 forks source link

Guake won't start due to incorrect SCHEMA_DIR #1436

Open SparkyBluefang opened 5 years ago

SparkyBluefang commented 5 years ago

Guake Terminal 3.4.0 Python 3.6.5 Gentoo Linux

I just upgraded Guake from 3.3.2 to 3.4.0 and it is now failing to start because it can't load the GLib schema.

Guake not running, starting it
[WARN] ===================================================================
[WARN] Unable to load the library libutempter !
[WARN] Some feature might not work:
[WARN]  - 'exit' command might freeze the terminal instead of closing the tab
[WARN]  - the 'wall' command is know to work badly
[WARN] Error: libutempter.so.0: cannot open shared object file: No such file or directory
[WARN] ===================================================================²
Unable to load the GLib schema, try to compile it
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 361, in get_name_owner
    's', (bus_name,), **keywords)
  File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.guake3.RemoteControl': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/guake/main.py", line 295, in main
    remote_object = bus.get_object(DBUS_NAME, DBUS_PATH)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib64/python3.6/site-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.guake3.RemoteControl was not provided by any .service files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/guake/guake_app.py", line 123, in __init__
    schema_source = load_schema()
  File "/usr/lib64/python3.6/site-packages/guake/guake_app.py", line 119, in load_schema
    SCHEMA_DIR, Gio.SettingsSchemaSource.get_default(), False
GLib.GError: g-file-error-quark: Failed to open file “/usr/lib64/python3.6/site-packages/data/gschemas.compiled”: open() failed: No such file or directory (4)
Error opening directory “/usr/lib64/python3.6/site-packages/data”: No such file or directory
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 361, in get_name_owner
    's', (bus_name,), **keywords)
  File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.guake3.RemoteControl': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/guake/main.py", line 295, in main
    remote_object = bus.get_object(DBUS_NAME, DBUS_PATH)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib64/python3.6/site-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.guake3.RemoteControl was not provided by any .service files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/guake/guake_app.py", line 123, in __init__
    schema_source = load_schema()
  File "/usr/lib64/python3.6/site-packages/guake/guake_app.py", line 119, in load_schema
    SCHEMA_DIR, Gio.SettingsSchemaSource.get_default(), False
GLib.Error: g-file-error-quark: Failed to open file “/usr/lib64/python3.6/site-packages/data/gschemas.compiled”: open() failed: No such file or directory (4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/guake", line 10, in <module>
    sys.exit(exec_main())
  File "/usr/lib64/python3.6/site-packages/guake/main.py", line 410, in exec_main
    if not main():
  File "/usr/lib64/python3.6/site-packages/guake/main.py", line 310, in main
    instance = Guake()
  File "/usr/lib64/python3.6/site-packages/guake/guake_app.py", line 126, in __init__
    try_to_compile_glib_schemas()
  File "/usr/lib64/python3.6/site-packages/guake/paths.py", line 97, in try_to_compile_glib_schemas
    subprocess.check_call(["glib-compile-schemas", "--strict", SCHEMA_DIR])
  File "/usr/lib64/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['glib-compile-schemas', '--strict', '/usr/lib64/python3.6/site-packages/data']' returned non-zero exit status 1.

I tracked it down to ab7b44ab346803f5846eb2959011ffe2270b8153. If I undo this change, guake will start.

Broken:

>>> d = os.path.dirname(os.path.dirname(sys.modules["guake"].__file__))
>>> p = os.path.basename(os.path.abspath(os.path.join(d, "..")))
>>> print('%s\n%s' % (d, p))
/usr/lib64/python3.6/site-packages
python3.6

Works:

>>> d = os.path.dirname(sys.modules["guake"].__file__)
>>> p = os.path.basename(os.path.abspath(os.path.join(d, "..")))
>>> print('%s\n%s' % (d, p))
/usr/lib64/python3.6/site-packages/guake
site-packages

Was the intended change perhaps to change the next line from os.path.abspath(os.path.join(d, "..")) to os.path.dirname(d)?

jer-gentoo commented 5 years ago

https://bugs.gentoo.org/667878

zqb-all commented 5 years ago

The same problem in my ubuntu18.04. And tracked it down to ab7b44a can't help.

zqb-all commented 5 years ago

The same problem in my ubuntu18.04. And tracked it down to ab7b44a can't help.

sudo make reinstall have this problem. sudo -H make reinstall work for me.

y2kbadbug commented 5 years ago

This problem also exists in FreeBSD. I have been working on updating the port, got it to compile, but it's complaining about the gschemas missing. It's looking in /usr/local/lib/python-3.6/site-packages/data (Why is it even looking there?)

gsemet commented 5 years ago

hi. how is package install on freebsd? make install is obviously debian oriented, so if you have more information on how python works on other systems I can rework it :)

SparkyBluefang commented 5 years ago

@y2kbadbug I'm assuming the FreeBSD problem is the exact same one I'm seeing on Linux, due to the change in ab7b44a. If you manually undo these changes on the installed paths.py I'm willing to be it will start working.

@gsemet Might I suggest moving the data, and po directories into the python module? That would simplify the path resolution and avoid needing to walk up and down the directory tree and hope you end up in the correct location.

def get_data_files_dir():
    return os.path.dirname(sys.modules["guake"].__file__)

As far as I can tell, the files in /usr/share/guake/ (or equivalent) are only referenced by guake at run time, so there dosn't appear to be a reason to install them outside of the python module.

gsemet commented 5 years ago

this is quite difficult to follow. pypi wheels "data" section is not well documented, so there is lot of latitude here. I think pypi install it into /usr/local/share/guake (to be cofnirmed). debian started packaging it into /usr/share/guake. I mimicked it to put it into /usr/local/share/guake in my make install. In my custom rebuild of pip install I kept this file, but it makes it very difficult to access to it using pkg_resource, which is being replaced.

So yet, maybe I'll rework it again to place it into the python module, at least this would simplify this mess. But having the resource in /usr/share/guake looked cool at the time :)

y2kbadbug commented 5 years ago

I created a separate ticket for FreeBSD support #1444

eblis commented 5 years ago

I have the same issue on Linux Mint 19.

lucasbru commented 5 years ago

Same issue on fedora 29

mskrip commented 5 years ago

Had the same issue on Arch. Realized I had both guake from Arch repos and from pip. Solved by uninstalling the pip version.

drNoob13 commented 5 years ago

Your Guake installing from source was in conflict with your guake installed from pip. Uninstall the pip version would solve that for you.

Guake error throw upon starting:

$ guake
Guake not running, starting it
Unable to load the GLib schema, try to compile it
Traceback (most recent call last):
.
.
subprocess.CalledProcessError: Command '['glib-compile-schemas', '--strict', '/home/tuan/.local/lib/python3.5/site-packages/data']' returned non-zero exit status 1

Uninstall conflicting pip-built guake

$ pip3 uninstall guake

Uninstalling Guake-3.4.0:
  /home/tuan/.local/bin/guake
  /home/tuan/.local/bin/guake-toggle
  /home/tuan/.local/lib/python3.5/site-packages/Guake-3.4.0.dist-info/COPYING
.
.
  /home/tuan/.local/share/guake/po/zh_CN.po
Proceed (y/n)? y
  Successfully uninstalled Guake-3.4.0

Start Guake again (no error)

$ guake
Guake not running, starting it
Guake Terminal 3.5.0
VTE 0.42.5
Gtk 3.18.9
created fresh notebook for workspace 0
Spawning new terminal at /home/tuan

(guake:22612): Gtk-CRITICAL **: gtk_container_remove: assertion '_gtk_widget_get_parent (widget) == GTK_WIDGET (container) || GTK_IS_ASSISTANT (container) || GTK_IS_ACTION_BAR (container) || GTK_IS_POPOVER_MENU (container)' failed
current workspace is 0
can't bind show-focus key
Guake initialized
Showing the terminal
Hiding the terminal

Press F12 to use it.

Davidy22 commented 2 years ago

Merged #1893 that may fix this, new version of guake coming soon so that the affected can confirm whether or not this is fixed. This will also be in latest git master, but compiling from source sends files to a different place which will make this work, but doesn't quite confirm that the issue is dealt with.