hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.6k stars 902 forks source link

IPC issues with hyprctl and waybar #7041

Closed giodueck closed 3 months ago

giodueck commented 3 months ago

Regression?

No

System Info and Version

System/Version info ```sh giodueck@archlinux ~/.config % hyprctl -i 0 systeminfo Hyprland, built from branch at commit 918d8340afd652b011b937d29d5eea0be08467f5 (flake.lock: update). Date: Tue Jun 25 12:06:02 2024 Tag: v0.41.2, commits: 4886 flags: (if any) System Information: System name: Linux Node name: archlinux-samuu Release: 6.10.0-zen1-2-zen Version: #1 ZEN SMP PREEMPT_DYNAMIC Mon, 22 Jul 2024 17:45:00 +0000 GPU information: 06:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] [1002:15dd] (rev d3) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ```

Description

After quitting and restarting Hyprland, any process which uses the IPC sockets fails to find them.

The socket exists, but processes look for it in the wrong runtime directory:

giodueck@archlinux ~/.config % ll $XDG_RUNTIME_DIR/hypr/*/
/run/user/1000/hypr/918d8340afd652b011b937d29d5eea0be08467f5_1721910426_1248463764/:
total 128
-rw-r--r-- 1 giodueck giodueck 130215 Jul 25 08:32 hyprland.log

/run/user/1000/hypr/918d8340afd652b011b937d29d5eea0be08467f5_1721910762_1373866473/:
total 188
-rw-r--r-- 1 giodueck giodueck     15 Jul 25 08:32 hyprland.lock
-rw-r--r-- 1 giodueck giodueck 186231 Jul 25 08:48 hyprland.log

giodueck@archlinux ~/.config % hyprctl rollinglog
Couldn't connect to /run/user/1000/hypr/918d8340afd652b011b937d29d5eea0be08467f5_1721910426_1248463764/.socket.sock. (3)

Interesting to note: specifying an instance fixes the issue, as seen in the system info section:

giodueck@archlinux ~/.config % hyprctl -i 0 systeminfo
Hyprland, built from branch  at commit 918d8340afd652b011b937d29d5eea0be08467f5  (flake.lock: update).
Date: Tue Jun 25 12:06:02 2024
Tag: v0.41.2, commits: 4886
...

I can try to bisect a little later, I didn't find a similar issue from a cursory search.

How to reproduce

  1. Launch Hyprland (SDDM)
  2. Quit Hyprland
  3. Launch Hyprland (SDDM)
  4. Kill and restart waybar (hyprland/workspaces and hyprland/window error out), or query hyprctl

Crash reports, logs, images, videos

No response

MightyPlaza commented 3 months ago

what's the output of hyprctl instances?

giodueck commented 3 months ago
giodueck@archlinux ~/.config % hyprctl instances
instance 918d8340afd652b011b937d29d5eea0be08467f5_1721910762_1373866473:
        time: 1721910762
        pid: 7548
        wl socket: wayland-1

Which tells me it should know which instance to pick, but commands like monitors and rollinglog show the error:

Couldn't connect to /run/user/1000/hypr/918d8340afd652b011b937d29d5eea0be08467f5_1721910426_1248463764/.socket.sock. (3)
MightyPlaza commented 3 months ago

what about hyprctl -i 0 ... and hyprctl -i 1 ...?

giodueck commented 3 months ago

That works, and only one instance is detected (as it should be)

giodueck@archlinux ~/.config % hyprctl splash
Couldn't connect to /run/user/1000/hypr/918d8340afd652b011b937d29d5eea0be08467f5_1721910426_1248463764/.socket.sock. (3)
giodueck@archlinux ~/.config % hyprctl -i 0 splash
Compile, wait for 20 minutes, notice a new commit, compile again.
giodueck@archlinux ~/.config % hyprctl -i 1 splash
no such instance

giodueck@archlinux ~/.config % hyprctl -i 2 splash
no such instance
giodueck commented 3 months ago

Moving the old runtime directory out or deleting it does not change the error, it still looks for the socket in the old directory.

But on reboot the runtime is deleted anyways, so a reboot fixes this.

vaxerski commented 3 months ago

odd, env didnt get updated. $HYPRLAND_INSTANCE_SIGNATURE is likely wrong

giodueck commented 3 months ago

This is my current config: https://github.com/giodueck/dotfiles/tree/2f311f873114d2810683ffa0f6c4051763b6c3c8.

I was testing dynamic waybar configs with exec-once, as I want this setup to work on my home laptop and work machine.

@vaxerski you're right:

giodueck@archlinux ~/dotfiles [main] % echo $HYPRLAND_INSTANCE_SIGNATURE
918d8340afd652b011b937d29d5eea0be08467f5_1721910426_1248463764

which is the old instance.

Exporting the right signature fixes the issue

vaxerski commented 3 months ago

I ain't readin allat but I'm pretty positive it's something on your side. I mean, you're the only one with the issue.

Try default config for hl

giodueck commented 3 months ago

I'll try in a minute and see if it fixes it

giodueck commented 3 months ago

The issue is on my end, I'm using tmux which does not update its env if an existing session was reconnected to.

Start: tmux session has the correct env Restart: tmux still has the old env

vaxerski commented 3 months ago

tmux moment