SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
WebGetFile fails suddenly

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
WebGetFile fails suddenly
Author Message
Ryan Pieszak



Joined: 19 Jun 2003
Posts: 25

Post WebGetFile fails suddenly Reply with quote

Greetings,
I have numerous tasks using the WebGetFile syntax, and all of these tasks work perfectly fine. But periodically, one of these tasks will fail giving this error:

"Exit code: -1. An error occurred while executing automation script:..."

When I browse to the URL manually, it works perfectly fine. There is no problem with connectivity, all URLs being browsed to with this syntax are internal. And the odd thing is that when one fails, they all begin to fail. The only way to correct it is to restart the scheduler or restart the server. Why are these jobs failing when it appears as though there is nothing wrong? Is it flagging for something I'm not aware of?
Thanks for any help.
Ryan

Wed May 05, 2004 4:13 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Re: WebGetFile fails suddenly Reply with quote

I would like to suggest 2 things.

1. Try calling WebGetFile several times if it fails first time. Here is an example script that will retry it 3 times waiting 10 seconds between retries.

Dim error, string
Dim failed, number
Dim count_retries, number

RETRY:
OnErrorResumeNext
WebGetFile ....
GetLastError error
OnErrorStop

InStr error, "failed", failed
IfThen failed, DO_COUNTING

DO_COUNTING:
Add count_retries, 1, count_retries
IsEqual count_retries, 3, failed
IfThen failed, HANDLE_ERRORS
Wait 10
GoTo RETRY

... main job processing goes here ...
Exit

HANDLE_ERRORS:
... put here what you want to do after WebGetFile fails for 3 consecutive times

To avoid copying this script to multiple jobs consider creating your own user defined statement myWebGetFile (using Tools/Script Library menu). In jobs calling WebGetFile substitute it with myWebGetFile

2. Set each job calling WebGetFile (or myWebGetFile) to run detached so that they cannot affect each other.

: Greetings,
: I have numerous tasks using the WebGetFile syntax, and all of these tasks
: work perfectly fine. But periodically, one of these tasks will fail giving
: this error: "Exit code: -1. An error occurred while executing
: automation script:..."

: When I browse to the URL manually, it works perfectly fine. There is no
: problem with connectivity, all URLs being browsed to with this syntax are
: internal. And the odd thing is that when one fails, they all begin to
: fail. The only way to correct it is to restart the scheduler or restart
: the server. Why are these jobs failing when it appears as though there is
: nothing wrong? Is it flagging for something I'm not aware of?
: Thanks for any help.
: Ryan

Wed May 05, 2004 5:42 pm View user's profile Send private message
Ryan Pieszak



Joined: 19 Jun 2003
Posts: 25

Post Re: WebGetFile fails suddenly Reply with quote

SysOps,
Thank you for your reply. I did what you said but I have two issues:
1) When I moved the web hit tasks to "detached", they stopped appearing in the log file and they appear as though they aren't running in the job monitor screen either. However, when I put an email script on one of the pages, it's definitely getting hit. Do detached tasks not log in the log file or show as "running" on the monitor screen?
2) I tried using the script you posted (with some minor mods) and again I put an email script on the page it's hitting and I'm getting blasted with hundreds of emails. Also, it appears as thought my test task using this script is never ending. Is there a loop somewhere that isn't being closed? This is the script as I'm running it:

=========================================
===BEGIN SCRIPT==========================
=========================================
Dim error, string
Dim failed, number
Dim count_retries, number
Dim email_subject, string

RETRY:
OnErrorResumeNext
WebGetFile( file, url )
GetLastError error
OnErrorStop

InStr error, "failed", 1, failed
IfThen failed, DO_COUNTING

DO_COUNTING:
Add count_retries, 1, count_retries
IsEqual count_retries, 2, failed
IfThen failed, HANDLE_ERRORS
Wait 3
GoTo RETRY

WebGetFile( file, url )
Exit

HANDLE_ERRORS:
Concat( "Error on", name, email_subject )
MailSend( "Task_Failure@markersys.com", " ", "rpieszak@markersys.com", email_subject, "" )
=========================================
===END SCRIPT============================
=========================================

Thanks for your help.
Ryan

: I would like to suggest 2 things.

: 1. Try calling WebGetFile several times if it fails first time. Here is an
: example script that will retry it 3 times waiting 10 seconds between
: retries.

: Dim error, string
: Dim failed, number
: Dim count_retries, number

: RETRY: OnErrorResumeNext
: WebGetFile ....
: GetLastError error
: OnErrorStop

: InStr error, "failed", failed
: IfThen failed, DO_COUNTING

: DO_COUNTING: Add count_retries, 1, count_retries
: IsEqual count_retries, 3, failed
: IfThen failed, HANDLE_ERRORS
: Wait 10
: GoTo RETRY

