[JIRA] (JENKINS-50993) Pipeline-Stage-View Plugin is unable to show stage logs when Splunk Plugin for Jenkins is Enabled

4 views
Skip to first unread message

apurv.raj@ca.com (JIRA)

unread,
Apr 25, 2018, 6:34:02 AM4/25/18
to jenkinsc...@googlegroups.com
Apurv Raj created an issue
 
Jenkins / Bug JENKINS-50993
Pipeline-Stage-View Plugin is unable to show stage logs when Splunk Plugin for Jenkins is Enabled
Issue Type: Bug Bug
Assignee: Sam Van Oort
Components: build-pipeline-plugin, pipeline-stage-view-plugin, splunk-devops-plugin
Created: 2018-04-25 10:33
Environment: Direct Jenkins 2.74 installed via RPM on RHEL 7 64-bit machine;
JDKs installed in the system: JDK8, JDK7, JDK6
Build-Pipeline-Plugin version: 1.5.8
Splunk-Devops-Plugin: 1.6.4
Pipeline-Stage-view-Plugin: 2.9
Labels: Splunk
Priority: Critical Critical
Reporter: Apurv Raj

When the Splunk Plugin and Splunk Plugin Extension (for pipeline jobs) are enabled, the stage logs are missing in the pipeline jobs. This is very simple to recreate:

  1. Install the required plugins so that one can create pipeline jobs. I am assuming Build Pipeline and Pipeline Stage View plugins are good enough.
  2. Install latest Splunk Plugin along with Splunk Plugin Extension. Configure it to be used with one Splunk instance. Now disable that once configuration is done.
  3. Create a simple pipeline job using below mentioned script:

++++++++++++++++++++++++++  

      pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
sendSplunkConsoleLog()
}
stages {
       stage("Build"){
            steps {
                script {
                    currentBuild.displayName = "SAMPLE_PIPELINE"
                    currentBuild.description = "The dummy pipeline job for Splunk"
                }
                echo 'Sample Pipeline for Test'
            }
        }
  stage("Deploy"){
            steps {
                 echo 'Sample Pipeline Deployed'
            }
        }
  stage("Testing"){
            steps {
                 echo 'Sample Pipeline Tested'
            }
        }
}
}

++++++++++++++++++++++++++++++++++++++++++++

4. Trigger the sample pipeline created above. Hover over build or deploy or testing stages in the pipeline stage view and you will get logs link. Clicking on the link, you will get appropriate log message as mentioned above in the pipeline script.

5. Now enable the Splunk plugin from <Jenkins_url>/configure page.

6. Again trigger the sample pipeline. This time when you click on the stage log link, you will not see the respective log messages as per the build stage.

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

apurv.raj@ca.com (JIRA)

unread,
Apr 25, 2018, 6:44:01 AM4/25/18
to jenkinsc...@googlegroups.com

apurv.raj@ca.com (JIRA)

unread,
Apr 25, 2018, 6:44:02 AM4/25/18
to jenkinsc...@googlegroups.com

apurv.raj@ca.com (JIRA)

unread,
Apr 25, 2018, 6:45:02 AM4/25/18
to jenkinsc...@googlegroups.com

apurv.raj@ca.com (JIRA)

unread,
Apr 25, 2018, 6:45:02 AM4/25/18
to jenkinsc...@googlegroups.com

apurv.raj@ca.com (JIRA)

unread,
Apr 25, 2018, 6:45:03 AM4/25/18
to jenkinsc...@googlegroups.com

svanoort@cloudbees.com (JIRA)

unread,
Apr 25, 2018, 9:20:02 AM4/25/18
to jenkinsc...@googlegroups.com

svanoort@cloudbees.com (JIRA)

unread,
Apr 25, 2018, 9:30:02 AM4/25/18
to jenkinsc...@googlegroups.com

svanoort@cloudbees.com (JIRA)

unread,
Apr 25, 2018, 9:32:03 AM4/25/18
to jenkinsc...@googlegroups.com

svanoort@cloudbees.com (JIRA)

unread,
Apr 25, 2018, 9:34:01 AM4/25/18
to jenkinsc...@googlegroups.com
Sam Van Oort commented on Bug JENKINS-50993
 
Re: Pipeline-Stage-View Plugin is unable to show stage logs when Splunk Plugin for Jenkins is Enabled

This is an issue with the Splunk Devops plugin, not Stage View – Stage View just does a fetch-from-disk for the logfile associated with a FlowNode. If logs do not show up with the Splunk DevOps plugin enabled, something that plugin is doing is messing with the normal logging process.

Ted Please can you take a look? Thanks.

svanoort@cloudbees.com (JIRA)

unread,
Apr 25, 2018, 9:35:02 AM4/25/18
to jenkinsc...@googlegroups.com

svanoort@cloudbees.com (JIRA)

unread,
Apr 25, 2018, 9:35:02 AM4/25/18
to jenkinsc...@googlegroups.com

xiao.xj@outlook.com (JIRA)

unread,
May 2, 2018, 1:50:02 AM5/2/18
to jenkinsc...@googlegroups.com
Ted commented on Bug JENKINS-50993
 
Re: Pipeline-Stage-View Plugin is unable to show stage logs when Splunk Plugin for Jenkins is Enabled

I think it is related to state view caching.
the ID.log is created on disk and can be viewed by "pipeline steps" (flowGraphTable) -> Select step -> Select Log

The stage view log only works if
1) rename the job to another folder using the same name
2) restart jenkins

What "sendSplunkConsoleLog" does is

        @Override
        public boolean start() throws Exception {
            //refer to WithContextStep implementation
            StepContext context = getContext();
            Run run = context.get(Run.class);
            ConsoleLogFilter filter = BodyInvoker.mergeConsoleLogFilters(context.get(ConsoleLogFilter.class), new TeeConsoleLogFilter(run));
            context.newBodyInvoker().withContext(filter).withCallback(BodyExecutionCallback.wrap(context)).start();
            return false;
        }

xiao.xj@outlook.com (JIRA)

unread,
May 2, 2018, 3:08:02 AM5/2/18
to jenkinsc...@googlegroups.com
Ted updated an issue
 
Change By: Ted
Attachment: Screen Shot 2018-05-02 at 3.06.03 PM.png

xiao.xj@outlook.com (JIRA)

unread,
May 2, 2018, 3:08:03 AM5/2/18
to jenkinsc...@googlegroups.com
Ted commented on Bug JENKINS-50993
 
Re: Pipeline-Stage-View Plugin is unable to show stage logs when Splunk Plugin for Jenkins is Enabled

log link is missing although LogActionImpl is in xml

The xml is

more 15.xml
<?xml version='1.1' encoding='UTF-8'?>
<Tag plugin="workflow...@2.18">
  <node class="cps.n.StepAtomNode" plugin="workfl...@2.45">
    <parentIds>
      <string>14</string>
    </parentIds>
    <id>15</id>
    <descriptorId>org.jenkinsci.plugins.workflow.steps.EchoStep</descriptorId>
  </node>
  <actions>
    <wf.a.TimingAction plugin="workfl...@2.25">
      <startTime>1525244349821</startTime>
    </wf.a.TimingAction>
    <s.a.LogActionImpl>
      <charset>UTF-8</charset>
    </s.a.LogActionImpl>
    <cps.a.ArgumentsActionImpl plugin="workfl...@2.45">
      <arguments class="linked-hash-map">
        <entry>
          <string>message</string>
          <string>Sample Pipeline for Test</string>
        </entry>
      </arguments>
      <isUnmodifiedBySanitization>true</isUnmodifiedBySanitization>
    </cps.a.ArgumentsActionImpl>
  </actions>
</Tag>

xiao.xj@outlook.com (JIRA)

unread,
May 2, 2018, 3:12:02 AM5/2/18
to jenkinsc...@googlegroups.com

xiao.xj@outlook.com (JIRA)

unread,
May 2, 2018, 5:44:03 AM5/2/18
to jenkinsc...@googlegroups.com

xiao.xj@outlook.com (JIRA)

unread,
May 2, 2018, 5:51:02 AM5/2/18
to jenkinsc...@googlegroups.com
Ted edited a comment on Bug JENKINS-50993
 
Re: Pipeline-Stage-View Plugin is unable to show stage logs when Splunk Plugin for Jenkins is Enabled
LogActionImpl does exist in workflow xml

1) The
log link is missing although LogActionImpl is in xml if called by  {color:red}runs?fullStages=true{color}&_=1525254291848
2)  The log link can be retrieved via individual rest api, such as /job/debug/job/stage_view_debug/9/execution/node/15/wfapi/describe

!Screen Shot 2018-05-02 at 3.06.03 PM.png!

The xml is
{code}
{code}

xiao.xj@outlook.com (JIRA)

unread,
May 2, 2018, 5:52:02 AM5/2/18
to jenkinsc...@googlegroups.com
Ted edited a comment on Bug JENKINS-50993
LogActionImpl does exist in workflow xml

1) The log link is missing if called by  {color:red}runs?fullStages=true{color}&_=1525254291848
2)  The log link can be retrieved via individual rest api, such as /job/debug/job/stage_view_debug/
9 7 /execution/node/15/wfapi/describe

xiao.xj@outlook.com (JIRA)

unread,
May 2, 2018, 5:53:01 AM5/2/18
to jenkinsc...@googlegroups.com

apurv.raj@ca.com (JIRA)

unread,
Sep 24, 2018, 1:51:03 AM9/24/18
to jenkinsc...@googlegroups.com
Apurv Raj updated an issue
 
Change By: Apurv Raj
Priority: Critical Blocker
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

apurv.raj@ca.com (JIRA)

unread,
Sep 24, 2018, 1:53:02 AM9/24/18
to jenkinsc...@googlegroups.com
Apurv Raj commented on Bug JENKINS-50993
 
Re: Pipeline-Stage-View Plugin is unable to show stage logs when Splunk Plugin for Jenkins is Enabled

I dont see any action on this issue. Raising the priority to blocker as becasue of this issue, we are unable to use Jenkins App in Splunk. We should try to get this fixed asap.

svanoort@cloudbees.com (JIRA)

unread,
Sep 24, 2018, 12:51:24 PM9/24/18
to jenkinsc...@googlegroups.com

Apurv Raj Have you tried the Stage View 2.10 upgrade? This looks like it may be a URL generation quirk somehow triggered by something the Splunk Plugin does – the 2.10 update includes at least some fixes to URL generation logic in Stage View.

xiao.xj@outlook.com (JIRA)

unread,
May 23, 2019, 8:02:02 AM5/23/19
to jenkinsc...@googlegroups.com
Ted updated Bug JENKINS-50993
 

fixed in splunk-devops 1.7.1

Change By: Ted
Status: Open Fixed but Unreleased
Resolution: Fixed

xiao.xj@outlook.com (JIRA)

unread,
May 23, 2019, 8:02:02 AM5/23/19
to jenkinsc...@googlegroups.com

xiao.xj@outlook.com (JIRA)

unread,
May 23, 2019, 8:03:03 AM5/23/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages