continuum-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent N Atkinson (JIRA)" <>
Subject [jira] (CONTINUUM-1965) Can't view build log is build is cancel because of timeout
Date Fri, 13 Feb 2015 18:20:18 GMT


Brent N Atkinson commented on CONTINUUM-1965:

I took a look at the history and it appears that multiple issues are in play.

1.) {{DefaultShellCommandHelper}}, which is responsible for executing the actual command line
and gathering output, did not properly close the writer it used to capture build output. When
exceptions were thrown during shell execution, the file contents are not written to the filesystem.

        Writer writer = new FileWriter( output );

        StreamConsumer consumer = new WriterStreamConsumer( writer );

        int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, consumer );  //
Exception thrown!!!


        writer.close();  // Never called, so the file system is never updated and the contents
are lost

2.) {{ExecuteBuilderContinuumAction#execute}}, which delegates to {{DefaultShellCommandHelper}}
to run the actual shell commands, handled exceptions differently than command failure or success.

            notifier.runningGoals( project, buildDefinition, buildResult );

            File buildOutputFile = configurationService.getBuildOutputFile( buildResult.getId(),
project.getId() );

            ContinuumBuildExecutionResult result = project, buildDefinition,
buildOutputFile );  // Exception thrown!!!

            buildResult.setState( result.getExitCode() == 0 ? ContinuumProjectState.OK : ContinuumProjectState.FAILED

            buildResult.setExitCode( result.getExitCode() );
        catch ( Throwable e )
            getLogger().error( "Error running buildResult", e );

            buildResult.setState( ContinuumProjectState.ERROR );  // Result is set to error,
not failed or ok

            buildResult.setError( ContinuumUtils.throwableToString( e ) ); // Error message
is the stack trace from the throwable

When the cancel exception is thrown, the build result is set by the exception handler to ERROR
and the message is the stack trace. This is consistent with the observed behavior, if this
message is displayed rather than the build output (which is unavailable since it is never

3.) It turns out that if the build output file existed, both the result (ERROR) and the actual
output would be available for display. However, due to 1.) the file contents are always going
to be missing. This may have lead to the behavior given in {{buildResult.jsp}}:

        <ww:if test="buildResult.state == 4">
          <!-- If the build result is ERROR, just show the message (the stack trace) -->
          <h4><ww:text name="buildResult.buildError"/></h4>
          <div style="width:100%; height:500px; overflow:auto; border-style: solid; border-width:
            <pre><ww:property value="buildResult.error"/></pre>
          <!-- otherwise, show a 'No Output' message or the file contents (which never
exist) -->
          <h4><ww:text name="buildResult.buildOutput"/></h4>
            <ww:if test="buildOutput == ''">
                <ww:text name="buildResult.noOutput"/>
              <ww:url id="buildOutputTextUrl" action="buildOutputText">
                <ww:param name="projectId" value="projectId"/>
                <ww:param name="buildId" value="buildId"/>
              <ww:a href="%{buildOutputTextUrl}"><ww:text name="buildResult.buildOutput.text"/></ww:a>
              <div style="width:100%; height:500px; overflow:auto; border-style: solid;
border-width: 1px">
                <pre><ww:property value="buildOutput"/></pre>

As the comments highlight above, the observed behavior is fully visible: when the result is
caused by an exception show the stack trace and nothing else. 

By fixing the file handling (addressed in 1.5) and changing the conditionals to always show
information if it is available (both error and build output), the diagnostic information should
be greatly improved for these cases.

> Can't view build log is build is cancel because of timeout
> ----------------------------------------------------------
>                 Key: CONTINUUM-1965
>                 URL:
>             Project: Continuum
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>         Environment: Ubuntu8.04/tomcat6
>            Reporter: Luc Willems
>            Assignee: Wendy Smoak
>         Attachments: build-result-screen-showing-build-error-rather-than-output.jpg
> I have some site-deploy build targets that for some unkown reason take a long time (>
1 hr)
> mij default build timeout is set to 1 hr
> when the build is cancel because of time out i see this error :
> org.apache.maven.continuum.execution.ContinuumBuildCancelledException: The build was
>         at org.apache.maven.continuum.execution.AbstractBuildExecutor.executeShellCommand(
>         at
>         at org.apache.maven.continuum.core.action.ExecuteBuilderContinuumAction.execute(
>         at org.apache.maven.continuum.buildcontroller.DefaultBuildController.performAction(
>         at
>         at org.apache.maven.continuum.buildcontroller.BuildProjectTaskExecutor.executeTask(
>         at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$
>         at$
>         at
>         at
>         at$
>         at
> Caused by: org.codehaus.plexus.util.cli.CommandLineException: Error while executing external
command, process killed.
>         at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine(
>         at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine(
>         at
>         at
>         at org.apache.maven.continuum.execution.AbstractBuildExecutor.executeShellCommand(
>         ... 11 more
> Caused by: java.lang.InterruptedException
> This is normal but i would also like to see the build log to verify why it was taken
so long.
>  note : this is a multi module build (flex/java) with about 20 modules.

This message was sent by Atlassian JIRA

View raw message