NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.74k stars 13.86k forks source link

zim crashing on start-up #286950

Open someplaceguy opened 8 months ago

someplaceguy commented 8 months ago

Describe the bug

When starting zim, it crashes with the following message:

This is zim 0.75.2
Platform: posix
Locale: en_US UTF-8
FS encoding: utf-8
Python: (3, 11, 6, 'final', 0)
PyGObject: (3, 46, 0)

======= Traceback =======
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/main/__init__.py", line 962, in main
    ZIM_APPLICATION.run(*argv[1:])
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/main/__init__.py", line 733, in run
    self._run_cmd(cmd, args) # test seam
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/main/__init__.py", line 764, in _run_cmd
    self._run_main_loop(cmd)
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/main/__init__.py", line 806, in _run_main_loop
    w = cmd.run()
        ^^^^^^^^^
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/main/__init__.py", line 261, in run
    from zim.gui.mainwindow import MainWindow
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/gui/mainwindow.py", line 39, in <module>
    from zim.gui.pageview import PageView
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/gui/pageview/__init__.py", line 4083, in <module>
    CURSOR_LINK = Gdk.Cursor.new_from_name(Gdk.Display.get_default(), 'pointer')
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: constructor returned NULL

If starting from a shell, the following messages appear in the console as well:

Gdk-Message: 09:03:57.738: Unable to load pointer from the cursor theme
ERROR: Exception while loading plugin: insertsymbol
Traceback (most recent call last):
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/plugins/__init__.py", line 414, in load_plugins_from_preferences
    self.load_plugin(name)
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/plugins/__init__.py", line 522, in load_plugin
    klass = self.get_plugin_class(name)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/plugins/__init__.py", line 469, in get_plugin_class
    mod = get_module(modname)
          ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/utils.py", line 36, in get_module
    mod = __import__(name)
          ^^^^^^^^^^^^^^^^
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/plugins/insertsymbol.py", line 11, in <module>
    from zim.gui.pageview import PageViewExtension
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/gui/pageview/__init__.py", line 4083, in <module>
    CURSOR_LINK = Gdk.Cursor.new_from_name(Gdk.Display.get_default(), 'pointer')
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: constructor returned NULL
Gdk-Message: 09:03:57.761: Unable to load pointer from the cursor theme
ERROR: Exception while loading plugin: versioncontrol
Traceback (most recent call last):
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/plugins/__init__.py", line 414, in load_plugins_from_preferences
    self.load_plugin(name)
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/plugins/__init__.py", line 522, in load_plugin
    klass = self.get_plugin_class(name)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/plugins/__init__.py", line 469, in get_plugin_class
    mod = get_module(modname)
          ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/utils.py", line 36, in get_module
    mod = __import__(name)
          ^^^^^^^^^^^^^^^^
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/plugins/versioncontrol/__init__.py", line 28, in <module>
    from zim.gui.mainwindow import MainWindowExtension
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/gui/mainwindow.py", line 39, in <module>
    from zim.gui.pageview import PageView
  File "/nix/store/hqqccmp915jlmwsq52gsavshxr5kfpvj-zim-0.75.2/lib/python3.11/site-packages/zim/gui/pageview/__init__.py", line 4083, in <module>
    CURSOR_LINK = Gdk.Cursor.new_from_name(Gdk.Display.get_default(), 'pointer')
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(...)

The same warnings, errors and tracebacks are also shown for the screenshot, quicknote, tags, pageindex and journal plugins.

zim had been working fine for me for years, so this appears to be related to a recent update to NixOS 23.11 (i.e. some commit in the last week or two, probably).

Steps To Reproduce

  1. start zim

Expected behavior

No errors, zim starts up fine.

Screenshots

See above.

Notify maintainers

cc @pSub

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.77, NixOS, 23.11 (Tapir), 23.11.git.729a974ad17c`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `/nixdev/nixpkgs`

Add a :+1: reaction to issues you find important.

someplaceguy commented 6 months ago

I was able to fix this (or at least, work around it) by setting a default cursor theme. In my case, I simply added the following package to the list of user packages (i.e. users.users.<username>.packages):

         (pkgs.runCommandLocal "gtk-cursor-fix" {} ''
            dir=$out/share/icons
            mkdir -p $dir
            ln -s ${pkgs.gnome.adwaita-icon-theme}/share/icons/Adwaita $dir/default
         '')

The above code was a minor adaptation (to use a different theme) of the code in this comment: https://github.com/NixOS/nixpkgs/issues/207339#issuecomment-1762695954