Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


wam
  •  wam
  • Paid support Topic Starter
2018-02-01T01:00:53Z
While the "FAQ - troubleshooting" forum has a special page on "No such file exists / file not found / access is denied" (https://www.visualcron.com/forum.aspx?g=posts&t=5376), some of the advice does not make a ton of sense to us:

1. Why does it make sense to "Please make sure you have 'Load Profile and Local Login' option checked in the Credential." Loading the Profile will increase memory used by the Desktop's Workstation, and if the Desktop's Workstation runs out of memory, then "Access is denied" errors can occur.

2. We started moving away from "Load Profile and Local Login", and also away from "LOGON32_LOGON_NEW_CREDENTIAL" (to "LOGON32_LOGON_BATCH" with Local Security Policy of "Log on as batch" matching the account credentials of the Task). The reason we did this was because of a Microsoft troubleshooting article that pointed out Desktops and Workstations can run out of heap space: https://blogs.technet.mi...ps-and-windows-stations/  : "If the desktop heap becomes depleted, you will get symptoms such as a corrupt display or other anomalies. Also, if the Session View Space becomes depleted, it will not be able to create more desktop heaps. Either of these of course is very bad. This is partially why you can still get Out Of Memory errors even on a machine with a lot of free RAM."

3. We have 241 jobs, with 385 tasks

4. We don't understand why these messages bubble up to the VisualCron client. Further, it doesn't seem to bubble up to all users logged into the server through the VisualCron client. Please help explain this...

Additional Troubleshooting Details
Operating System
Microsoft Windows Server 2016 DataCenter
Service Pack: <blank>
Architecture: 64-bit

Processor
Name: Intel Xeon CPU E5-2686 @ 2.30 GHz
Speed: 2300 MHz
Processors: 1
Logical processors: 2

Service
Version 8.2.8
Protocol version: 7.6.5

VisualCron Service
Running as: SYSTEM
Listening port: 16444

Sponsor
Forum information
Support
2018-02-01T10:41:53Z
I think the FAQ in this case might be old but more important, not relevant to all errors reporting "Access denied".

Please explain what Task type you are talking about and if you use an AD user or not. And what settings you use at the moment in the Credential.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
wam
  •  wam
  • Paid support Topic Starter
2018-02-01T16:43:59Z
Originally Posted by: Support 

I think the FAQ in this case might be old but more important, not relevant to all errors reporting "Access denied".



Agreed. Just trying to demonstrate I'm looking to be a good customer and try to solve the problem ourselves before reaching out to support. It would be helpful if we could get an explanation of what each option on the Credential set-up screen does. The old documentation at https://www.visualcron.c...doc/html/credentials.htm  seems to be for an older version of VisualCron, as it seems the new UI pretty much directly exposes the underlying Win32 API calls. The old documentation does contain some practical wisdom that I would like to see carried forward, though - such as why loading profiles can be bad. It might also help to add my link to the Windows Performance Team blog about Desktops and Workstations.

Originally Posted by: Support 


Please explain what Task type you are talking about and if you use an AD user or not. And what settings you use at the moment in the Credential.



We're using almost exclusively the Execute Task Type. We have a few FTP jobs left, one SQL job, and that is it - so over 95% of jobs are all one or more Execute Tasks.

VisualCron service runs as LOCAL SYSTEM (as previously mentioned).

Tasks run as a AD user account, and every task is set-up with the same AD user account. The task's AD user account is added to the Local Security Policy "Log on as batch job" on the OS running Visual Cron Server.

Here is a dump of our two settings
RunAs DesktopPath DuplicateToken LoadProfile LocalLogin ExecuteAPI InitOpenDesktop OverrideLogonTypeAndProvider LogonProvider LogonType
DOMAIN\TaskService WinSta0\Default TRUE FALSE FALSE API TRUE FALSE LOGON32_PROVIDER_DEFAULT LOGON32_LOGON_BATCH
DOMAIN\TaskService WinSta0\Default TRUE TRUE TRUE API TRUE FALSE LOGON32_PROVIDER_DEFAULT LOGON32_LOGON_NEW_CREDENTIALS

Here is an example log of when the error happens:

1/23/2018 10:51:26 AM Debug Calling StartTaskProcess() with Task: Test_Task_1(1983380)
1/23/2018 10:51:26 AM Info Task started(Execute): Test_Task_1(1983380)
1/23/2018 10:51:26 AM Debug ptrDesktop: 188
1/23/2018 10:51:26 AM Debug ptrWindowStation: 184
1/23/2018 10:51:26 AM Debug Process status - has left WaitForExit (1983379)
1/23/2018 10:51:26 AM Debug StartBackgroundProcess->Getting output (API)
1/23/2018 10:51:26 AM Debug ProcessTaskExecuteClass->CloseOutputHandle: d:\VisualCRON\Temp\2294c181-f96c-443c-804b-273c7bd8e642
1/23/2018 10:51:26 AM Debug ProcessTaskExecuteClass->CloseOutputHandle: d:\VisualCRON\Temp\13283d26-daf1-4077-9212-e00df2f950b0
1/23/2018 10:51:26 AM Debug StartBackgroundProcess->OutPut captured (1983379)
1/23/2018 10:51:26 AM Debug Process status - trying to retrieve exit code
1/23/2018 10:51:26 AM Debug Process status - ExitCode fetched (1983379)
1/23/2018 10:51:26 AM Debug Process status - ProcessHandles closed (1983379)
1/23/2018 10:51:26 AM Debug ProcessTaskExecuteClass->CloseOutputHandle: d:\VisualCRON\Temp\2294c181-f96c-443c-804b-273c7bd8e642
1/23/2018 10:51:26 AM Debug ProcessTaskExecuteClass->CloseOutputHandle: d:\VisualCRON\Temp\13283d26-daf1-4077-9212-e00df2f950b0
1/23/2018 10:51:26 AM Debug ProcessTaskExecuteClass->CloseOutputHandle: d:\VisualCRON\Temp\d19bf33f-052d-4d94-be4c-e0620253e24e
1/23/2018 10:51:26 AM Debug Ending timeout timer (1983379)
1/23/2018 10:51:26 AM Debug Ending output readers (1983379)
1/23/2018 10:51:26 AM Debug Closing desktop handles (1983379)
1/23/2018 10:51:26 AM Debug Process status - About to raise TaskCompleted (1983379)
1/23/2018 10:51:26 AM Info Task completed (Success)->'Test_Task_2' (1983379)
1/23/2018 10:51:26 AM Debug PrevTaskProcess(Test_Task_2)->ExitCodeResult: Success (ECCId: 746c95ce-d394-491c-925c-8bd50e4daa8ePId: 1983379, Exit code: 0)
1/23/2018 10:51:26 AM Debug Found 1 matching flows. (1983379)
1/23/2018 10:51:26 AM Debug Calling GetNextTaskProcess()
1/23/2018 10:51:26 AM Debug Next execution (2) for Job 'Test_Task_3' is: 1/23/2018 10:51:55 AM
1/23/2018 10:51:26 AM Debug SendJobStats->Ended (1/23/2018 10:51:25 AM)
1/23/2018 10:51:26 AM Info Job completed (Success)->'Test_Task_3'
1/23/2018 10:51:26 AM Debug CreateProcessWithLogonW returned: False
1/23/2018 10:51:26 AM Err Unable to start process: Access is denied
1/23/2018 10:51:26 AM Debug Process status - process is nothing
1/23/2018 10:51:26 AM Debug Process status - trying to retrieve exit code
1/23/2018 10:51:26 AM Debug Process status - ExitCode fetched (1983380)
1/23/2018 10:51:26 AM Debug Process status - ProcessHandles closed (1983380)
1/23/2018 10:51:26 AM Debug ProcessTaskExecuteClass->CloseOutputHandle: d:\VisualCRON\Temp\01793b9d-5832-4947-8d4f-9e1563c0b0d7
1/23/2018 10:51:26 AM Debug ProcessTaskExecuteClass->CloseOutputHandle: d:\VisualCRON\Temp\ad2208a3-0aba-487e-aac6-88cdb70715ee
1/23/2018 10:51:26 AM Debug ProcessTaskExecuteClass->CloseOutputHandle: d:\VisualCRON\Temp\dfc08b31-9385-41b4-9151-89abd54a1cf3
1/23/2018 10:51:26 AM Debug Ending timeout timer (1983380)
1/23/2018 10:51:26 AM Debug Ending output readers (1983380)
1/23/2018 10:51:26 AM Debug Closing desktop handles (1983380)
1/23/2018 10:51:26 AM Debug Process status - About to raise TaskCompleted (1983380)
1/23/2018 10:51:26 AM Info Task completed (Failure)->'Test_Task_1' (1983380)
1/23/2018 10:51:26 AM Debug PrevTaskProcess(Test_Task_1)->ExitCodeResult: Failure (ECCId: 746c95ce-d394-491c-925c-8bd50e4daa8ePId: 1983380, Exit code: 5)
1/23/2018 10:51:26 AM Debug Found 1 matching flows. (1983380)
1/23/2018 10:51:26 AM Info Task Notification of type: Email started.
1/23/2018 10:51:26 AM Info Task started(Email): General Job Error Email Notification (1983381)
1/23/2018 10:51:26 AM Debug Next execution (2) for Job 'Test_Task_1 TFOP' is: 1/23/2018 10:53:26 AM
1/23/2018 10:51:26 AM Debug SendJobStats->Ended (1/23/2018 10:51:26 AM)
1/23/2018 10:51:26 AM Err Job completed (Failure)->'Test_Task_1 TFOP'
1/23/2018 10:51:27 AM Info Task Notification completed (Success)->'General Job Error Email Notification' (1983381)
1/23/2018 10:51:27 AM Debug RemoveTaskProcess-> Could not find TaskProcess (1983381) Task: General Job Error Email Notification
wam
  •  wam
  • Paid support Topic Starter
2018-02-01T18:12:37Z
One other comment: After digging further in the forums, I found this thread https://www.visualcron.c....aspx?g=posts&t=7423  which mentions a breaking change in 8.2.7. Whether VisualCron calls it a breaking change or not, changing the default for new credentials to me suggests a latent best practice. Curious why this is the new default, and wondering if that could help here? I'm not a Win32 API expert and learning on the fly.
Support
2018-02-01T18:34:51Z
This is a really big subject. Before digging deeper I wonder if you get the same error if you create a local Administrator instead of using AD. At least we can rule out some things then.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
wam
  •  wam
  • Paid support Topic Starter
2018-02-01T21:18:02Z
Originally Posted by: Support 

This is a really big subject. Before digging deeper I wonder if you get the same error if you create a local Administrator instead of using AD. At least we can rule out some things then.



Unfortunately, we're not able to do that because the permissions are set-up to use domain accounts (e.g., accessing file shares, databases, etc).

What else would you recommend?
wam
  •  wam
  • Paid support Topic Starter
2018-02-02T17:20:32Z
Hi Henrik,

We discovered we need to check Local Login (to ensure thread identity works correctly), so we are doing that now. In addition, we tried "Use Win32 API CreateProcessAsUserW" but the error is still happening.

We thought about changing the VisualCron service account to run as the domain account and remove all special logon credentials for tasks and just letting it run as the service account, but you explicitly stated to another VisualCron user 2 months ago that this is a really bad idea (https://www.visualcron.com/forum.aspx?g=posts&t=7729: "It is not recommended to change the default SYSTEM account for VisualCron.")

Again... what else would you recommend?

I still have a hunch that the underlying problem is VisualCron is somehow exhausting the desktop heap/workstation heap space. But without VisualCron engineers debugging or giving us pointers, this is very hard to confirm.
Support
2018-02-05T09:20:17Z
Originally Posted by: wam 

Hi Henrik,

We discovered we need to check Local Login (to ensure thread identity works correctly), so we are doing that now. In addition, we tried "Use Win32 API CreateProcessAsUserW" but the error is still happening.

We thought about changing the VisualCron service account to run as the domain account and remove all special logon credentials for tasks and just letting it run as the service account, but you explicitly stated to another VisualCron user 2 months ago that this is a really bad idea (https://www.visualcron.com/forum.aspx?g=posts&t=7729: "It is not recommended to change the default SYSTEM account for VisualCron.")

Again... what else would you recommend?

I still have a hunch that the underlying problem is VisualCron is somehow exhausting the desktop heap/workstation heap space. But without VisualCron engineers debugging or giving us pointers, this is very hard to confirm.



Yes, it might be a bad idea as by default the SYSTEM account has the appropriate rights and we cannot guarantee any other account. With testing with a local Administrator I mean using that user for the Credential (not the Service).
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
wam
  •  wam
  • Paid support Topic Starter
2018-02-05T17:52:41Z
Hi Henrik,

Yes, I understood. We cannot set the Task Credential to local admin since local admin is not on the domain, and we depend on AD for access to file shares, databases, etc.

What else would you recommend? Can you patch VisualCron to log the concurrent number of running tasks? I suspect that will be very illuminating. How many concurrent tasks does VisualCron's QA load test with?
michael.miller.weiss
2018-02-07T01:38:56Z
Any update here Henrik on what we need to do get this error resolved? We facing this error multiple times per day in production and need to determine if VC is capable of running a large number of execute tasks in background mode with a credential. Happy to provide logs or other data to help your team troubleshoot the issue.
Support
2018-02-07T08:51:43Z
Originally Posted by: michael.miller.weiss 

Any update here Henrik on what we need to do get this error resolved? We facing this error multiple times per day in production and need to determine if VC is capable of running a large number of execute tasks in background mode with a credential. Happy to provide logs or other data to help your team troubleshoot the issue.



The problem is that the "Access denied" is returned by the operating system. VisualCron just capture it. Do you get same error if you switch to "CreateProcessAsUserW" method in the Credential?


Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
michael.miller.weiss
2018-02-07T15:22:54Z
Thanks for the response - we did try to use CreateProcessAsUserW and we still received the access denied error. Additionally this changed caused 1000's of VisualCRON errors around not being to access the temporary files (see below). This led to instability as jobs were reporting incorrect statuses and saying they failed but the UI or job log didn't show the failure. We reverted the credentials back to using CreateProcessWithLogonW and the temp file locking issue went away.

I realize the access denied error is the direct result returned by the OS. Are you aware of any limitations on the number background jobs that can be created calling CreateProcessWithLogonW? I did see this in the documentation:

There is a limit to the number of child processes that can be created by this function and run simultaneously. For example, on Windows XP, this limit is MAXIMUM_WAIT_OBJECTS*4. However, you may not be able to create this many processes due to system-wide quota limits.

But this seems to happen when we have 10-20 concurrent jobs running where the limit in documentation is 265 (64*4), so I don't believe this is the issue. Is it possible that this could be related to a threading issue in VC when these WIN32 API calls are being executed? Have you been able to reproduce this issue using a credential with the same settings and running several hundred execute jobs?

2/2/2018 1:48:10 PM Err StartBackgroundProcess->Closing of StdOut failed - trying again, file: d:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c, error: System.IO.IOException: The process cannot access the file 'd:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at OBOKIIHBDBPMCFALPGECCIFHCDJPEDKODDGK.CNOMLBFDJANALDAEIKLKHLCGKEJIGMLIMBLK.LDOOOMNBFEMCMJNDHGGHGOGEMOOGMECJLOPG(String , Boolean , Int32 ) in C:\sourcefiles\code\VisualCronService\Jobs\TaskProcesses\Process\clsProcessTaskExecute.vb:line 295
2/2/2018 1:48:10 PM Err StartBackgroundProcess->Closing of StdOut failed - trying again, file: d:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c, error: System.IO.IOException: The process cannot access the file 'd:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at OBOKIIHBDBPMCFALPGECCIFHCDJPEDKODDGK.CNOMLBFDJANALDAEIKLKHLCGKEJIGMLIMBLK.LDOOOMNBFEMCMJNDHGGHGOGEMOOGMECJLOPG(String , Boolean , Int32 ) in C:\sourcefiles\code\VisualCronService\Jobs\TaskProcesses\Process\clsProcessTaskExecute.vb:line 295
2/2/2018 1:48:10 PM Err StartBackgroundProcess->Closing of StdOut failed - trying again, file: d:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c, error: System.IO.IOException: The process cannot access the file 'd:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at OBOKIIHBDBPMCFALPGECCIFHCDJPEDKODDGK.CNOMLBFDJANALDAEIKLKHLCGKEJIGMLIMBLK.LDOOOMNBFEMCMJNDHGGHGOGEMOOGMECJLOPG(String , Boolean , Int32 ) in C:\sourcefiles\code\VisualCronService\Jobs\TaskProcesses\Process\clsProcessTaskExecute.vb:line 295
2/2/2018 1:48:10 PM Err StartBackgroundProcess->Closing of StdOut failed - trying again, file: d:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c, error: System.IO.IOException: The process cannot access the file 'd:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at OBOKIIHBDBPMCFALPGECCIFHCDJPEDKODDGK.CNOMLBFDJANALDAEIKLKHLCGKEJIGMLIMBLK.LDOOOMNBFEMCMJNDHGGHGOGEMOOGMECJLOPG(String , Boolean , Int32 ) in C:\sourcefiles\code\VisualCronService\Jobs\TaskProcesses\Process\clsProcessTaskExecute.vb:line 295
2/2/2018 1:48:11 PM Err StartBackgroundProcess->Closing of StdOut failed - trying again, file: d:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c, error: System.IO.IOException: The process cannot access the file 'd:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at OBOKIIHBDBPMCFALPGECCIFHCDJPEDKODDGK.CNOMLBFDJANALDAEIKLKHLCGKEJIGMLIMBLK.LDOOOMNBFEMCMJNDHGGHGOGEMOOGMECJLOPG(String , Boolean , Int32 ) in C:\sourcefiles\code\VisualCronService\Jobs\TaskProcesses\Process\clsProcessTaskExecute.vb:line 295
2/2/2018 1:48:11 PM Err StartBackgroundProcess->Closing of StdOut failed - trying again, file: d:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c, error: System.IO.IOException: The process cannot access the file 'd:\VisualCRON\Temp\0ed14eac-0f28-42b5-8a3c-69947ee11b0c' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
Support
2018-02-08T08:52:37Z
Originally Posted by: michael.miller.weiss 


I realize the access denied error is the direct result returned by the OS. Are you aware of any limitations on the number background jobs that can be created calling CreateProcessWithLogonW? I did see this in the documentation:

There is a limit to the number of child processes that can be created by this function and run simultaneously. For example, on Windows XP, this limit is MAXIMUM_WAIT_OBJECTS*4. However, you may not be able to create this many processes due to system-wide quota limits.

But this seems to happen when we have 10-20 concurrent jobs running where the limit in documentation is 265 (64*4), so I don't believe this is the issue. Is it possible that this could be related to a threading issue in VC when these WIN32 API calls are being executed? Have you been able to reproduce this issue using a credential with the same settings and running several hundred execute jobs?



We have not seen any limitation on number of concurrent executions. It would be interesting to see CreateProcessWithLogonW with a local Administrator. Just to rule out any problems that could be related to AD.


Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
michael.miller.weiss
2018-02-17T05:30:42Z
We have put together a few test cases and believe that using CreateProcessAsUserW is the correct way to be running these in background given this is the only supported option by Microsoft to run a process as another user from a windows server. This also allows us to run the process without loading the profile.
We are running into the issue with the StdOut files not being able to be cleaned up. To reproduce:
Create a local admin account
Grant the user Logon as Batch Job thru local policy
Setup a new credential with Local Login , CreateProcessAsUserW, Logon32_Logon_Batch
Create 10 jobs with 1 Execute task each that trigger every 30 seconds
The execute task for us is a simple C# console app that performs Thread.Sleep for 10 seconds
Run the jobs
The log will show
2/16/2018 11:49:12 PM Err StartBackgroundProcess->Closing of StdOut failed - trying again, file: D:\VisualCRON\Temp\646bd0ee-d0c4-492e-aa01-daeebb954dbc, error: System.IO.IOException: The process cannot access the file 'D:\VisualCRON\Temp\646bd0ee-d0c4-492e-aa01-daeebb954dbc' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at OBOKIIHBDBPMCFALPGECCIFHCDJPEDKODDGK.CNOMLBFDJANALDAEIKLKHLCGKEJIGMLIMBLK.LDOOOMNBFEMCMJNDHGGHGOGEMOOGMECJLOPG(String , Boolean , Int32 ) in C:\sourcefiles\code\VisualCronService\Jobs\TaskProcesses\Process\clsProcessTaskExecute.vb:line 295

Can you please provide a timeline for a fix?

capture.png

NOTE: Originally I had wrote CreateProcessAsLogonW but I meant to write CreateProcessAsUserW. I edited the post to correct this
Support
2018-02-20T08:45:58Z
Originally Posted by: michael.miller.weiss 

We have put together a few test cases and believe that using CreateProcessAsUserW is the correct way to be running these in background given this is the only supported option by Microsoft to run a process as another user from a windows server. This also allows us to run the process without loading the profile.
We are running into the issue with the StdOut files not being able to be cleaned up. To reproduce:
Create a local admin account
Grant the user Logon as Batch Job thru local policy
Setup a new credential with Local Login , CreateProcessAsUserW, Logon32_Logon_Batch
Create 10 jobs with 1 Execute task each that trigger every 30 seconds
The execute task for us is a simple C# console app that performs Thread.Sleep for 10 seconds
Run the jobs
The log will show
2/16/2018 11:49:12 PM Err StartBackgroundProcess->Closing of StdOut failed - trying again, file: D:\VisualCRON\Temp\646bd0ee-d0c4-492e-aa01-daeebb954dbc, error: System.IO.IOException: The process cannot access the file 'D:\VisualCRON\Temp\646bd0ee-d0c4-492e-aa01-daeebb954dbc' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at OBOKIIHBDBPMCFALPGECCIFHCDJPEDKODDGK.CNOMLBFDJANALDAEIKLKHLCGKEJIGMLIMBLK.LDOOOMNBFEMCMJNDHGGHGOGEMOOGMECJLOPG(String , Boolean , Int32 ) in C:\sourcefiles\code\VisualCronService\Jobs\TaskProcesses\Process\clsProcessTaskExecute.vb:line 295

Can you please provide a timeline for a fix?

capture.png

NOTE: Originally I had wrote CreateProcessAsLogonW but I meant to write CreateProcessAsUserW. I edited the post to correct this



Have you tested this with the latest version?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
wam
  •  wam
  • Paid support Topic Starter
2018-03-12T17:37:33Z
Originally Posted by: Support 

Originally Posted by: michael.miller.weiss 

We have put together a few test cases and believe that using CreateProcessAsUserW is the correct way to be running these in background given this is the only supported option by Microsoft to run a process as another user from a windows server. This also allows us to run the process without loading the profile.

Can you please provide a timeline for a fix?



Have you tested this with the latest version?



Henrik,

We just tested 8.3.4 and the problem with too many temp files still exists. I'm attaching our C# driver program. You will now have very minimal work to do on your side to reproduce the issue. We need a fix ASAP - we've now spent over 40 hours figuring out this problem on our side, and figuring out the right way to report this problem to VisualCron so that the problem gets fixed.

Here is the attached program:   VisualCronTestCreateUserW.7z (1,580kb) downloaded 51 time(s).

The attached program creates Execute Command tasks that invoke powershell and sleep for 5 seconds, repetitively, and return exit code 0. You can call it this way:

.\VisualCRON.Utility.exe --action testsetup --server localhost --domainname "YOURDOMAIN" --username "YourTestServiceAccount" --password "password"

After running for a long enough time, the fact VisualCron does not clean up the Temp folder when running tasks using CreateProcessAsUserW causes an internal failure in VisualCron (see our previous message for the error). To be clear, the obvious problem is VisualCron does not properly delete Temp files, even when every task/job succeeds. This IS a VisualCron bug and needs fixing. Can you please provide a timeline for a fix?
Support
2018-03-22T13:14:40Z
Thank you for your patience. Please try this build:

https://www.visualcron.c....aspx?g=posts&t=7901 
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
wam
  •  wam
  • Paid support Topic Starter
2018-03-23T17:57:27Z
Originally Posted by: Support 

Thank you for your patience. Please try this build:

https://www.visualcron.c....aspx?g=posts&t=7901 



All set. We will deploy to prod once 8.3.5 goes live.
Support
2018-03-24T17:28:36Z
Originally Posted by: wam 

Originally Posted by: Support 

Thank you for your patience. Please try this build:

https://www.visualcron.c....aspx?g=posts&t=7901 



All set. We will deploy to prod once 8.3.5 goes live.



Did you have a chance to test it?


Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2018-03-24T17:30:35Z
Sorry, saw your post now. Thanks for the report and testing!
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
michael.miller.weiss
2018-07-12T13:27:16Z
Hi -
We upgraded in production today and the issue still exists, but in another form. The error now is:

7/12/2018 8:35:54 AM Err Error at output to file: System.NullReferenceException: Object reference not set to an instance of an object.
at OBOKIIHBDBPMCFALPGECCIFHCDJPEDKODDGK.CNOMLBFDJANALDAEIKLKHLCGKEJIGMLIMBLK.DKIMDIIJGHLPPEDHHAJBCLHDJOIKJNCPFIMD(FileStream& , String ) in C:\sourcefiles\code\VisualCronService\Jobs\TaskProcesses\Process\clsProcessTaskExecute.vb:line 1302

This seems to happen after the job has run and the task is trying to cleanup the temporary files. The jobs then fail, even though the task runs successfully. Additionally the files are not cleaned up in the temp directory.

Can you please take a look at this again and let us know when we can expect a fix.

Thanks,
Mike
Scroll to Top