: ... main job processing goes here ...
: Exit

: HANDLE_ERRORS: ... put here what you want to do after WebGetFile fails for 3
: consecutive times

: To avoid copying this script to multiple jobs consider creating your own user
: defined statement myWebGetFile (using Tools/Script Library menu). In jobs
: calling WebGetFile substitute it with myWebGetFile

: 2. Set each job calling WebGetFile (or myWebGetFile) to run detached so that
: they cannot affect each other.

Thu May 06, 2004 9:06 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Re: WebGetFile fails suddenly Reply with quote

1) Detached jobs do write to the log (as well as various trace files if tracing is enabled), but not to the screen because they are run by a separate instance of 24x7.exe.
To refresh the log view press F5 key or use View/Refresh menu.

2) sorry, there is a bug, that's causing it to never stop (dead-loop)
It is in line "IsEqual count_retries, 2, failed", the last parameter must be a boolean variable and not a number. Here is how to fix it. Add new variable "Dim bFailed, boolean" in the beginning and then change "failed" in the IsEqual line to "bFailed" and also change "IfThen failed, HANDLE_ERRORS" to "IfThen bFailed, HANDLE_ERRORS"

Hope this helps.

: SysOps,
: Thank you for your reply. I did what you said but I have two issues: 1) When
: I moved the web hit tasks to "detached", they stopped appearing
: in the log file and they appear as though they aren't running in the job
: monitor screen either. However, when I put an email script on one of the
: pages, it's definitely getting hit. Do detached tasks not log in the log
: file or show as "running" on the monitor screen?
: 2) I tried using the script you posted (with some minor mods) and again I put
: an email script on the page it's hitting and I'm getting blasted with
: hundreds of emails. Also, it appears as thought my test task using this
: script is never ending. Is there a loop somewhere that isn't being closed?
: This is the script as I'm running it:
: =========================================
: ===BEGIN SCRIPT==========================
: =========================================
: Dim error, string
: Dim failed, number
: Dim count_retries, number
: Dim email_subject, string

: RETRY: OnErrorResumeNext
: WebGetFile( file, url )
: GetLastError error
: OnErrorStop

: InStr error, "failed", 1, failed
: IfThen failed, DO_COUNTING

: DO_COUNTING: Add count_retries, 1, count_retries
: IsEqual count_retries, 2, failed
: IfThen failed, HANDLE_ERRORS
: Wait 3
: GoTo RETRY

: WebGetFile( file, url )
: Exit

: HANDLE_ERRORS: Concat( "Error on", name, email_subject )
: MailSend( "Task_Failure@markersys.com", " ",
: "rpieszak@markersys.com", email_subject, "" )
: =========================================
: ===END SCRIPT============================
: =========================================

: Thanks for your help.
: Ryan

Thu May 06, 2004 9:32 am View user's profile Send private message
Ryan Pieszak



Joined: 19 Jun 2003
Posts: 25

Post Re: WebGetFile fails suddenly Reply with quote

SysOps,
Thanks for help on both issues, both are corrected now. I have one last issue, and then I'm sure everything will work as I need it to. In the script I posted earlier, the SendMail line is giving the following error: "Error writing to temporary file" and then it gives a path to a temporary file. I've used SendMail before and not had this issue, is this different because it's being executed from an automation script?
Thanks for your help.
Ryan

: 1) Detached jobs do write to the log (as well as various trace files if
: tracing is enabled), but not to the screen because they are run by a
: separate instance of 24x7.exe.
: To refresh the log view press F5 key or use View/Refresh menu.

: 2) sorry, there is a bug, that's causing it to never stop (dead-loop)
: It is in line "IsEqual count_retries, 2, failed", the last
: parameter must be a boolean variable and not a number. Here is how to fix
: it. Add new variable "Dim bFailed, boolean" in the beginning and
: then change "failed" in the IsEqual line to "bFailed"
: and also change "IfThen failed, HANDLE_ERRORS" to "IfThen
: bFailed, HANDLE_ERRORS"

: Hope this helps.

Thu May 06, 2004 10:35 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Re: WebGetFile fails suddenly Reply with quote

Please check the text of the email message being sent is not empty. SendMail writes a temporary file for the message body and if it has zero size SendMail "thinks" that something is wrong with the file writing (no disk space, etc...)

: SysOps,
: Thanks for help on both issues, both are corrected now. I have one last
: issue, and then I'm sure everything will work as I need it to. In the
: script I posted earlier, the SendMail line is giving the following error:
: "Error writing to temporary file" and then it gives a path to a
: temporary file. I've used SendMail before and not had this issue, is this
: different because it's being executed from an automation script?
: Thanks for your help.
: Ryan

Thu May 06, 2004 10:44 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.