Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: i3: Failed to reconnect socket #2730

Open
5 tasks done
ExperiBass opened this issue May 26, 2022 · 18 comments
Open
5 tasks done

[Bug]: i3: Failed to reconnect socket #2730

ExperiBass opened this issue May 26, 2022 · 18 comments

Comments

@ExperiBass
Copy link

Checklist

  • I have read the appropriate section in the contributing guidelines
  • I believe this issue is a problem with polybar itself and not a misconfiguration on my part
  • I have searched for other open and closed issues that may have already reported this problem
  • I have checked the known issues page for this problem.
  • I have followed the debugging guide to narrow down the problem to a minimal config.

Steps to reproduce

  1. polybar
  2. Wait for it to fail (random?)

Minimal config

; Init
[settings]
screenchange-reload = true
pseudo-transparency = true

[colors]
background = #000000
background-alt = #000000
foreground = #C5C8C6
primary = #5fdbf6
secondary = #076b81
tertiary = #ec4795
alert = #f0ad19
disabled = #444444
invisible = #00000000

[bar/bottom]
font-0 = FiraCode Nerd Font Mono;2
width = 100%
height = 2.5%
radius = 12
padding-right = 1
padding-left = 0

module-margin = 1
line-size = 3
background = ${colors.background}
foreground = ${colors.foreground}
border-size = 1
border-color = ${colors.invisible}

separator = |
separator-foreground = ${colors.tertiary}
modules-left = xworkspaces xwindow
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
tray-position = right
bottom = true

wm-restack = i3

; override-redirect = true
[module/xworkspaces]
type = internal/i3
format = <label-state>
label-focused = %name%
label-focused-background = ${colors.primary}
label-focused-foreground = ${colors.background}
label-focused-underline= ${colors.secondary}
label-focused-padding = 1
label-empty = %name%
label-empty-foreground = ${colors.disabled}
label-empty-padding = 1

Polybar log

polybar|notice:  Parsing config file: /home/ging/.config/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 2297951)
polybar|notice:  Loading module 'xworkspaces' of type 'internal/i3'
polybar|notice:  Loading module 'xwindow' of type 'internal/xwindow'
polybar|notice:  Loading module 'filesystem' of type 'internal/fs'
polybar|notice:  Loading module 'ram' of type 'internal/memory'
polybar|notice:  Loading module 'swap' of type 'internal/memory'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'wlan0' of type 'internal/network'
polybar|notice:  Loading module 'wlan1' of type 'internal/network'
polybar|error: Disabling module "wlan1" (reason: Invalid network interface "wlan1")
polybar|notice:  Loading module 'fanspeed' of type 'custom/script'
polybar|notice:  Loading module 'pulseaudio' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_e6_00.3.codec-output
polybar|notice:  Loading module 'temperature' of type 'internal/temperature'
polybar|notice:  Loading module 'battery' of type 'internal/battery'
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loaded 12 modules
polybar|notice:  Loaded font "FiraCode Nerd Font Mono" (name=FiraCode Nerd Font Mono, offset=2, file=/home/ging/.local/share/fonts/NerdFonts/Fira Code Regular Nerd Font Complete Mono.ttf)
polybar|warn:  Ignoring restack of i3 window (not needed when `override-redirect = false`)
polybar|error: Failed to query _XEMBED_INFO, removing client... (XCB_WINDOW (3))
polybar|warn:  module/xworkspaces: Attempting to reconnect socket (reason: Unexpected EOF while reading header)
polybar|notice:  Received signal(15): Terminated
polybar|notice:  Termination signal received, shutting down...
polybar|error: module/xworkspaces: Failed to reconnect socket (reason: Unexpected EOF while reading header)

Expected behavior

Polybar doesn't crash.

Actual behavior

Polybar either loses the xworkspaces module or just disappears and requires a restart.

Window Manager and Version

i3-gaps v4.20.1

Linux Distribution

EndeavourOS

Polybar version

polybar 3.6.3-45-g1ee11f7c

Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard

X extensions: +randr (+monitors) +composite +xkb +xrm +xcursor

Build type: Release
Compiler: /usr/sbin/c++
Compiler flags: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -O3 -DNDEBUG -Wall -Wextra -Wpedantic -Wsuggest-override
Linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wall -Wextra -Wpedantic -Wsuggest-override  -Wall -Wextra -Wpedantic -Wsuggest-override

Additional Context / Screenshots

