Scripts Failing - No Reason or Failure Message

@Support
All jobs (Manually or Scheduled) are failing. No error messages are showing anything and they are failing in about two seconds after starting, so it is not a timeout issue.

Product: PowerShell Universal
Version: 2.1.2

Can you please check in the logs in %ProgramData%\PowerShellUniversal? It should have more information.

@Adam - Thank you for your quick reply. I did notice these weird entries:

2021-07-09T09:27:30.0250781-04:00 0HMA1H4SLB26T:00000045 [INF] CORS policy execution failed. (09b6f179)
2021-07-09T09:27:30.0250953-04:00 0HMA1H4SLB26T:00000045 [INF] Request origin "http://server:5000" does not have permission to access the resource. (a03d560b)
2021-07-09T09:27:35.1444226-04:00 0HMA1H4SLB26T:00000047 [INF] Request finished HTTP/1.1 GET http://server:5000/api/internal/session/227542a4-b4a4-4e43-bf2c-44c3e2bf98c1 - - - 200 0 - 2.9926ms (791a596a)
2021-07-09T09:27:36.9024892-04:00  [INF] Error executing job 294575: Did not receive port from client process.    at UniversalAutomation.Services.GrpcExecutionService.ExecuteScript(Job job, ExecutionEnvironment environment, executeScriptRequest request, ExecutionCallback executionCallback) in D:\a\universal\universal\src\UniversalAutomation\Services\Automation\GrpcExecutionService.cs:line 103
   at UniversalAutomation.ExecutionService.ExecutePowerShell(Script script, IEnumerable`1 parameters, Job job, Schedule schedule, ExecutionCallback callback) in D:\a\universal\universal\src\UniversalAutomation\Services\Automation\ExecutionService.cs:line 574
   at UniversalAutomation.ExecutionService.TryExecute(Job job, Schedule schedule) in D:\a\universal\universal\src\UniversalAutomation\Services\Automation\ExecutionService.cs:line 311
   at UniversalAutomation.ExecutionService.Execute(Job job, Schedule schedule) in D:\a\universal\universal\src\UniversalAutomation\Services\Automation\ExecutionService.cs:line 215 System.Exception (4b564540)

Edit: Upgraded yesterday to 2.1.2.

We have some settings in appsettings.json to diagnosis this type of error.

You can enable job debugging in the section below.

"UniversalAutomation": {
    "JobHandshakeTimeout": 5,
    "JobDebugging": true,
    "ContinueJobOnServerStop": false
  },

This will create log files in the %temp% directory that come directly from the job process.

1 Like

I will keep an eye on this @adam - It looks like after restarting the service it is working. It is definitely weird, the box is pretty packed with resources (32gb with quad core server on Win2k19 Server), so I don’t think it ran out of resources. Should I keep debug on or only turn debug on when I see the next failure.

I am seeing the exact same error after upgrading to 2.1.2 yesterday as well. None of my scripts, scheduled or not, are coming up with like @Mike27.

I am running through IIS, restarting the apppool and site do not resolve at this time.

Can you please try the job logging to see if anything is reported?

Here is an output of when I executed the script.

Interesting. I actually don’t see any errors in that log. Do you notice this error elsewhere in the log?

2021-07-09T09:27:36.9024892-04:00  [INF] Error executing job 294575: Did not receive port from client process.    at UniversalAutomation.Services.GrpcExecutionService.ExecuteScript(Job job, ExecutionEnvironment environment, executeScriptRequest request, ExecutionCallback executionCallback) in D:\a\universal\universal\src\UniversalAutomation\Services\Automation\GrpcExecutionService.cs:line 103
   at UniversalAutomation.ExecutionService.ExecutePowerShell(Script script, IEnumerable`1 parameters, Job job, Schedule schedule, ExecutionCallback callback) in D:\a\universal\universal\src\UniversalAutomation\Services\Automation\ExecutionService.cs:line 574
   at UniversalAutomation.ExecutionService.TryExecute(Job job, Schedule schedule) in D:\a\universal\universal\src\UniversalAutomation\Services\Automation\ExecutionService.cs:line 311
   at UniversalAutomation.ExecutionService.Execute(Job job, Schedule schedule) in D:\a\universal\universal\src\UniversalAutomation\Services\Automation\ExecutionService.cs:line 215 System.Exception (4b564540)

same error right here after upgrading to 2.1.2

Waiting for job data…

Can you look in the log to see if it’s the same error?

I do not have an error like that in my log.

Could you please enable job debugging and see if there are any logs generated in the temp directory?

"UniversalAutomation": {
    "JobHandshakeTimeout": 5,
    "JobDebugging": true,
    "ContinueJobOnServerStop": false
  },