Ulauncher does not start after system update

After the latest system update, Ulauncher does not start anymore.
I tried to start it from the terminal and I got the following error message:

TypeError: Couldn't find foreign struct converter for 'cairo.Surface'

I reinstalled cairo, python-cairo, and ulauncher, but the problem persists.
How can I solve this issue?

Output of `inxi - Fazy`

System:
Kernel: 6.0.19-4-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
parameters: BOOT_IMAGE=/vmlinuz-6.0-x86_64
root=UUID=ca0b13f1-3220-4bc9-9dc7-77d2311111e0 rw rootflags=subvol=@ quiet
apparmor=1 security=apparmor udev.log_priority=3
Desktop: KDE Plasma v: 5.26.5 tk: Qt v: 5.15.8 info: latte-dock
wm: kwin_x11 vt: 1 dm: SDDM Distro: Manjaro Linux base: Arch Linux
Machine:
Type: Laptop System: LENOVO product: 4180Q3U v: ThinkPad T420
serial: Chassis: type: 10 serial:
Mobo: LENOVO model: 4180Q3U serial:
UEFI-[Legacy]: LENOVO v: 83ET82WW (1.52 ) date: 06/04/2018
Battery:
ID-1: BAT0 charge: 17.4 Wh (26.2%) condition: 66.5/57.7 Wh (115.2%)
volts: 10.6 min: 11.1 model: SANYO 45N1023 type: Li-ion serial:
status: charging
CPU:
Info: model: Intel Core i7-2640M bits: 64 type: MT MCP arch: Sandy Bridge
gen: core 2 level: v2 built: 2010-12 process: Intel 32nm family: 6
model-id: 0x2A (42) stepping: 7 microcode: 0x2F
Topology: cpus: 1x cores: 2 tpc: 2 threads: 4 smt: enabled cache:
L1: 128 KiB desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB desc: 2x256 KiB
L3: 4 MiB desc: 1x4 MiB
Speed (MHz): avg: 804 high: 825 min/max: 800/3500 scaling:
driver: intel_cpufreq governor: schedutil cores: 1: 825 2: 797 3: 800 4: 797
bogomips: 22337
Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
Vulnerabilities:
Type: itlb_multihit status: KVM: VMX unsupported
Type: l1tf mitigation: PTE Inversion
Type: mds mitigation: Clear CPU buffers; SMT vulnerable
Type: meltdown mitigation: PTI
Type: mmio_stale_data status: Unknown: No mitigations
Type: retbleed status: Not affected
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
prctl
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
sanitization
Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
STIBP: conditional, RSB filling, PBRSB-eIBRS: Not affected
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected
Graphics:
Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics
vendor: Lenovo ThinkPad T420 driver: i915 v: kernel arch: Gen-6
code: Sandybridge process: Intel 32nm built: 2011 ports: active: LVDS-1
empty: DP-1, DP-2, DP-3, HDMI-A-1, HDMI-A-2, HDMI-A-3, VGA-1
bus-ID: 00:02.0 chip-ID: 8086:0126 class-ID: 0300
Device-2: Chicony integrated camera type: USB driver: uvcvideo
bus-ID: 1-1.6:5 chip-ID: 04f2:b221 class-ID: 0e02
Display: x11 server: X.Org v: 21.1.7 compositor: kwin_x11 driver: X:
loaded: modesetting alternate: fbdev,vesa dri: crocus gpu: i915
display-ID: :0 screens: 1
Screen-1: 0 s-res: 1600x900 s-dpi: 96 s-size: 422x237mm (16.61x9.33")
s-diag: 484mm (19.05")
Monitor-1: LVDS-1 model: LG Display 0x02e2 built: 2010 res: 1600x900 hz: 60
dpi: 131 gamma: 1.2 size: 310x174mm (12.2x6.85") diag: 355mm (14")
ratio: 16:9 modes: 1600x900
API: OpenGL v: 3.3 Mesa 22.3.5 renderer: Mesa Intel HD Graphics 3000 (SNB
GT2) direct-render: Yes
Audio:
Device-1: Intel 6 Series/C200 Series Family High Definition Audio
vendor: Lenovo driver: snd_hda_intel v: kernel bus-ID: 00:1b.0
chip-ID: 8086:1c20 class-ID: 0403
Sound API: ALSA v: k6.0.19-4-MANJARO running: yes
Sound Interface: sndio v: N/A running: no
Sound Server-1: JACK v: 1.9.21 running: no
Sound Server-2: PulseAudio v: 16.1 running: yes
Sound Server-3: PipeWire v: 0.3.65 running: yes
Network:
Device-1: Intel 82579LM Gigabit Network vendor: Lenovo ThinkPad T520
driver: e1000e v: kernel port: 5080 bus-ID: 00:19.0 chip-ID: 8086:1502
class-ID: 0200
IF: enp0s25 state: down mac:
Device-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi
v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 03:00.0
chip-ID: 8086:0085 class-ID: 0280
IF: wlan0 state: up mac:
IF-ID-1: wwp0s29u1u4i6 state: down mac:
Bluetooth:
Device-1: Broadcom BCM2045B (BDC-2.1) type: USB driver: btusb v: 0.8
bus-ID: 1-1.4:4 chip-ID: 0a5c:217f class-ID: fe01 serial:
Report: rfkill ID: hci0 rfk-id: 5 state: up address: see --recommends
Drives:
Local Storage: total: 1.36 TiB used: 1.01 TiB (74.3%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 500GB
size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
type: SSD serial: rev: 3B6Q scheme: MBR
ID-2: /dev/sdb maj-min: 8:16 vendor: HGST (Hitachi) model: HTS541010A9E680
size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
type: HDD rpm: 5400 serial: rev: A7G0 scheme: MBR
Partition:
ID-1: / raw-size: 100 GiB size: 100 GiB (100.00%) used: 34.97 GiB (35.0%)
fs: btrfs dev: /dev/sda2 maj-min: 8:2
ID-2: /boot raw-size: 512 MiB size: 511 MiB (99.80%)
used: 127.2 MiB (24.9%) fs: vfat dev: /dev/sda1 maj-min: 8:1
ID-3: /home raw-size: 365.26 GiB size: 365.26 GiB (100.00%)
used: 314.03 GiB (86.0%) fs: btrfs dev: /dev/sda3 maj-min: 8:3
ID-4: /var/log raw-size: 100 GiB size: 100 GiB (100.00%)
used: 34.97 GiB (35.0%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
Swap:
Alert: No swap data was found.
Sensors:
System Temperatures: cpu: 57.0 C mobo: N/A
Fan Speeds (RPM): cpu: 3525
Info:
Processes: 352 Uptime: 1d 4h 26m wakeups: 1 Memory: 15.41 GiB
used: 7.71 GiB (50.0%) Init: systemd v: 252 default: graphical
tool: systemctl Compilers: gcc: 12.2.1 clang: 15.0.7 Packages: pm: pacman
pkgs: 2528 libs: 455 tools: pamac,paru pm: flatpak pkgs: 0 Shell: Zsh v: 5.9
running-in: yakuake inxi: 3.3.25

If it is an AUR package then rebuild it after an update of the system.

Thanks for replying so promptly, @Nachlese.
As I said in my original post, I did that but it didn’t solve the problem.

Which ‘ulauncher’ do you have installed?

I have 5.15-1 and it’s looking ok, though I generally use krunner nowadays.

Try:

 mv -vi ~/.config/ulauncher/ ~/.config/ulauncher.OLD`

How’s it looking now?
Maybe a plugin or something…

Hi, @Ben, thanks for replying to this message.
What you propose didn’t sort it out. I’m still not able to start it.
I’m also using the same version as you:

> ulauncher --version
ulauncher 5.15.1

Here’s the full output I get when executing ulauncher from the terminal:

output

❯ ulauncher
2023-02-20 00:31:30,457 | ERROR | ulauncher: except_hook() | Uncaught exception
Traceback (most recent call last):
File “/usr/bin/ulauncher”, line 28, in
main()
File “/usr/lib/python3.10/site-packages/ulauncher/main.py”, line 136, in main
window = UlauncherWindow.get_instance()
File “/usr/lib/python3.10/site-packages/ulauncher/utils/decorator/singleton.py”, line19, in wrapper
instance = fn(*args, **kwargs)
File “/usr/lib/python3.10/site-packages/ulauncher/ui/windows/UlauncherWindow.py”, line 56, in get_instance
return cls()
File “/usr/lib/python3.10/site-packages/ulauncher/ui/windows/UlauncherWindow.py”, line 66, in new
new_object.finish_initializing(builder)
File “/usr/lib/python3.10/site-packages/ulauncher/ui/windows/UlauncherWindow.py”, line 99, in finish_initializing
self.init_theme()
File “/usr/lib/python3.10/site-packages/ulauncher/ui/windows/UlauncherWindow.py”, line 242, in init_theme
self._render_prefs_icon()
File “/usr/lib/python3.10/site-packages/ulauncher/ui/windows/UlauncherWindow.py”, line 393, in _render_prefs_icon
surface = Gdk.cairo_surface_create_from_pixbuf(prefs_pixbuf, scale_factor, self.get_window())
TypeError: Couldn’t find foreign struct converter for ‘cairo.Surface’

I’m now also using krunner, and maybe this is an opportunity to start using a nice native Plasma APP instead of third party software…

An update on this issue: I posted a message to the Archlinux User Repository, reporting the problem. One user suggested that my system was broken and that I should follow the instructions in this link.
If I understand correctly, this happens because Arch breaks AUR Python modules when we upgrade Python versions, and rebuilding Ulauncher should fix the problem. As I am using paru, I have run
paru -S ulauncher --rebuild,
but the problem persists.
I’m currently stuck. Although I have been using krunner and enjoying it, I would like to solve this problem, so any help would be appreciated.

As I often do out of curiosity, I just built the thing.
With the help of yay, because that is what I most often use.
yay -S ulauncher

I selected to remove build dependencies, all dependencies where installed, then ulauncher was built - and the dependencies removed again.

ulauncher started and works flawlessly when started from terminal
I’m not familiar with it or how to use it instead of my current whiskermenu (Xfce4). :man_shrugging:

Perhaps your system needs to be updated?
Mine definitely was/is.
(Manjaro stable Xfce4 in a virtual machine)

they might have a point
not broken, perhaps - just not up to date?



ps:
a possible path to a solution - after your system is brought up to date

sudo pacman -Rns ulauncher

then remove the paru build cache - I don’t know where it resides, probably in ~/.cache
then initiate the build again

point is to make sure you are not re-using old files …

Thanks for your reply @Nachlese.
My system is (always) up to date.
I cleaned paru’s cache, removed all files and packages associated to Ulauncher (sudo pacman -Rns ulauncher), and rebuilt it with paru -S ulauncher. The problem persists. :face_exhaling:

Oh, well - I don’t know what to say.

It simply worked, for me …

I used yay - not paru

perhaps try building it with makepkg,
as the AUR is “intended” to be used

I downloaded the package from the source and built it using makepkg, like so:

git clone https://aur.archlinux.org/ulauncher.git && cd ulauncher && makepkg -is

It didn’t work. :expressionless:
Above all, I would like to understand what is going on.

I don’t know where you got this address from - or whether it is valid or not.

I simply used yay - which uses the AUR PKGBUILD

PKGBUILD - aur.git - AUR Package Repositories

No idea why you … struggle.
It just works, for me.

this is the AUR page for the thing:

AUR (en) - ulauncher

From the official Ulauncher website. The PKGBUILD file you indicated is exactly the same as that one.
It compiles without any error, but I get the errors I indicated before.

… and I don’t (get these)

It works.
For me.

That is all I can say.

I understand, @Nachlese.
Thanks for your help!
Maybe this will be “automatically” fixed in the next version of Ulauncher.

Why would it be - if it works (for me) right now?
As it does.

I seriously doubt that … waiting … would magically fix anything,
which should already work as it is.

I’d be very surprised if “it” would somehow automatically fix itself.

That “maybe” of yours is rather a “very likely not” - and pointing towards some issue with your current system configuration that should be addressed.

So I also out of curiosity decided to try to install ulauncher. I did use a fully up-to-date manjaro KDE using stable repository (in Virutalbox, my host system is also Manjaro KDE but I use the unstable repository and I wanted to try using a similar setup as yours). I cannot reproduce your problem, it installed successfully and works as intended. I don’t know if it makes any difference, but I did not use paru, I used yay.

The address is the same address pamac and yay uses to clone a PKGBUILD before processing it.

This is a perfectly valid oneliner

git clone https://aur.archlinux.org/ulauncher.git
cd ulauncher
makepkg -is

Prior to running makepkg -is it is important to ensure your system is fully synced.

Another possible issue could be Manjaro branch - if you are - like most - you are using Manjaro stable - verify using this command

pacman-mirrors -G

Then it is likely a python library which has not yet reached Manjaro stable. Changing branch to Manjaro unstable - just a denomination - it is not unstable is simple.

sudo pacman-mirrors -aS unstable

Then run a full sync of your system packages

sudo pacman -Syyu

Then uninstall your version of ulauncher

sudo pacman -Rns ulauncher

Then rebuild using your AUR helper - I would lean towards using pamac

pamac build ulauncher

I just found a solution.
While trying to run Proton VPN, I got a somehow similar error, related to Cairo: undefined symbol: cairo_tee_surface_index.
So, suspecting that the problems were related to my Cairo installation, I did the following:

  1. I removed python-cairo using pip:

    pip uninstall pycairo
    

    Found existing installation: pycairo 1.21.0
    Uninstalling pycairo-1.21.0:
    Would remove:
    /home/ngomes/.local/lib/python3.10/site-packages/cairo/*
    /home/ngomes/.local/lib/python3.10/site-packages/pycairo-1.21.0.dist-info/*
    Proceed (Y/n)?
    Successfully uninstalled pycairo-1.21.0

  2. I tried to reinstall pycairo:

    pip install pycairo
    

    And here is the interesting part: another, more recent version of pycairo was already installed on my system!

    Requirement already satisfied: pycairo in /usr/lib/python3.10/site-packages (1.23.0)

So—although I don’t know how—I had two different versions of python-cairo installed on my system, and the oldest one (located in ~/.local/lib) was the default, causing a conflict.
By simply removing the old version of python-cairo, as described in 1. above, I solved the problems and Ulauncher and Proton VPN now both work. :blush:

Thank you all (@Nachlese, @Ben, @ydar, and @linux-aarhus) for your attention to this issue. I have been using Manjaro since 2016, and one of the main reasons for not switching distros is the great community, always willing to help. Kudos, you guys are awesome!

1 Like

Well - that was tricky :slight_smile:

You should remember this

system wide python packages - always install using pacman

sudo pacman -Syu python-cairo

Never install system wide python using sudo pip - the latter will create file conflicts on updates.

You can use pip install --user <pkg> on a user base or on a virtual environment.

As you have noted - having different versions creates unexplainable - hard to locate issues.

Check with the package manager if a package you are tempted to install using pip should be avaiable in the repo.

pamac search python-cairo

Even protonvpn is in AUR

pamac build protonvpn

There’s also an option to get this one in Chaotic:

2 aur/ulauncher 5.15.1-1 [+67 ~1.60] [Installed]
    Application launcher for Linux
1 chaotic-aur/ulauncher 5.15.1-1 [0B 5.89MiB] [Installed]
    Application launcher for Linux

Saves the building :wink: