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


rleatherwood
2012-02-17T18:33:43Z
It appears that we are having an issue with the task output (what's displayed on the cmd prompt) not being captured and displaying within the task output in Visual Cron. Some tasks display just fine, others do not. Unable to determine at this time why that is the case.

I did create a simple test execution that displaying the following results within the cmd prompt:

Test output display within Visual Cron.
Counter = 0
Counter = 1
Counter = 2
Counter = 3
Counter = 4
Counter = 5
Counter = 6
Counter = 7
Counter = 8
Counter = 9
Counter = 10
Finished

Unfortunately, I did not receive those same results when I ran via VC Task:

rleatherwood attached the following image(s):
Sponsor
Forum information
Support
2012-02-17T18:40:25Z
Please post the script here.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
rleatherwood
2012-02-17T19:43:41Z

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Test
{
public class Program
{
#region "Main method"

public static int Main(string[] args)
{
Console.WriteLine("Test output display within Visual Cron.");

int cntrTotal = 10;
int cntr = 0;
do
{
Console.WriteLine("Counter = " + cntr.ToString());
cntr += 1;
}
while (cntr <= cntrTotal);

Console.WriteLine("Finished");

return 0;
}
#endregion

}
}
Support
2012-02-20T08:52:18Z
We compiled and ran it through VC but did not have any problem with output. I am attaching it. Please let me know if you have same problem, if so, paste some screenshots of your settings.
File Attachment(s):
RahnTestOutput.zip (3kb) downloaded 77 time(s).

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
osirisja
2012-02-20T12:38:06Z
Although it is likely not related, I also have problems directing output to STDOUT from a Powershell script. Does anybody have any idea how this can be done?

Cheers

Andy
Support
2012-02-20T12:42:57Z
Originally Posted by: osirisja 

Although it is likely not related, I also have problems directing output to STDOUT from a Powershell script. Does anybody have any idea how this can be done?

Cheers

Andy



Here is how you write output that is captured by VisualCron in PowerShell:

VisualCron standard output

write-output "my output"

VisualCron standard error

write-error "my error"

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Rahn
2012-02-20T13:06:34Z
Henrik,
I'm trying your compiled version in the 6.0.7 and in version 6.0.6, and it works fine. I also threw it in a new project, compiled myself, and it worked.

However, in a .Net script task, it didn't work. I got no output back.

Here is the script I used. (Removed Linq reference, and made it return void instead of int.)

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

public class Program
{
	public static void Main()
	{
		Console.WriteLine("Test output display within Visual Cron.");
		
		int cntrTotal = 10;
		int cntr = 0;
		do
		{
		Console.WriteLine("Counter = " + cntr.ToString());
		cntr += 1;
		}
		while (cntr <= cntrTotal);
		
		Console.WriteLine("Finished");
	}
}

Rahn attached the following image(s):
Support
2012-02-20T13:15:59Z
Hi Rahn,

it was not clear from the beginning that you used the .NET Execute Task. Output cannot be captured that way. If you want to receive output back to VisualCron you should create a method that returns something. In this case, as string. So, then instead of writing to Console you write to a StringBuilder and then in the end return the ToString of the StringBuilder.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
osirisja
2012-02-20T14:05:58Z
Thanks Henrik

Figured out now how to redirect output to STDOUT. Only issue I got is that some output from the external application is still being written to STDERR even though there isn't an Error so the task always fails with an exit 7777.

I will continue searching for a solution :-)

Cheers

Andy


Originally Posted by: Support 

Originally Posted by: osirisja 

Although it is likely not related, I also have problems directing output to STDOUT from a Powershell script. Does anybody have any idea how this can be done?

Cheers

Andy



Here is how you write output that is captured by VisualCron in PowerShell:

VisualCron standard output

write-output "my output"

VisualCron standard error

write-error "my error"


Support
2012-02-21T07:55:25Z
Originally Posted by: osirisja 

Thanks Henrik

Figured out now how to redirect output to STDOUT. Only issue I got is that some output from the external application is still being written to STDERR even though there isn't an Error so the task always fails with an exit 7777.

I will continue searching for a solution :-)

Cheers

Andy


Originally Posted by: Support 

Originally Posted by: osirisja 

Although it is likely not related, I also have problems directing output to STDOUT from a Powershell script. Does anybody have any idea how this can be done?

Cheers

Andy



Here is how you write output that is captured by VisualCron in PowerShell:

VisualCron standard output

write-output "my output"

VisualCron standard error

write-error "my error"




For this particular Task, maybe we should make it optional to set it as "error occured" if error output exist. Please make a separate Feature request about this.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Rahn
2012-02-22T18:21:58Z
Actually Henrik, we are using executables, not the script tasks.
I threw it in a script task to try to duplicate what was going on. (And I agree...Robb implied it may have been either a exe or a script task. I've given him an appropriate hard time for it.)

We are still getting intermittant issues in various console apps that where Console.Writeline() isn't showing up in the output.

Unfortunately, it's hard to duplicate on-demand.
Support
2012-02-23T08:23:55Z
When you get this, do you get no output at all or just part of it?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Rahn
2012-02-23T13:22:02Z
Support
2012-02-23T13:49:14Z
I suggest you turn on "Extended debugging" in Server settings->Log.

Then, if output fails to be "added" then open the log file and look at the log for that Task running. Maybe you see an error there. You can paste the log part here as well.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
rleatherwood
2012-02-27T18:19:06Z
We have the logs turned on, but we're not seeing anything that would indicate a problem. I did comparisons between 2 tasks (one that captured output and one that didn't). Below are screenshots of the logs, but you can see from VC that no output is captured.

2/25/2012 2:10:00 AM Debug Calling GetNextTaskProcess()
2/25/2012 2:10:00 AM Debug Next Task is: Sample 1
2/25/2012 2:10:00 AM Debug Next action: ActionContinue
2/25/2012 2:10:00 AM Debug Calling StartTaskProcess() with Task: Sample 1
2/25/2012 2:10:00 AM Debug Task (116327) was added to processlist: Sample 1
2/25/2012 2:10:00 AM Debug Entering wait loop.Sample 1
2/25/2012 2:10:00 AM Info Task started: Sample 1 (116327)
2/25/2012 2:10:00 AM Debug Process status - retrieving process id (116327)
2/25/2012 2:10:01 AM Debug Process status - has left WaitForExit (116327)
2/25/2012 2:10:01 AM Debug Process status - OutPut captured (116327)
2/25/2012 2:10:01 AM Debug Process status - trying to retrieve exit code
2/25/2012 2:10:01 AM Debug Process status - ExitCode fetched (116327)
2/25/2012 2:10:01 AM Debug Process status - ProcessHandles closed (116327)
2/25/2012 2:10:01 AM Debug Ending timeout timer (116327)
2/25/2012 2:10:01 AM Debug Ending output readers (116327)
2/25/2012 2:10:01 AM Debug Closing desktop handles (116327)
2/25/2012 2:10:01 AM Debug Process status - About to raise TaskCompleted (116327)
2/25/2012 2:10:01 AM Info Task completed: Sample 1 (116327)
2/25/2012 2:10:01 AM Debug Process status - About to RemoveTaskProcess (116327)
2/25/2012 2:10:01 AM Debug Setting previous task in TaskProcessCompleted: Sample 1 (602d6d72-02c7-4edb-900d-857ec58c28de) in job: Notes - Sample
2/25/2012 2:10:01 AM Debug Process status - About to SendTaskProcess (116327)
2/25/2012 2:10:01 AM Debug Process status - About to RemoveTaskProcess (116327)
2/25/2012 2:10:01 AM Debug Task (116327) was removed from processlist: Sample 1
2/25/2012 2:10:01 AM Debug Sleep ended because Task ended.Sample 1
2/25/2012 2:10:01 AM Debug End of loop - iterating again.Sample 1
2/25/2012 2:10:01 AM Debug Calling GetNextTaskProcess()
2/25/2012 2:10:05 AM Debug Next Task is: Sample 2
2/25/2012 2:10:05 AM Debug Next action: ActionContinue
2/25/2012 2:10:05 AM Debug Calling StartTaskProcess() with Task: Sample 2
2/25/2012 2:10:05 AM Debug Task (116330) was added to processlist: Sample 2
2/25/2012 2:10:05 AM Debug Entering wait loop.Sample 2
2/25/2012 2:10:05 AM Info Task started: Sample 2 (116330)
2/25/2012 2:10:05 AM Debug Process status - retrieving process id (116330)
2/25/2012 2:10:06 AM Debug Process status - has left WaitForExit (116330)
2/25/2012 2:10:06 AM Debug Process status - OutPut captured (116330)
2/25/2012 2:10:06 AM Debug Process status - trying to retrieve exit code
2/25/2012 2:10:06 AM Debug Process status - ExitCode fetched (116330)
2/25/2012 2:10:06 AM Debug Process status - ProcessHandles closed (116330)
2/25/2012 2:10:06 AM Debug Ending timeout timer (116330)
2/25/2012 2:10:06 AM Debug Ending output readers (116330)
2/25/2012 2:10:06 AM Debug Closing desktop handles (116330)
2/25/2012 2:10:06 AM Debug Process status - About to raise TaskCompleted (116330)
2/25/2012 2:10:06 AM Info Task completed: Sample 2 (116330)
2/25/2012 2:10:06 AM Debug Process status - About to RemoveTaskProcess (116330)
2/25/2012 2:10:06 AM Debug Setting previous task in TaskProcessCompleted: Sample 2 (9ad04f53-a0cc-4b6b-8f7c-944e03bfafae) in job: Notes - Sample
2/25/2012 2:10:06 AM Debug Process status - About to SendTaskProcess (116330)
2/25/2012 2:10:06 AM Debug Process status - About to RemoveTaskProcess (116330)
2/25/2012 2:10:06 AM Debug Task (116330) was removed from processlist: Sample 2
2/25/2012 2:10:06 AM Debug Sleep ended because Task ended.Sample 2
2/25/2012 2:10:06 AM Debug End of loop - iterating again.Sample 2
2/25/2012 2:10:06 AM Debug Calling GetNextTaskProcess()


File Attachment(s):
VC output not displaying 2.bmp (293kb) downloaded 51 time(s).
Support
2012-02-28T07:59:22Z
The only strange thing I see is the 4 second gap between these Tasks - why?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
rleatherwood
2012-03-02T20:51:23Z
I was running them manually. That's why there's a 4 second lag between the 2.
Support
2012-03-02T21:05:14Z
We need some way to reproduce this. It sounds strange that you get full output some times and that it does not work some times.

If you put this test script to execute every 1 minutes then go to Task history. How many successful (with output) to you get in the Task history (and non successful). Please only do this test with the sample script and not the "real world" script.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
rleatherwood
2012-03-05T20:38:03Z
Ok, I ran the test script (from above) every minute. I pulled up the 'Task Output'. There was nothing in there under the Text, or HTML tabs, but the XML tab contained the verbage "Output was not loaded correctly - perhaps you need to press Get full output".
File Attachment(s):
VC output not displaying 3.bmp (1,109kb) downloaded 59 time(s).
Support
2012-03-05T20:53:20Z
Ok, this is "normal" output in the XML tab if there is no output at all. I was thinking about "Task history" window. If you run it every minute for let say 10 minutes you will see in the history window if any of these executions had output or if they never have (statistically).
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
rleatherwood
2012-03-05T21:22:32Z
My apologies, I was referring to the fact that none of the output from the Task History the desired output. It is all blank.
File Attachment(s):
VC output not displaying 4.bmp (1,525kb) downloaded 59 time(s).
Support
2012-03-05T22:49:02Z
Are we still talking about the sample console app or have you switched back to testing with your application?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
rleatherwood
2012-03-07T18:39:15Z
I switched back to the code used in Post#3.
Scroll to Top