-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: splunk-devops-plugin
-
None
When the Jenkins controller is configured with org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep.USE_WATCHING=true (https://www.jenkins.io/doc/book/managing/system-properties/#org-jenkinsci-plugins-workflow-steps-durable_task-durabletaskste-1), pipeline logs from durable tasks, like sh, are pushed from the agent to the controller rather than being pulled by the controller from the agent. While troubleshooting this scenario, I found that the Splunk plugin fails to send those logs to the Splunk server under this configuration if we don't enable the global option Send All Pipeline Console Logs.
This is happening because in this case the SplunkConsoleTaskListenerDecorator is being initialized without the remoteSplunkConfig (at SplunkConsoleLogStep#start). If we enable the global option Send All Pipeline Console Logs, it will work, because the SplunkConsoleTaskListenerDecorator for that pipeline execution will be created with the remoteSplunkConfig SplunkTaskListenerFactory .
Â
Steps for reproduction:
- Run Jenkins with the JAVA option  -Dorg.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep.USE_WATCHING=true (it was tested with the version 2.542)
- Install plugins splunk-devops and splunk-devops andÂ
splunk-devops-extend version 1.11.0 - Set up Splunk configuration without enabling the option Send All Pipeline Console Logs.
- Set up an static agent
- Run a job with options sendSplunkConsoleLog() and a sh step, for example:
pipeline {
  agent {
    label 'static-agent'
  }  Â
  options {
    sendSplunkConsoleLog()
  }
  stages {
    stage('Hello') {
      steps {
        sh 'echo "Hello World"'
      }
    }
  }
}