i am stumped, i'll happen to look down where polybar usually is and realize either A: the xworkspaces module is missing, or B: the entire bar is just gone. It's taken about two weeks just to get it to happen again.

@ExperiBass ExperiBass changed the title [Bug]: [Bug]: xworkspaces: Failed to reconnect socket May 26, 2022
@ExperiBass
Copy link
Author

github removed the title...

@patrick96
Copy link
Member

In the log you posted, did polybar die or did the module disappear?

It looks like the former, in that case the i3 module is not responsible for it, there is something that sent signal 15 (SIGTERM) to your polybar instance and killed it. The error message in the i3 module is a side effect of shutting down (probably something we're doing wrong).

@ExperiBass
Copy link
Author

In the log you posted, did polybar die or did the module disappear?

It looks like the former, in that case the i3 module is not responsible for it, there is something that sent signal 15 (SIGTERM) to your polybar instance and killed it. The error message in the i3 module is a side effect of shutting down (probably something we're doing wrong).

Iirc the module disappeared, the sigterm is me killing it afterwards. Sometimes itll fix itself after telling the bar to restart, other times it just freezes and requires a kill.

@patrick96
Copy link
Member

I see.

Sometimes itll fix itself after telling the bar to restart, other times it just freezes and requires a kill.

So the bar freezes after you tell it to restart?


Could you run polybar with trace logging (polybar -l trace ...), this way I can see more clearly what is going on in the module when this happens again.

Attempting to reconnect socket (reason: Unexpected EOF while reading header)

This generally happens when polybar loses connection to the i3 socket. I have only seen this happen when reloading i3. Could it be that you were reloading i3 when this happened?

@ExperiBass
Copy link
Author

I see.

Sometimes itll fix itself after telling the bar to restart, other times it just freezes and requires a kill.

So the bar freezes after you tell it to restart?

Correct, it'll be fine until it tell it to restart, at which point it either freezes, restarts fine, or just gives up and dies.

Could you run polybar with trace logging (polybar -l trace ...), this way I can see more clearly what is going on in the module when this happens again.

Sure, it may take a couple days for the bug to trigger again but i'll get that for you.

Attempting to reconnect socket (reason: Unexpected EOF while reading header)

This generally happens when polybar loses connection to the i3 socket. I have only seen this happen when reloading i3. Could it be that you were reloading i3 when this happened?

Not at all, i rarely reload i3.

@patrick96
Copy link
Member

Correct, it'll be fine until it tell it to restart, at which point it either freezes, restarts fine, or just gives up and dies.

Alright, this indicates the i3 module is stuck reconnecting to the i3 socket. In general, the i3 module can't freeze the bar, except during shutdown because if it is stuck connecting to the socket, polybar needs to wait for it before it can shut down.

Sure, it may take a couple days for the bug to trigger again but i'll get that for you.

I unfortunately can't find anything in the code that could be responsible for this, so I do need more information to track this down. Of course, consistently reproducing the bug would be best, but that may not be possible here.

@ExperiBass
Copy link
Author

I unfortunately can't find anything in the code that could be responsible for this, so I do need more information to track this down. Of course, consistently reproducing the bug would be best, but that may not be possible here.

Yeah, I haven't been able to consistently reproduce it no matter what. I've added the logging line to my i3 config, now its just a waiting game...

@ExperiBass
Copy link
Author

wooo! got it to freeze!
looooooomg file

@ExperiBass
Copy link
Author

ayyyyy it crashed after i restarted it!
crashed

@ExperiBass
Copy link
Author

@patrick96 patrick96 changed the title [Bug]: xworkspaces: Failed to reconnect socket [Bug]: i3: Failed to reconnect socket Jul 9, 2022
@thexavier666
Copy link

I would also like to report this issue. Strangely, this started happening ever since I updated to Ubuntu 22.04.1 LTS from 20.04 LTS.

@CodingCellist
Copy link

I'm observing a similar issue on Arch after upgrading to i3-wm 4.22-2. However, my polybar doesn't crash completely, but instead stops updating the module (i.e. it highlights whichever workspace it was on when it lost the socket and then doesn't update it when I switch workspaces).

Log attached

@exic
Copy link

exic commented Jan 18, 2023

I think I'm seeing the same as @CodingCellist (but this is "Attempting to reconnect", not "Failed", should we open a new issue?), this is part of my log with -l trace:

polybar|trace: bar: Ignoring update (unchanged)
polybar|warn:  module/i3: Attempting to reconnect socket (reason: LargestInt out of UInt range)
polybar|info:  module/xwindow: Rebuilding cache
polybar|info:  Redrawing bar window
polybar|info:  module/i3: Reconnecting socket succeeded
polybar|trace: renderer: flush(1 geom=408x24+0+0, falloff=0)
polybar|trace: renderer: flush(2 geom=120x24+1153+0, falloff=0)
polybar|trace: renderer: flush(3 geom=398x24+2018+0, falloff=0)
polybar|info:  module/xwindow: Rebuilding cache
polybar|trace: bar: Ignoring update (unchanged)
polybar|warn:  module/i3: Attempting to reconnect socket (reason: LargestInt out of UInt range)
polybar|info:  module/xwindow: Rebuilding cache
polybar|info:  Redrawing bar window
polybar|info:  module/i3: Reconnecting socket succeeded
polybar|warn:  Dropping unmatched character 💻 (U+1f4bb) in '[...] 💻💰: Todoist'
polybar|warn:  Dropping unmatched character 💰 (U+1f4b0) in '[...] 💻💰: Todoist'
polybar|trace: renderer: flush(1 geom=408x24+0+0, falloff=0)
polybar|trace: renderer: flush(2 geom=112x24+1157+0, falloff=0)
polybar|trace: renderer: flush(3 geom=398x24+2018+0, falloff=0)
polybar|info:  module/xwindow: Rebuilding cache
polybar|info:  Redrawing bar window
polybar|trace: renderer: flush(1 geom=408x24+0+0, falloff=0)
polybar|trace: renderer: flush(2 geom=48x24+1189+0, falloff=0)
polybar|trace: renderer: flush(3 geom=398x24+2018+0, falloff=0)
polybar|info:  module/xwindow: Rebuilding cache
polybar|info:  Redrawing bar window
polybar|warn:  Dropping unmatched character 💻 (U+1f4bb) in '[...] 💻💰: Todoist'
polybar|warn:  Dropping unmatched character 💰 (U+1f4b0) in '[...] 💻💰: Todoist'
polybar|trace: renderer: flush(1 geom=408x24+0+0, falloff=0)
polybar|trace: renderer: flush(2 geom=112x24+1157+0, falloff=0)
polybar|trace: renderer: flush(3 geom=398x24+2018+0, falloff=0)
polybar|warn:  module/i3: Attempting to reconnect socket (reason: LargestInt out of UInt range)

Somehow seems to be related to my Todoist window, if I move it to scratchpad (=invisible), the issue is gone.

Edit: I take that back, I had it with terminal windows as well and it resolved after moving them around a bit.. 🤔

@CNote1
Copy link

CNote1 commented Jan 24, 2023

I'm observing a similar issue on Arch after upgrading to i3-wm 4.22-2. However, my polybar doesn't crash completely, but instead stops updating the module (i.e. it highlights whichever workspace it was on when it lost the socket and then doesn't update it when I switch workspaces).

Log attached

That's exactly what happened to me after upgrading i3 to 4.22-3 version

@ThomasBoom89
Copy link

I can confirm this too.
Status update only happens if I access a new workspace.
Click on workspace works fine but throws the warning.

polybar version: 3.6.3
i3 version: 4.22

warn: module/i3: Attempting to reconnect socket (reason: LargesInt out of UInt range)
* module/i3: Reconnecting socket succeeded

@ThomasBoom89
Copy link

So, bug seems to be fixed in some commit after release 3.6.3
On arch linux I used the AUR polybar-git package. This will build polybar 3.6.3-87-gfc423c09. The error will then disapppear.
@patrick96 maybe you can make a new release? The current one is 9 month old.

@MobulaKuhlii
Copy link

MobulaKuhlii commented Feb 7, 2023

The issue ints was resolved with this commit, however I'm still occasionally getting (same as in original log)
warn: module/i3: Attempting to reconnect socket (reason: Unexpected EOF while reading header), which requires bar's restart

@anoduck
Copy link

anoduck commented Apr 13, 2023

All of the above listed issues sound all too familiar to my issue #2942 and the discussion for it #2941. More than likely it is the same error.

My current polybar implementation came from the distribution package manager. So, I will remove it, and build from src in the repo to see if this clears up the issue. I sincerely hope it does.


Nope. Error on build. polybar/lib/xpp does not contain a CMakeLists.txt file.

But the ports tree contains 3.6.3 so that is ok...


AND... It made no difference. i3 Module is still crashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants