cmd.exe and conhost.exe processes opened by Hass.Agent never close
Aplogies in advance, because I don't have much information to diagnose te issue, but I noticed i have lots and lots of cmd.exe and conhost.exe processes active in my process list. In trying to figure out what caused this I ended all the active processes, left hass agent closed for a few hours, and none of the processes in question were ever opening. Within a few minutes of opening hass.agent they beginning appearing again, slowly over time.
I suspect this might have something to do with sensors or commands that I have active but im not sure how to better diagnose the issue. I've attached 2 screenshots showing my sensors and my commands.
22 Replies
these are just some of a large number of processes that i just killed
I guess the Custom ones runs some scripts, just the same as the Powershell does?
yeah ill share what they are
RUNDLL32.EXE powrprof.dll,SetSuspendState 0,1,0
schtasks /Run /TN "High Priority Genshin"
that's insteresting
im not rly sure how to better diagnose this problem, (without going through and disabling all my sensors and checking them 1 by 1) all i can confirm is that it's linked to hass.agent being open
all of those are with this command?
im not sure what command or what is causing it other than its hass.agent. it's certainly not those commands alone if its them at all. i was hoping there was a way to diagnose it without disabling all my commands/sensors
I'll try to replicate but I need to know if I need to test only this rundll32 one or more
Anyone having issues with those processes using 40+ gigs of RAM?
sorry im not sure what youre asking 😅 i can disable them and see if i can pinpoint what causes the issue or if its all of them if thats helpful
actually its not possible to disable sensors without removing them
so im not rly sure how to test this
i did disable mqtt and as soon as i reenabled it i got a bunch of processes so its definitely smth with sensors or commands
ok i did actually narrow it down to a few commands that are definitely some of the culprits. the ones i all pinpointed were custom commands that are task scheduler commands. notably, the commands' statuses in task schedule are "ready" rather than "running" but the cmd.exe and conhost.exe commands are still running
basically I need your sensor/command configuration to test on my side and figure out what is the issue 😄
is there a file you want me to send and/or list one of the seemingly problematic commands?
in the HASS.Agent UI go to the settings and then in the "Logging" section there is a "Open logs folder" button, press it, go one folder "up" and then into "config" folder, in there you'll see two files "sensors.json" and "commands.json", copy them to the desktop, open with notepad/notepad++, check if there is no sensitive info
if yes, scrub it and put the files here, if not just put them here 😄
I need to implement a "generate log and config package" function 😄
theres safe to send, here ya go
@Ellie Can you post how you set up the tasks in the task scheduler as well? If it's a batch script it may not exit properly due to reasons outside hass.agent
It may be a good idea to set the task to stop automatically after some time too in the task scheduler
I can send them in 12ish hrs, but I checked tack scheduler prior and I can confirm that, at least according to task scheduler, the tasks executed successfully and then stopped
have you set it up like so?
ah the timeout does not apply if the task was run manually anyway
I'll take a sshot of how I have it set up there too when I can
its uh not in english but heres what one of them looks like
the files are just 1-2 lines each
Got it, I'll take a look and try to replicate the behaviour on my end.