Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
return code from iwodstart
kellyrmilligan
I am calling a perl script from an external task, and in this I call iwodstart, and get a return code of 35584, has anyone else gotten this before? when I run the command that is in my perl script from the command line, I get a status of completed. here is my call to it:
my $cmd = "$iwhomeODbin/iwodstart $odconfig >>$logfile";
print LOG "cmd = $cmd\n";
$return = system($cmd);
I did this same exact script in my test environment and got returns of 0 or 1 or 2, which is what the documentation on this command says.
any ideas?
Find more posts tagged with
Comments
Migrateduser
I hope you're using backtics instead of double quotes to execute the iwodstart.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
kellyrmilligan
well, I got this example code from an Interwoven consultant, so I was just using his code. It works perfectly in my test environment, but not in prod. how should it be then?
Mr. Kelly
Migrateduser
Oh never mind - you're using
system
to execute the iwodstart. I overlooked that. The
system
command will only provide you with an exit status, not the output of the command. According to the OpenDeploy manual, it should only ever return the following exit codes:
0 - success
1 - start of deployment failed
2 - deployment ran and failed
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
kellyrmilligan
right, and I am getting the weird return code of 35584. I used a back tik example though and it worked. weird.
Thanks, and I got the template based email working well now, just because of that dam -t part of the command line. now it works like a charm. wooohooo!!!!
Migrateduser
Well little by little we'll get you there. Glad the Template Based Email is working for you - it's one of the better enhancements I've seen to the product.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Adam Stoller
What version of OpenDeploy (including patch and service packs)
What platform?
If you're running on WindowNT - there are known problems with getting the return code from iwodstart (the problems are WindowsNT-specific, because the return values work on Windows2000)
If you're running on Windows2000 - you still might be getting some shell padding of the return value (you might have to shift the value by 8 - though in this case that ends up with 139, which doesn't really clarify anything)
Do you know whether the deployment actually succeeded despite the apparent non-zero status returned?
--fish
(Interwoven Senior Technical Consultant)
0509_Test.zip
kellyrmilligan
actually, I'm running solaris, so thats not it. I even put in a bogus deployment name in the perl script, and got the same return code. I separated the code out into its own script, without any workflow specific items in it, and it works perfectly there giving the right return code. It is acting like when I call it from workflow, it can't find the od config file from where it is being run. Here is all the code:
WFT file
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE workflow SYSTEM "iwwf.dtd">
<template_script><![CDATA[
#Server: 10.128.240.77:80
#Version: 5.5.2
#Build 9275 20020617
##########----------Beginning of customized text section----------##########
# Put your addition to the Workflow Template here
##########----------End of customized text section----------##########
use TeamSite::Config;
(my $iwhome = TeamSite::Config::iwgethome()) =~ tr|\\|/|;
#=====================================================================
# Name: iw_cleanup_paths
# Args: bp - branch path
# wa - workarea name
# Usage: ($b, $w, $a) = iw_cleanup_paths($bp, $wa);
# Purpose: Function used to clean up leading and trailing blanks
# from branch path and work area path, then derive
# $areavpath.
# Returns: Cleaned branch path, workarea, and generated areavpath
#=====================================================================
sub iw_cleanup_paths {
my ($bp, $wa) =
@_
;
# clean up leading and trailing slashes so we don't
# end up hassling the user over including/excluding them
$bp =~ s|^\s*/*([^/].*\S)/\s*$|$1|;
$wa =~ s|^\s*/*([^/].*\S)/\s*$|$1|;
#=# (Note - this code may need to change when we start supporting
#=# multiple archives [Arnold])
$bp = "main/$bp" if ($bpath !~ /^main/);
$areavpath = TeamSite::CGI_lite::escape_html_data(
"/default/$bp/WORKAREA/$wa");
return ($bp, $wa, $areavpath);
}
#=====================================================================
# Name: iw_set_area
# Args: btag - TAG_info variable name for branch path.
# watag - TAG_info variable name for workarea.
# Usage: ($a, $b, $w, $s) = set_area("$btag", "$watag");
# Purpose: If the built-in variables for branch and workarea have
# not been set, pull the information from the workflow
# instantiation form (using the btag and watag info).
# Use the branch and workarea information to generate
# a valid areavpath (using a library routine)
# Returns: Returns the generated areavpath, the branch path, the
# workarea name, and a boolean indicating whether or not
# the branch and workarea need to be prompted for during
# instantiation (this relies on the fact that this code
# is run multiple times during the instantion process).
#=====================================================================
sub iw_set_area{
my($btag, $watag) =
@_
;
my($avpath, $bpath, $wapath, $skip);
my($iwbpath, $iwwapath) = (__VALUE__("iw_branch"),
__VALUE__("iw_workarea"));
if ((length($iwbpath)) > 0 && (length($iwwapath)) > 0){
$bpath = $iwbpath;
($wapath = $iwwapath) =~ s|^\s*/.*
|;
$wapath =~ s|/\s*$||;
return("$wapath", "$iwbpath", "$wapath", "TRUE");
}
($bpath, $wapath, $avpath) = iw_cleanup_paths(__VALUE__("$btag"),
__VALUE__("$watag"));
return("$avpath", "$bpath", "$wapath", "FALSE");
}
my($iw_area_vpath, $iw_branch_path, $iw_work_area, $iw_skip_branch) =
iw_set_area("branch_path", "work_area");
#======================================================================
# Name: iw_get_mail_cmd
# Args: type - either "iwsend_mail" or "iwsend_servlet_mail"
# addr - 'To:' email address
# Usage: __INSERT__(iw_get_mail_cmd("$type", "$addr"));
# Purpose: This function generates the command statement called
# by the external email notification task.
# Returns: Returns the generated XML string.
# Note: Defaults to iwsend_servlet_mail.ipl unless $type is
# explicitly set to iwsend_mail
#=# (this will hopefully change with the next version of iwsend_mail)
#=# (when that happens, either drop type, or make it a second
#=# [optional] argument, that if set - assumes the program lives in
#=# iw-home/local/bin ?)
#=====================================================================
sub iw_get_mail_cmd {
# NT lacks the ability to bind a script executor with a
# script on a 'shebang' line (eg: #!/blah/blah/iwperl)
# Instead it uses the assoc/ftype mechanism which employs
# the use of environment variables that are not always
# available (cf: IIS's metabasse, which replicates the
# extention-based association scheme on its own). Therefore,
# we need to spoon-feed iwperl the script like this for now:
my($type, $taskName, $addr) =
@_
;
return(sprintf("<command v='%s$iwhome/bin/%s %s'/>",
($^O eq "MSWin32") ? "$iwhome/iw-perl/bin/iwperl " : "",
($type eq "iwsend_mail") ?
"$type.ipl" : "iwsend_servlet_mail.ipl",
($taskName eq "" ) ? $addr: "$taskName $addr"));
}
#=====================================================================
# Name: iw_getrole
# Args: role - basename of a TeamSite role (*.uid) file, or
# similarly constructed customized file in the
# same directory.
# Usage: $html = iw_getrole("master");
# Purpose: Generate an HTML formatted drop-down menu of all
# entries in named file for use within a TAG_info()
# section.
# Returns: Returns the generated drop down list on success, or
# a text field with an error message if it was unable
# to open the file.
#=====================================================================
sub iw_getrole{
my($role) =
@_
;
$role .= ".uid" if ($role !~ /\.uid$/);
my($html) = "";
if (!open(IN, "<$iwhome/conf/roles/$role")){
$html = "<input type='text' value='--Error opening $role--'>";
}
else {
$html = "<select size='1'>\n<option>\n";
foreach (sort(<IN>)){
s/^\s*//gs; s/\s*$//gs;
$html .= "<option>$_\n";
}
close(IN);
$html .= "</select>\n";
}
return($html);
}
#=# (changed reference to renamed subroutine)
my($iw_admin_html) = iw_getrole("admin");
my($iw_masters_html) = iw_getrole("master");
my($iw_authors_html) = iw_getrole("author");
my($iw_editors_html) = iw_getrole("editor");
#=====================================================================
# file list for start task
#=====================================================================
my($iw_selected_files) = iw_get_filelist();
#=====================================================================
# Name: iw_get_filelist
# Args: None.
# Usage: $xml = iw_get_filelist();
# Purpose: Generate an XML formatted list of all the files that
# were pre-selected when the workflow was initiated.
# Returns: Returns the XML formatted list if files were selected.
# Returns an empty string if no files were selected.
# Notes: Sorts the filelist in uuencode form, then html-encodes
# each entry using a library routine - all this using
# the Sambre-Janken transform algorithm
#=====================================================================
sub iw_get_filelist{
my($files) = "";
if (__ELEM__('iw_file')){
my(
@flist)
= map {
TeamSite::CGI_lite::escape_html_data($_);
} sort map {
tr|\\|/|;
s|^\Q$iw_area_vpath\E||;
$_;
} __VALUE__('iw_file');
$files = "<files>\n";
for (my $i = 0; $i <
@flist
; ++$i) {
$files .= "\t<file path='$flist[$i]' comment='task file'/>\n";
}
$files .= "</files>\n";
}
return($files);
}
##############################################################################
# Assigns the current logged in user as the contributor
my $uContributor = __VALUE__('iw_user');
# Assigns the text entered into the textarea as the workflow/job description
my $uDescription = __VALUE__('uDescription');
my $uIWAdmin = "iwadmin";
my $uESOGroup = "eso";
my $uESOGroupEmail = "esoemail";
my $uDescription = __VALUE__('uDescription');
my $cTextArea ="<textarea rows='5' cols='40'></textarea>";
# Variables for the Perl commands for unlocking DCRs, Adding Metadata, and Generating HTM files
my $cValidateDCR = "$iwhome/iw-perl/bin/iwperl $iwhome/custom/bin/validate_DCR_hcsc.ipl";
##############################################################################
# TAG_info section creates the HTML fields that will appear on the form that
# pops up when a workflow is instantiated. The current form will have a
# description area, and a drop down box to specify the ERS reviewer. The
# select box's option values are the reviewers' Unix IDs. The user selected
# will be assigned the ERS Approval User Task in the workflow.
#
# Note: iw_debug_mode used for testing purposes, and should be set to false
# in production.
##############################################################################
TAG_info(
uDescription => [html => "$cTextArea",
is_required => 'true',
label => "Job Description",
error_msg => 'Please enter a description',],
iw_debug_mode => "<input type='hidden' value='false'>",
#iw_output_file => "<input type='text' value='/tmp/ers_debug.xml'>",
);
]]>
</template_script>
<workflow name = "MedicalPolicyApproval" owner = "__INSERT__($uContributor);" creator = "__INSERT__($uContributor);" description = "__INSERT__($uDescription);">
<externaltask lock = "f" name = "Email" owner = "__INSERT__($uContributor);" retry = "t" start = "t" description = "Eso Notification">
__INSERT__("<areavpath v='$iw_area_vpath'/>");
<successors>
<successorset description = "Approval">
<succ v = "Approval"/>
</successorset>
</successors>
<command v = "/usr/iw-home/bin/iw_solution_email.ipl -t 'Approval'"/>
__INSERT__($iw_selected_files);
<variables>
<variable key="iw_mailheader_pt" value="reviewer_iwmailheader.tpl"/>
<variable key="iw_mailbody_pt" value="reviewer_iwmailbody.tpl"/>
</variables>
</externaltask>
<usertask name = "Approval"
owner = "__INSERT__($uContributor);"
readonly = "f"
description = "Please Approve your content, or cancel the submission to staging.">
__INSERT__("<areavpath v='$iw_area_vpath'/>");
<successors>
<successorset description = "Submit to Production">
<succ v = "Unlock"/>
</successorset>
<successorset description = "Cancel Submission to Staging">
<succ v = "Cancel"/>
</successorset>
</successors>
<activation>
<or>
<pred v = "Email"/>
</or>
</activation>
</usertask>
<usertask name = "Cancel"
owner = "__INSERT__($uContributor);"
readonly = "f"
description = "Please verify the accuracy and correctness of the content as it relates to Medical Policies.">
__INSERT__("<areavpath v='$iw_area_vpath'/>");
<successors>
<successorset description = "End">
<succ v = "End"/>
</successorset>
</successors>
<activation>
<pred v = "Approval"/>
</activation>
</usertask>
<externaltask name = "Unlock" owner = "__INSERT__($uContributor);" retry = "t" start = "f" description = "Unlock the DCR for future modifications.">
__INSERT__("<areavpath v='$iw_area_vpath'/>");
<successors>
<successorset description = "Submit">
<succ v = "Submit"/>
</successorset>
</successors>
<command v = "__INSERT__($cValidateDCR);"/>
</externaltask>
<submittask name = "Submit" owner = "__INSERT__($uContributor);" start = "f" unlock = "t" override = "t" skiplocked = "t" description = "submit files" savecomments = "t" skipconflicts = "t">
__INSERT__("<areavpath v='$iw_area_vpath'/>");
<successorset description = "Deploy the files to staging server">
<succ v = "Deploy"/>
</successorset>
<activation>
<or>
<pred v = "Unlock"/>
</or>
</activation>
</submittask>
<!-- Deploy Files here -->
<externaltask name = "Deploy" owner="__INSERT__($uContributor);" retry = "t" start="f" lock="t" description = "Deploy files">
__INSERT__("<areavpath v='$iw_area_vpath'/>");
<successors>
<successorset>
<succ v="Email_file_list"/>
</successorset>
</successors>
<command v = '__INSERT__("/usr/iw-home/iw-perl/bin/iwperl /usr/iw-home/custom/bin/deploy_tx_providers.ipl");' />
</externaltask>
<!-- End of Deploy Files Task -->
<externaltask lock = "f" name = "Email_file_list" owner = "__INSERT__($uIWADmin);" retry = "t" start = "f" description = "Your Content Has Been Submitted">
__INSERT__("<areavpath v='$iw_area_vpath'/>");
<successors>
<successorset description = "End Task">
<succ v = "End"/>
</successorset>
</successors>
<command v = "/usr/iw-home/bin/iwsend_mail.ipl"/>
<variables>
<variable key = "mail_to" value = "__INSERT__($uContributor);"/>
<variable key = "mail_cc" value = "kelly_milligan@bcbsil.com"/>
<variable key = "mail_from" value = "iwadmin@bcbsil.com"/>
<variable key = "mail_subject" value = "Teamsite Notification - DO NOT REPLY TO THIS MESSAGE"/>
<variable key = "mail_message" value = "Your Content has been submitted."/>
<variable key = "mail_url" value = "1"/>
<variable key = "mail_html" value = "1"/>
</variables>
</externaltask>
<endtask name = "End" description = "End of Workflow">
<activation>
<or>
<pred v = "Email_file_list"/>
<pred v = "Cancel"/>
</or>
</activation>
</endtask>
</workflow>
External task perl script:
#!/usr/iw-home/iw-perl/bin/iwperl
# Use OpenDeploy to transfer files to another server.
#
#
# Initialization
use TeamSite::Config;
use TeamSite::WFtask;
use TeamSite::WFworkflow;
my $iwhome = TeamSite::Config::iwgethome();
my $iwmnt = TeamSite::Config::iwgetmount();
my $iwhomeODbin="/usr/od-home/OpenDeployNG/bin";
### Get incoming workflow parameters
my ($wfid, $taskid) =
@ARGV
;
### Log output
my $logfile="$iwhome/local/logs/deploy_tx_providers.ipl.log";
open(LOG, ">>$logfile");
$now=localtime;
print LOG "-" x 80;
my $timenow = `/usr/bin/date`;
print LOG "\nTime now is $timenow\n";
#print LOG "Workflow ID: $wfid\nTask ID: $taskid\n";
### Create workflow objects.
my $job = TeamSite::WFworkflow->new($wfid);
my $task = TeamSite::WFtask->new($taskid);
### Now run OpenDeploy...
print LOG "OpenDeploy process has been triggered on $now\n";
### OpenDeploy config files to use.
##files under BCBSTX Providers Branch,STAGING
my $odconfig = "txprov_to_ispdev";
#call to opendeploy
my $cmd = "$iwhomeODbin/iwodstart $odconfig >>$logfile";
print LOG "cmd = $cmd\n";
$return = system($cmd);
print LOG "return = $return\n";
if ($return==0) {
$now=localtime;
print LOG "OpenDeploy process has completed on $now\n";
}else{
$now=localtime;
print LOG "OpenDeploy process has failed on $now\n";
}
### Return to the workflow
$task->CallBack(0,"Files deployed.");
kellyrmilligan
it was actually not working in that case..it was just not getting a return code and thought it was zero.
kellyrmilligan
and the deployment does not succeed in the case of the weird return code.
kellyrmilligan
does anyone know anything about something called segfault? I searched for the weird return code number, and other people doing things with solaris get this code when something segfaults.
Kelly
nipper
segfault is bad
The process is toast. you may want to search for core files lying around. see if any have a time stamp of when you kicked off a deployment.
Segfaults can be self induced (providing bad parameters, code expects a #, gets an alpha or null), more often it is a code issue, (IW or Solaris), sometimes I have core dumped Perl, but tha tis tough.
Talk to your sys admin, have him fun as root a command like this:
find / -name core -exec ls -l {} \;
that will show all core files on the system, look for time stamps when you ran your WF. Do a file on the core, it will tell what process crashed.
If the process is an IW, recheck your command then call support. If the process is ksh then you have hit a SOlaris Java bug, that is not uncommon when deployments are kicked off via WF. Fixed (I think in SP3/OD 5.6)
ANdy
Adam Stoller
Take a look at
post 18983
- I believe it covers the information regarding the segmentation fault from "too many open files" from the JVM
--fish
(Interwoven Senior Technical Consultant)