Ever since updating to 2.4.0, I have been noticing a lot more jobs failing with the following:
# This job produced no output
If I try running them manually with the PS 5 env, it will fail. If I switch to the integrated env, it will go through just fine. Curious what I am missing?
If this is fixed in a later update, our enterprise license just expired and waiting to see if I can get them to renew it. I know the product will still work, but I believe we cannot install any updates.
I would check the log (C:\ProgramData\PowerSHellUniversal) to see why they are failing. I’d have to look through the changelog to see if there were any changes related to v5 between 2.4 and 2.5.4 but there is a chance something was fixed.
One thing I would suggest would be to run this in a terminal and see if any errors are shown. Sometimes, there can be assembly load errors that prevent jobs from running. Those are certainly resolved in later versions since I haven’t seen any issue running jobs in WinPS in recent versions. Give it a try and let me know what the output is.
Ok. It looks like it’s loading the assemblies properly. The next thing I would try would be to increase the job time out. In appsettings.json, you can do this by setting JobHandshakeTimeout
JobDebugging also might be also be helpful as it will write additional logs about the startup process for jobs. It writes them to the TEMP directory as PSU.*.txt
So I changed the timeout to 15 and set JobDebugging to true. I restarted the service, that seemed to fix everything. However, something funky is still up. 1) I do not see any logs being created in %TEMP% and 2) I watched the schedule a job showed up saying it was manually triggered by me, but I did not trigger anything and it keeps coming back every four minutes.
I don’t think I am logged in somewhere else, is there a way to log out or see who is logged in currently?
Here is what I grabbed from hangfire:
// Job ID: 8bff22eb-a2e8-44bb-bf31-676b7a644f85
using UniversalAutomation;
var executionService = Activate<ExecutionService>();
await executionService.Execute(
FromJson<Job>("{\"Id\":820353,\"CreatedTime\":\"2021-11-23T17:05:50.5878388Z\",\"ScriptFullPath\":\"FTERedefine.ps1\",\"AppToken\":{\"Id\":256811,\"Token\":\"aTOKENHERE\",\"Identity\":{\"Id\":1},\"Role\":\"Execute\",\"Created\":\"2021-07-15T18:35:45.362-04:00\",\"Expiration\":\"2022-07-15T18:35:00-04:00\",\"CreatedBy\":{\"Id\":1}},\"Identity\":{\"Id\":1,\"Name\":\"myUserName\",\"RoleName\":\"Administrator\"},\"Environment\":\"Integrated\",\"Computer\":{\"Id\":1,\"Name\":\"SERVER\"}}"),
null);
This is what showed up in the schedule:
820356 FTERedefine.ps1 success run manually by myUsername in the Integrated environment
4 minutes ago
31s
Edit: I realize that I have an AppToken checked out that techs can kick off a script from a dashboard, however, no one was in the dashboard. Is it possible these were queued up? The script requires parameters and parameters were passed to it. Also, we were unable to revoke any AppTokens from the GUI.
The TEMP dir might depend on which user is running the PSU service. We use [IO.Path]::GetTempPath() to look up the temp path.
As for the jobs started as you, you may want to look in the recurring job tab in hangfire to see what is listed there. What kind of schedule is this? Continuous or standard CRON?