2.0.1 crashes when switching virtual desktops
Running 2.0.1, checking the windows event log I'm seeing evt 1000
File
logs\[2024-01-01] HASS.Agent_20240101.log
covers the time range where the most recent fault happened but has no mention of the error.Solution:Jump to solution
@luma @Findel please check this version ๐
https://github.com/hass-agent/HASS.Agent/releases/tag/2.0.2-beta2...
GitHub
Release 2.0.2-beta2 ยท hass-agent/HASS.Agent
Changes
This version attempts to fix HASS.Agent crash when virtual desktops are switched.
Probable root cause was bug in the management library HASS.Agent uses, this version bumps the dependency ve...
44 Replies
OK I think I figured out what's causing this: switching virtual desktops. I had enabled that sensor because I use vdesktops pretty regularly. I just now noticed that when I launch HASS.Agent.exe and then switch desktops, the cursor has a waiting animation for about 5 seconds and the system tray icon goes unresponsive. A few seconds after that the icon goes away because the process has crashed.
So I've gone and disabled the vdesktop sensor and... same result. Any time I change desktops HASS.Agent crashes.
Found enable extended logging. One thing I note is that virtual desktop support is being loaded per the logs despite me not having the virtual desktop sensor loaded. Not sure if that's normal or not. I also note that there is a Windows event 1001 that always follows event 1000:
I don't know how i missed this, was before bot so I wasn't pinged.
Is this still an issue? I assume so considering 2.0.1 is the newest non-beta
I've also missed that, sorry.
Due to m$ shenanigans there is no official API to change/manage virtual desktops hence we're using a ln opensource library for this.
This however comes with a caveat - m$ can change whatever they want whenever they want and the library beeds to catch up.
As per the message regarding vd support even when no sensor is confugured - all managers are initialized on start, they just provide functions for the sensors/commands.
What windows version (including build numer) are you using?
Win 11 Enterprise Version 23H2 OS Build 22631.3007
I think I might be having this issue also.
Windows 11 Home - 22621.3007
I upgraded yesterday from the old LAB02 version, and the application doesn't appear to stay active. I make heavy use of virtual desktops, so that makes sense.
The program definately crashes when switching between desktops.
I've turned on extended logging, but there's nothing added to the log on crash.
Did it work on the lab02 version?
Yes
Never had this issue with that version
From windows event logs:
Okay, seems weird that the library had to be updated if it still worked. This kind of thing is not my domain ๐
Have to see what @Amadeo says.
What I can say is that Amadeo is very quick with a fix ๐ once we know what needs to happen he'll usually have it ready by the next day.
Original version never had virtual desktop management
Ohh ๐ I see, so it "worked" but had no features
Yeah
Damn, is there a possibility for this to become opt-in to prevent issues like this?
What does the "virtual desktop management" feature include? It's not something I needed, but maybe it needs some configuration?
It provides current vd sensor and command to change the active vd
This is log when initialising the program.
Sorry, just so we're clear on this ๐ very stupid question. A VD is the win + D or something right?
The thing with ctrl windows left right or whatever?
I'll jump into the code after work and check if it can be done retroactively (just handle possible errors) or proactively (allow to explicitly enable/disable this feature and be prone to m$ updates)
Looks like it's erroring when loading your VIRTDESKT
@DrR0x These are virtual desktops
Yeah thought so, just checking ๐ rarely used them on windows 10
Just alt+tabbed a lot
I use them on Win 10 PC also, so useful
The mgmt lib loading has a check for issues - if it cannot load properly it should log this but you've mentioned there is no mention of this in the logs
It's not logging an error on crash, but it is logging these errors on start up
I sort of didn't like the idea for the same reason I ditched tab management in opera browser and stuff like that.
I could use something like this to organise apps/tabs but really, I should just not have that many open ๐ it ruins performance anyway.
I can see how it could be nice if you only have 1 monitor tho.
@Amadeo I started the program with elevated permissions to see if
Access to path
error occured.
It didn't.
However, the program still crashed when I switched between virtual desktops.
So those start up errors are due to non-Administrator permissions, but not the cause of the crash later on.
Hope that helps.Oh yes
It does
Thank you
When I tested in on the vms I have it was only
vdm initializes and works vdm fails to initialize end of storyThis itke it initializes and then crashes, new scenario I'll try to work around it and if not this will be an opt in feature Thanks for the info ๐
Happy to help. I'd love to dig into the code myself, but no time currently
I'll note that virtual desktops are really handy if you have 3 monitors too ๐ it's a nice way to separate different tasks, I have a vdesktop for work stuff, for home stuff, for dev stuff, and for cad stuff. Being able to know which one is active would be crazy useful for me as I have different things I do and use when each desktop is active. Looking forward to this feature!
this might be easier than I thought
^ this is the vd mgmt lib that we're using
one bundled with 2.x.x is 6.2.1 released 4 months ago, this fix was merged in november
should be as easy as bumping the dep
Sounds great. I'll jump on the beta when it's available as I just can't use hassagent as it is.
Absolutely agree. I have two monitors (one ultrawide and one standard) and I use VD a lot. I don't have a lot of apps open (not enough to cause a performance issue) but it's so helpful to split up different tasks etc. I'm interested in knowing what sort of automations you are thinking of using to "know which one is active" though?
One of my VDs is for media (flip over to a desktop for some youtubes while I wait for something at work) and it'd be nice to control audio sources and dim lights in response. When on work VD, turn off the lights in my workshop behind me so that when I jump on a Teams call it isn't super obvious that I've just been standing at my bench wrenching on shit instead of working, things like that ๐
What VD I have active at any given moment is a good proxy for what mode of work i'm engaged in.
interesting
how often do you turn off your computer?
thinking about requirement to open all the windows/programs each time on those VDs ๐
every other week or so.
helps that i have 128GB DDR5 and a 13900k ๐
gib that ram
Solution
@luma @Findel please check this version ๐
https://github.com/hass-agent/HASS.Agent/releases/tag/2.0.2-beta2
GitHub
Release 2.0.2-beta2 ยท hass-agent/HASS.Agent
Changes
This version attempts to fix HASS.Agent crash when virtual desktops are switched.
Probable root cause was bug in the management library HASS.Agent uses, this version bumps the dependency ve...
@Amadeo my man! works a treat. no more crashes when desktop sensor is not enabled and i switch vdesktops, then enabling the sensor it's correctly updating the desk UUID on switch (and still not crashing). everything working like i'd expect it to, and man what a fast turnaround. thanks!
nice ๐
Seems good to me! No more crashes.
Installer still said 2.0.1, so probably needs a version bump somewhere.
Great work on a quick fix though @Amadeo - ๐
ya, will change that before normal release, thanks for reminding tho ๐
Told you he was quick ๐
Interesting about the VDs, I could see how activating my cad one could turn on my 3d printer and octoprint server. Might have to look into that. The biggest issue is the fact that o restart an average of 5 times a day ๐ so I am re-opening apps every single time.