Repository navigation
Closed
Labels
bugSomething isn't workingpotentially-fixedA potential fix has been posted, but needs external verification before being merged.
Description
Hi, and thank you for your work on this project.
Stackline crashes repeatedly on my Yabai setup when working with stacks, giving me this error log:
2020-10-23 21:42:28: 21:42:28 ERROR: LuaSkin: hs.timer callback error: ...rs/RNO/.hammerspoon/stackline/stackline/stackmanager.lua:66: attempt to index a nil value (field 'integer index')
stack traceback:
...rs/RNO/.hammerspoon/stackline/stackline/stackmanager.lua:66: in local 'fn'
...on.app/Contents/Resources/extensions/hs/fnutils/init.lua:57: in function 'hs.fnutils.map'
...rs/RNO/.hammerspoon/stackline/stackline/stackmanager.lua:64: in function 'stackline.stackline.stackmanager.getSummary'
/Users/RNO/.hammerspoon/stackline/stackline/query.lua:129: in function 'stackline.stackline.query.windowsCurrentSpace'
...rs/RNO/.hammerspoon/stackline/stackline/stackmanager.lua:14: in function 'stackline.stackline.stackmanager.update'
/Users/RNO/.hammerspoon/stackline/stackline/stackline.lua:42: in function </Users/RNO/.hammerspoon/stackline/stackline/stackline.lua:41>
I am running on Stackline on macOS 10.14.6 (18G6032).
Latest commit on my local repo is c93a0bd so I am currently up-to-date.
Sorry for not being more precise on the title of this issue, I'm quite new to Yabai, Hammerspoon and Stackline (in fact it is thanks to your project that I'm trying Yabai).
Reacted by Jerred Shepherd, Toly, Kent and Junichi Sugiura
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingpotentially-fixedA potential fix has been posted, but needs external verification before being merged.
Activity
kerryj89 commentedon Nov 7, 2020
Same here.
AdamWagner commentedon Nov 7, 2020
Well, that's no good.
Thanks for the report + corroboration @arnaudjuracek & @kerryj89.
Unfortunately, I don't experience that error, even when using stackline for long periods. I can see that the error is caused by attempting to index a null list of
windowsin thegetSummary()method… butwindowsshould never be null there.I could just wrap these operations in the lua version of
try/catch, but I don't think that would actually solve the problem, but just move it up a level, since the update method requires a summary of the current state.I'm sorry for pulling out the "need more info" card… but unfortunately, I do :-)
Can you share a little more detail about "…repeatedly…"?
Do you experience the crash + error message:
My guess is that the error occurs after some set of the focus/resize/add/remove window events above. It would be helpful but not crucial to know exactly which actions cause the error.
arnaudjuracek commentedon Nov 7, 2020
Thanks for your response.
Note that as Stackline was pretty much always crashed on my config when needed, I gained the habit of not using it at all, and I am now using Yabai's stacks without Stackline.
That being said, here are more informations:
Nope, always pretty much the same.
To be honest I was quite embarrassed to open this issue without being able to provide much more informations, but the fact is that I have absolutely no clue on what causes the crashes. They seemed pretty random to me, and at least I can say that I did not identify a specific setup or series of actions to reproduce the crash.
My usual opened apps are :
Managed by yabai
Unmanaged by yabai
I also have a bunch of menubar apps hidden via Bartender, but I do not know if this can be related to our problem.
Unfortunately I did not use Stackline enough to give you much more informations… but @kerryj89 may be more helpful.
Cheers.
kerryj89 commentedon Nov 8, 2020
@AdamWagner Upon reloading config in Hammerspoon I get the attached error (eventually I get the same "nil value" messages also). Posting it here since OP is no longer using this tool. Do you have any ideas what it could be? FYI I followed the instructions on https://github.com/AdamWagner/stackline yesterday.
Hammerspoon 0.9.81
Yabai 3.3.0 with latest scripting additions
OSX Catalina 10.15.7
What Hammerspoon version are you on?
The stacking indicators work but clicking on them does not change them for me even though the config says the "clickToFocus" is enabled. I think the erroring is maybe preventing that function. Any help is appreciated - thanks!
badrbouslikhin commentedon Nov 26, 2020
Same here. I ended up in the same situation as @arnaudjuracek.
AdamWagner commentedon Nov 28, 2020
@arnaudjuracek Thanks for reporting the issue anyway, and following up with more detail! Clearly others are running into the same problem, so I need to figure out what's going on here.
The last three weekends I've been pretty heads-down working on writing Hammerspoon mocks and tests for Stackline. Today I'm going to just focus on trying to reproducing this crash and then writing a test for it 👍
AdamWagner commentedon Nov 28, 2020
@kerryj89
Interesting! The
local port name already in useerror is probably different, but may be useful clue if it always results in thenil valueerror. Thanks!@MrZeroo00 and @arnaudjuracek – I totally understand why you would stop using use a tool that consistently crashes. I'm sorry that stackline hasn't worked out for you. It I'll Update this thread if I identify / resolve the issue.
Add debug info to Stackmanager:getSummary() to investigate #46
Add debug info to Stackmanager:getSummary() to investigate #46
AdamWagner commentedon Nov 28, 2020
@kerryj89 Some good news, I think:
I was able to reproduce
2020-11-07 21:46:28: *** ERROR: configManager.lua:135: local port name already in useby callingstackline:init()when it had already been initialized. My guess is thatstackline:init()is being called twice. Note that this should only be called once from your~/.hammerspoon/init.luafile. If you find a call tostackline:init()from within the stackline module itself, then you're running an old version ;-)I'm now guarding against this in the init method:
Also, I've added debug info to
Stackmanager:getSummary()that should help shed light on the bug originally reported in this thread.You can see the changes here: https://github.com/AdamWagner/stackline/blob/fix/nil-windows-in-get-summary/stackline/stackmanager.lua#L64
So, if you're willing to pull down the branch with these changes (https://github.com/AdamWagner/stackline/tree/fix/nil-windows-in-get-summary), then we should see:
local port name already in usecrash should be fixed (this should also fix the problems with clicking indicators to focus the window)getSummary(), we'll have extra debug info to show the way!BTW, thanks for sharing your system specs. I'm using:
Hammerspoon 0.9.82 (though I just upgraded today and was running 0.9.8.1 before that)
yabai-v3.3.4 (I'm running HEAD. I would be surprised if this was a factor)
OSX Catalina 10.15.7
kerryj89 commentedon Nov 29, 2020
Hi Adam,
I deleted
~/.hammerspoonand rangit clone -b fix/nil-windows-in-get-summary https://github.com/AdamWagner/stackline.git ~/.hammerspoon/stacklineand followed the setup instructions carefully again.It loads up but the icons do not follow the stacked windows and are not clickable. My hammerspoon announces this:
Thanks for trying to fix the issue!
Merge branch 'fix/nil-windows-in-get-summary' of https://github.com/A…
antoniom13 commentedon Dec 31, 2020
Thank for maintaining this and trying to get this solved. I'm on the same boat as @kerryj89.
These are the current versions running:
hammerspoonVersion 0.9.82 (5614)yabaiv3.3.6stacklinemaster on 8c1533eIn order to replicate:
The following error is thrown as soon as yabai starts:
shepherdjerred commentedon Jan 10, 2021
I'm also seeing this issue on two machines, an Intel MacBook and an M1 Mac, both on Big Sur.
hammerspoon: 0.9.82 (5614)
yabai: v3.3.6
stackline: 8c1533e
ninjalu commentedon Jan 3, 2022
Could you possibly provide instructions for how to use Yabai's stacks without Stackline? I haven't been able to do that reading on docs and repos.. :(.. Many thanks!
Remove jq dependency. Remove shell script to call yabai. Remove lib.j…