[JIRA] (JENKINS-59788) Timestamps missing for agent-based steps in Pipeline Job 2.190.1

0 views
Skip to first unread message

ljubisa.punosevac@sap.com (JIRA)

unread,
Oct 15, 2019, 5:48:03 AM10/15/19
to jenkinsc...@googlegroups.com
Ljubisa Punosevac created an issue
 
Jenkins / Bug JENKINS-59788
Timestamps missing for agent-based steps in Pipeline Job 2.190.1
Issue Type: Bug Bug
Assignee: Steven G Brown
Components: timestamper-plugin
Created: 2019-10-15 09:47
Priority: Critical Critical
Reporter: Ljubisa Punosevac

 

A Pipeline example you can use to reproduce this problem is given below. You might adjust it a bit in order to fit your environment:

  • withMaven step needs to be adjusted
  • agent label we are using for our slaves is large so you might want to change that accordingly
pipeline {
   agent {
      label 'large'
   }
   options {
      ansiColor('xterm')
      timestamps()
      timeout(time: 4, unit: 'HOURS')
   }
   stages {
      stage('Preparation') {
         steps {
            script {
               // for display purposes
               // Get some code from a GitHub repository
               git 'https://github.com/jglick/simple-maven-project-with-tests.git'
            }
         }
      }
      stage('Build') {
         steps {
            script {
               // Run the maven build
               withMaven(
                  mavenLocalRepo: '.repository',
                  mavenSettingsConfig: 'tool-maven-ro',
                  jdk: 'sapjvm-8',
                  publisherStrategy: 'EXPLICIT',
                  options: [
                     artifactsPublisher(disabled: false),
                     dependenciesFingerprintPublisher(disabled: false),
                     junitPublisher(disabled: false)
                  ]
               ) {
                  sh 'mvn  -Dmaven.test.failure.ignore clean package'
               }

            }
         }
      }
      stage('Results') {
         steps {
            junit '**/target/surefire-reports/TEST-*.xml'
            archiveArtifacts 'target/*.jar'
         }
      }
   }
}
 

Log snippet from master looks like this:

11:25:04  Seen branch in repository origin/master
11:25:04  Seen 1 remote branch
11:25:04   > git show-ref --tags -d # timeout=10
11:25:04  Checking out Revision fbe787fbf5b8fce670b4401b2d348ff7a4357160 (origin/master)
11:25:04   > git config core.sparsecheckout # timeout=10
11:25:04   > git checkout -f fbe787fbf5b8fce670b4401b2d348ff7a4357160
11:25:04  Commit message: "first commit"
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] script
[Pipeline] {
[Pipeline] withMaven
11:25:04  [withMaven] Options: [org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher[disabled=false], org.jenkinsci.plugins.pipeline.maven.publishers.DependenciesFingerprintPublisher[disabled=false, scopes=[compile, provided, runtime], versions={snapshot:true, release:false}], JunitTestsPublisher[disabled=false,healthScaleFactor=,keepLongStdio=false,ignoreAttachments=false]]
11:25:04  [withMaven] Available options: 
11:25:04  [withMaven] using JDK installation sapjvm-8
11:25:04  $ /bin/sh -c "which mvn"
11:25:04  [withMaven] using Maven installation provided by the build agent with executable /usr/local/bin/mvn
[Pipeline] {
[Pipeline] sh
11:25:05  + mvn -Dmaven.test.failure.ignore clean package
11:25:05  ----- withMaven Wrapper script -----
11:25:05  Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
11:25:05  Maven home: /usr/local/maven
11:25:05  Java version: 1.8.0_77, vendor: SAP AG, runtime: /usr/lib/jvm/sapjvm_8/jre
11:25:05  Default locale: en_US, platform encoding: ANSI_X3.4-1968
11:25:05  OS name: "linux", version: "4.14.138+", arch: "amd64", family: "unix"
11:25:05  [INFO] [jenkins-event-spy] Generate /srv/jenkins/workspace/test pipeline@tmp/withMaven3fe3ef73/maven-spy-20191015-092505-8403902332112577080839.log.tmp ...
11:25:06  [INFO] Scanning for projects...
11:25:06  [INFO] 
11:25:06  [INFO] ----------------< test:simple-maven-project-with-tests >----------------
11:25:06  [INFO] Building simple-maven-project-with-tests 1.0-SNAPSHOT
11:25:06  [INFO] --------------------------------[ jar ]---------------------------------

Same log snipped when pipeline is executed on slave looks line this:

Checking out Revision fbe787fbf5b8fce670b4401b2d348ff7a4357160 (origin/master)
Commit message: "first commit"
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] script
[Pipeline] {
[Pipeline] withMaven
[withMaven] Options: [org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher[disabled=false], org.jenkinsci.plugins.pipeline.maven.publishers.DependenciesFingerprintPublisher[disabled=false, scopes=[compile, provided, runtime], versions={snapshot:true, release:false}], JunitTestsPublisher[disabled=false,healthScaleFactor=,keepLongStdio=false,ignoreAttachments=false]]
[withMaven] Available options: 
[withMaven] using JDK installation sapjvm-8
$ /bin/sh -c "which mvn"
[withMaven] using Maven installation provided by the build agent with executable /usr/bin/mvn
[Pipeline] {
[Pipeline] sh
+ mvn -Dmaven.test.failure.ignore clean package
----- withMaven Wrapper script -----
Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/var/lib/jenkins/workspace/test pipeline@tmp/withMaven805d1277/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/var/lib/jenkins/workspace/test pipeline@tmp/withMaven805d1277" 
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T15:06:16Z)
Maven home: /usr/share/maven
Java version: 1.8.0_221, vendor: SAP AG, runtime: /usr/lib/jvm/sapjvm_8/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "4.14.138+", arch: "amd64", family: "unix"
Seen branch in repository origin/master
Seen 1 remote branch
 > git show-ref --tags -d # timeout=10
 > git config core.sparsecheckout # timeout=10
 > git checkout -f fbe787fbf5b8fce670b4401b2d348ff7a4357160
[INFO] [jenkins-event-spy] Generate /var/lib/jenkins/workspace/test pipeline@tmp/withMaven805d1277/maven-spy-20191015-093038-6193675996080952171854.log.tmp ...
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< test:simple-maven-project-with-tests >----------------
[INFO] Building simple-maven-project-with-tests 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

ljubisa.punosevac@sap.com (JIRA)

unread,
Oct 15, 2019, 5:52:02 AM10/15/19
to jenkinsc...@googlegroups.com
Ljubisa Punosevac updated an issue
Change By: Ljubisa Punosevac
This problem still prevails on Jenkins ver. 2.190.1 and timestamper version 1.10.
I tried also older versions of this plugin for which has been written in thicket JENKINS-54081 to work, but again with the same results.
Also, the following option has been set on Jenkins master as JVM parameter:
{{code}}
-Dorg.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep.USE_WATCHING=false
 
{{code}}
as described in JENKINS-54081 but again with the same outcome.

A Pipeline example you can use to reproduce this problem is given below. You might adjust it a bit in order to fit your environment:
* {{withMaven}} step needs to be adjusted
* {{agent}} label we are using for our slaves is {{large}} so you might want to change that accordingly

{code:java}
{code}


Log snippet from master looks like this:
{code}
{code}


Same log snipped when pipeline is executed on slave looks line this:
{code}
{code}

ljubisa.punosevac@sap.com (JIRA)

unread,
Oct 15, 2019, 5:59:02 AM10/15/19
to jenkinsc...@googlegroups.com
Same log snipped when pipeline is executed on slave looks line like this:

ljubisa.punosevac@sap.com (JIRA)

unread,
Oct 15, 2019, 8:06:02 AM10/15/19
to jenkinsc...@googlegroups.com
Ljubisa Punosevac updated an issue
Change By: Ljubisa Punosevac
Attachment: Screenshot 2019-10-15 at 14.04.34.png
Attachment: Screenshot 2019-10-15 at 14.04.14.png

ljubisa.punosevac@sap.com (JIRA)

unread,
Oct 15, 2019, 8:07:03 AM10/15/19
to jenkinsc...@googlegroups.com
Ljubisa Punosevac updated an issue
Same log snipped when pipeline is executed on slave looks like this:


All installed Pipeline related plugins and their versions you can see in the attached screenshots.

ljubisa.punosevac@sap.com (JIRA)

unread,
Oct 15, 2019, 8:20:03 AM10/15/19
to jenkinsc...@googlegroups.com
Ljubisa Punosevac updated an issue
Change By: Ljubisa Punosevac
Attachment: Screenshot 2019-10-15 at 14.04.34.png

ljubisa.punosevac@sap.com (JIRA)

unread,
Oct 15, 2019, 8:20:03 AM10/15/19
to jenkinsc...@googlegroups.com
Ljubisa Punosevac updated an issue
All installed Pipeline related List of plugins and their versions you can see version is listed below:
{code}
PrioritySorter: 3.6.0 (Priority Sorter Plugin)
ace-editor: 1.1 (JavaScript GUI Lib: ACE Editor bundle plugin)
ansicolor: 0.6.2 (AnsiColor)
antisamy-markup-formatter: 1.6 (OWASP Markup Formatter Plugin)
apache-httpcomponents-client-4-api: 4.5.10-1.0 (Apache HttpComponents Client 4.x API Plugin)
authentication-tokens: 1.3 (Authentication Tokens API Plugin)
blueocean: 1.19.0 (Blue Ocean)
blueocean-autofavorite: 1.2.4 (Autofavorite for Blue Ocean)
blueocean-bitbucket-pipeline: 1.19.0 (Bitbucket Pipeline for Blue Ocean)
blueocean-commons: 1.19.0 (Common API for Blue Ocean)
blueocean-config: 1.19.0 (Config API for Blue Ocean)
blueocean-core-js: 1.19.0 (Blue Ocean Core JS)
blueocean-dashboard: 1.19.0 (Dashboard for Blue Ocean)
blueocean-display-url: 2.3.0 (Display URL for Blue Ocean)
blueocean-events: 1.19.0 (Events API for Blue Ocean)
blueocean-executor-info: 1.19.0 (Blue Ocean Executor Info)
blueocean-git-pipeline: 1.19.0 (Git Pipeline for Blue Ocean)
blueocean-github-pipeline: 1.19.0 (GitHub Pipeline for Blue Ocean)
blueocean-i18n: 1.19.0 (i18n for Blue Ocean)
blueocean-jira: 1.19.0 (JIRA Integration for Blue Ocean)
blueocean-jwt: 1.19.0 (JWT for Blue Ocean)
blueocean-personalization: 1.19.0 (Personalization for Blue Ocean)
blueocean-pipeline-api-impl: 1.19.0 (Pipeline implementation for Blue Ocean)
blueocean-pipeline-editor: 1.19.0 (Blue Ocean Pipeline Editor)
blueocean-pipeline-scm-api: 1.19.0 (Pipeline SCM API for Blue Ocean)
blueocean-rest: 1.19.0 (REST API for Blue Ocean)
blueocean-rest-impl: 1.19.0 (REST Implementation for Blue Ocean)
blueocean-web: 1.19.0 (Web for Blue Ocean)
bouncycastle-api: 2.17 (bouncycastle API Plugin)
branch-api: 2.5.4 (Branch API Plugin)
build-with-parameters: 1.4 (Build With Parameters)
cloudbees-bitbucket-branch-source: 2.5.0 (Bitbucket Branch Source Plugin)
cloudbees-folder: 6.9 (Folders Plugin)
command-launcher: 1.3 (Command Agent Launcher Plugin)
config-file-provider: 3.6.2 (Config File Provider Plugin)
credentials: 2.3.0 (Credentials Plugin)
credentials-binding: 1.20 (Credentials Binding Plugin)
display-url-api: 2.3.2 (Display URL API)
docker-commons: 1.15 (Docker Commons Plugin)
docker-workflow: 1.19 (Docker Pipeline)
durable-task: 1.30 (Durable Task Plugin)
extended-choice-parameter: 0.78 (Extended Choice Parameter Plug-In)
external-monitor-job: 1.7 (External Monitor Job Type Plugin)
favorite: 2.3.2 (Favorite)
file-operations: 1.7 (File Operations Plugin)
git: 3.12.1 (Git plugin)
git-client: 2.8.6 (Git client plugin)
git-server: 1.8 (GIT server Plugin)
github: 1.29.4 (GitHub plugin)
github-api: 1.95 (GitHub API Plugin)
github-branch-source: 2.5.8 (GitHub Branch Source Plugin)
google-metadata-plugin: 0.2 (Google Metadata plugin)
google-oauth-plugin: 0.9 (Google OAuth Credentials plugin)
google-storage-plugin: 1.4.0 (Google Cloud Storage plugin)
gradle: 1.34 (Gradle Plugin)
greenballs: 1.15 (Green Balls)
groovy: 2.2 (Groovy)
h2-api: 1.4.199 (H2 API Plugin)
handlebars: 1.1.1 (JavaScript GUI Lib: Handlebars bundle plugin)
handy-uri-templates-2-api: 2.1.7-1.0 (Handy Uri Templates 2.x API Plugin)
htmlpublisher: 1.21 (HTML Publisher plugin)
jackson2-api: 2.9.10 (Jackson 2 API Plugin)
javadoc: 1.5 (Javadoc Plugin)
jaxb: 2.3.0.1 (JAXB plugin)
jdk-tool: 1.3 (Oracle Java SE Development Kit Installer Plugin)
jenkins-design-language: 1.19.0 (Design Language)
jira: 3.0.10 (JIRA plugin)
job-dsl: 1.76 (Job DSL)
jquery: 1.12.4-1 (jQuery plugin)
jquery-detached: 1.2.1 (JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin)
jsch: 0.1.55.1 (JSch dependency plugin)
junit: 1.28 (JUnit Plugin)
junit-attachments: 1.6 (JUnit Attachments Plugin)
kubernetes: 1.19.3 (Kubernetes plugin)
kubernetes-client-api: 4.6.0-2 (Kubernetes Client API Plugin)
kubernetes-credentials: 0.4.1 (Kubernetes Credentials Plugin)
ldap: 1.20 (LDAP Plugin)
lockable-resources: 2.5 (Lockable Resources plugin)
logfilesizechecker: 1.5 (build log file size checker plugin)
login-theme: 1.0 (Login Theme Plugin)
m2release: 0.15.0 (Maven Release Plug-
in the attached screenshots Plug-in)
mailer: 1
. 28 (Mailer Plugin)
matrix-auth: 2.4.2 (Matrix Authorization Strategy Plugin)
matrix-project: 1.14 (Matrix Project Plugin)
maven-plugin: 3.4 (Maven Integration plugin)
mercurial: 2.8 (Mercurial plugin)
metrics: 4.0.2.6 (Metrics Plugin)
momentjs: 1.1.1 (JavaScript GUI Lib: Moment.js bundle plugin)
multiple-scms: 0.6 (Multiple SCMs plugin)
oauth-credentials: 0.3 (OAuth Credentials plugin)
pam-auth: 1.5.1 (PAM Authentication plugin)
pipeline-build-step: 2.9 (Pipeline: Build Step)
pipeline-graph-analysis: 1.10 (Pipeline Graph Analysis Plugin)
pipeline-input-step: 2.11 (Pipeline: Input Step)
pipeline-maven: 3.8.1 (Pipeline Maven Integration Plugin)
pipeline-milestone-step: 1.3.1 (Pipeline: Milestone Step)
pipeline-model-api: 1.3.9 (Pipeline: Model API)
pipeline-model-declarative-agent: 1.1.1 (Pipeline: Declarative Agent API)
pipeline-model-definition: 1.3.9 (Pipeline: Declarative)
pipeline-model-extensions: 1.3.9 (Pipeline: Declarative Extension Points API)
pipeline-rest-api: 2.12 (Pipeline: REST API Plugin)
pipeline-stage-step: 2.3 (Pipeline: Stage Step)
pipeline-stage-tags-metadata: 1.3.9 (Pipeline: Stage Tags Metadata)
pipeline-stage-view: 2.12 (Pipeline: Stage View Plugin)
pipeline-utility-steps: 2.3.1 (Pipeline Utility Steps)
plain-credentials: 1.5 (Plain Credentials Plugin)
prometheus: 2.0.6 (Prometheus metrics plugin)
pubsub-light: 1.13 (Pub-Sub "light" Bus)
rebuild: 1.31 (Rebuilder)
resource-disposer: 0.13 (Resource Disposer Plugin)
saml: 1.1.3 (SAML Plugin)
scm-api: 2.6.3 (SCM API Plugin)
script-security: 1.65 (Script Security Plugin)
sse-gateway: 1.20 (Server Sent Events (SSE) Gateway Plugin)
ssh-credentials: 1.17.2 (SSH Credentials Plugin)
startup-trigger-plugin: 2.9.3 (Startup Trigger)
structs: 1.20 (Structs Plugin)
swarm: 3.17 (Self-Organizing Swarm Plug-in Modules)
timestamper: 1.10 (Timestamper)
token-macro: 2.8 (Token Macro Plugin)
translation: 1.16 (Translation Assistance plugin)
trilead-api: 1.0.4 (Trilead API Plugin)
validating-string-parameter: 2.4 (Validating String Parameter Plugin)
variant: 1.3 (Variant Plugin)
windows-slaves: 1.4 (WMI Windows Agents Plugin)
workflow-aggregator: 2.6 (Pipeline)
workflow-api: 2.37 (Pipeline: API)
workflow-basic-steps: 2.18 (Pipeline: Basic Steps)
workflow-cps: 2.74 (Pipeline: Groovy)
workflow-cps-global-lib: 2.16-cache-alpha-v1 (Pipeline: Shared Groovy Libraries)
workflow-durable-task-step: 2.34 (Pipeline: Nodes and Processes)
workflow-job: 2.35 (Pipeline: Job)
workflow-multibranch: 2.21 (Pipeline: Multibranch)
workflow-scm-step: 2.9 (Pipeline: SCM Step)
workflow-step-api: 2.20 (Pipeline: Step API)
workflow-support: 3.3 (Pipeline: Supporting APIs)
ws-cleanup: 0.37 (Workspace Cleanup Plugin)
xvfb: 1.1.3 (Xvfb plugin)
{code}

and shared cache library is built from this PR: https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/85

Best,
Ljubisa.

ljubisa.punosevac@sap.com (JIRA)

unread,
Oct 15, 2019, 8:20:03 AM10/15/19
to jenkinsc...@googlegroups.com
Ljubisa Punosevac updated an issue
Change By: Ljubisa Punosevac
Attachment: Screenshot 2019-10-15 at 14.04.14.png

jglick@cloudbees.com (JIRA)

unread,
Oct 16, 2019, 10:55:03 AM10/16/19
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-59788
 
Re: Timestamps missing for agent-based steps in Pipeline Job 2.190.1

Explicitly setting USE_WATCHING=false is irrelevant—that is the default.

jglick@cloudbees.com (JIRA)

unread,
Oct 16, 2019, 12:56:03 PM10/16/19
to jenkinsc...@googlegroups.com

Just tried it. I get timestamps for all lines, though display is corrupted on lines which have also have an attempt to apply coloring by the withMaven step, which I think would be better suppressed in favor of the ansicolor plugin and

MAVEN_OPTS=-Djansi.force=true mvn -B -Dstyle.color=always …

jglick@cloudbees.com (JIRA)

unread,
Oct 16, 2019, 12:56:04 PM10/16/19
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
 
Change By: Jesse Glick
Component/s: pipeline-maven-plugin

jglick@cloudbees.com (JIRA)

unread,
Oct 16, 2019, 12:56:05 PM10/16/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Unassigned
Change By: Jesse Glick
Assignee: Steven G Brown

jglick@cloudbees.com (JIRA)

unread,
Oct 16, 2019, 12:56:05 PM10/16/19
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Oct 16, 2019, 12:56:07 PM10/16/19
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Oct 16, 2019, 12:58:04 PM10/16/19
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
Change By: Jesse Glick
Attachment: colorized.png
Attachment: mangled-timestamps.png

jglick@cloudbees.com (JIRA)

unread,
Oct 16, 2019, 1:03:02 PM10/16/19
to jenkinsc...@googlegroups.com
 
Re: Timestamps missing for agent-based steps in Pipeline Job 2.190.1

In other words, I can reproduce a minor bug somewhere in interaction between timestamper, ansicolor, and pipeline-maven, but not the absence of any timestamps that you report. Would be best to describe a minimal, self-contained, reproducible test case.

lj_2005@163.com (JIRA)

unread,
Oct 28, 2019, 10:49:02 PM10/28/19
to jenkinsc...@googlegroups.com
Joe Lee commented on Bug JENKINS-59788

we meet this issue as well with same 2.190.1 and timestamper version 1.10

 

adam.gabrys@live.com (JIRA)

unread,
Nov 21, 2019, 8:24:04 AM11/21/19
to jenkinsc...@googlegroups.com

This is the simplest possible pipeline to reproduce:

pipeline {
   agent {
      label 'tiny'
   }
   options {
      timestamps()
   }
   stages {
       stage('loop') {
           steps {
               sh '''
                    while true;
                    do
                        echo 'line'
                        sleep 3
                    done
               '''
           }
       }
   }
}

I see no timestamps in logs:

Started by user Gabrys, Adam
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Agent zjs-agabrys-tiny-qtc0t is provisioned from template Kubernetes Pod Template
Running on zjs-agabrys-tiny-qtc0t in /var/lib/jenkins/workspace/test
[Pipeline] {
[Pipeline] timestamps
[Pipeline] {
[Pipeline] stage
[Pipeline] { (loop)
[Pipeline] sh
+ true
+ echo line
line
+ sleep 3
+ true
+ echo line
line
+ sleep 3
+ true

Luckily, we found the new option available Manage Jenkins → Configure System → Timestamper: Enabled for all Pipeline builds. I enabled it, removed {{options { timestamps() }}} from Jenkinsfile and this is the result:

14:12:42  Started by user Gabrys, Adam
14:12:42  Running in Durability level: MAX_SURVIVABILITY
14:12:42  [Pipeline] Start of Pipeline
14:12:42  [Pipeline] node
14:12:57  Still waiting to schedule task
14:12:57  All nodes of label ‘tiny’ are offline
14:13:07  Agent zjs-agabrys-tiny-xlmd4 is provisioned from template Kubernetes Pod Template
14:13:07  Running on zjs-agabrys-tiny-xlmd4 in /var/lib/jenkins/workspace/test
14:13:07  [Pipeline] {
14:13:07  [Pipeline] stage
14:13:07  [Pipeline] { (loop)
14:13:07  [Pipeline] sh
14:13:09  + true
14:13:09  + echo line
14:13:09  line
14:13:09  + sleep 3
14:13:12  + true
14:13:12  + echo line
14:13:12  line
14:13:12  + sleep 3
14:13:14  + true

We want timestamps activated for all our jobs. so we don't have this problem anymore (even though timestamps option doesn't work).

One more interesting thing. Free style jobs never have problems with timestamps. When I add Timestamp wrapper and execute the job on agent I see:

14:20:07 Started by user Gabrys, Adam
14:20:07 Running as SYSTEM
14:20:07 Agent zjs-agabrys2-tiny-zfbqr is provisioned from template Kubernetes Pod Template
14:20:07 Building remotely on zjs-agabrys2-tiny-zfbqr (tiny) in workspace /var/lib/jenkins/workspace/test2
14:20:08 [test2] $ /bin/bash -xe /tmp/jenkins1316037729727606180.sh
14:20:08 + true
14:20:08 + echo line
14:20:08 line
14:20:08 + sleep 3
14:20:11 + true
14:20:11 + echo line

adam.gabrys@live.com (JIRA)

unread,
Nov 21, 2019, 8:26:03 AM11/21/19
to jenkinsc...@googlegroups.com
Adam Gabryś edited a comment on Bug JENKINS-59788
This is the simplest possible pipeline to reproduce (I could try to get the docker image used to create the pod) :
{code:java}

pipeline {
   agent {
      label 'tiny'
   }
   options {
      timestamps()
   }
   stages {
       stage('loop') {
           steps {
               sh '''
                    while true;
                    do
                     echo 'line'
                     sleep 3
                    done
               '''
           }
       }
   }
}
{code}

I see no timestamps in logs:
{noformat}

Started by user Gabrys, Adam
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Agent zjs-agabrys-tiny-qtc0t is provisioned from template Kubernetes Pod Template
Running on zjs-agabrys-tiny-qtc0t in /var/lib/jenkins/workspace/test
[Pipeline] {
[Pipeline] timestamps
[Pipeline] {
[Pipeline] stage
[Pipeline] { (loop)
[Pipeline] sh
+ true
+ echo line
line
+ sleep 3
+ true
+ echo line
line
+ sleep 3
+ true
{noformat}
Luckily, we found the new option available {{Manage Jenkins → Configure System → Timestamper}}: *{{Enabled for all Pipeline builds}}*. I enabled it, removed
\ {{options \ { timestamps() }}} from Jenkinsfile and this is the result:
{noformat}

14:12:42  Started by user Gabrys, Adam
14:12:42  Running in Durability level: MAX_SURVIVABILITY
14:12:42  [Pipeline] Start of Pipeline
14:12:42  [Pipeline] node
14:12:57  Still waiting to schedule task
14:12:57  All nodes of label ‘tiny’ are offline
14:13:07  Agent zjs-agabrys-tiny-xlmd4 is provisioned from template Kubernetes Pod Template
14:13:07  Running on zjs-agabrys-tiny-xlmd4 in /var/lib/jenkins/workspace/test
14:13:07  [Pipeline] {
14:13:07  [Pipeline] stage
14:13:07  [Pipeline] { (loop)
14:13:07  [Pipeline] sh
14:13:09  + true
14:13:09  + echo line
14:13:09  line
14:13:09  + sleep 3
14:13:12  + true
14:13:12  + echo line
14:13:12  line
14:13:12  + sleep 3
14:13:14  + true
{noformat}

We want timestamps activated for all our jobs. so we don't have this problem anymore (even though {{timestamps}} option doesn't work).

One more interesting thing. Free style jobs never have problems with timestamps. When I add Timestamp wrapper and execute the job on agent I see:
{noformat}

14:20:07 Started by user Gabrys, Adam
14:20:07 Running as SYSTEM
14:20:07 Agent zjs-agabrys2-tiny-zfbqr is provisioned from template Kubernetes Pod Template
14:20:07 Building remotely on zjs-agabrys2-tiny-zfbqr (tiny) in workspace /var/lib/jenkins/workspace/test2
14:20:08 [test2] $ /bin/bash -xe /tmp/jenkins1316037729727606180.sh
14:20:08 + true
14:20:08 + echo line
14:20:08 line
14:20:08 + sleep 3
14:20:11 + true
14:20:11 + echo line
{noformat}

adam.gabrys@live.com (JIRA)

unread,
Nov 21, 2019, 8:28:13 AM11/21/19
to jenkinsc...@googlegroups.com
Luckily, we found the new option available {{Manage Jenkins → Configure System → Timestamper}}: *{{Enabled for all Pipeline builds}}*. I enabled it, removed \ {{options { timestamps() }} }  block from Jenkinsfile and this is the result:

adam.gabrys@live.com (JIRA)

unread,
Nov 21, 2019, 8:30:03 AM11/21/19
to jenkinsc...@googlegroups.com
Luckily, we found the new option available {{Manage Jenkins → Configure System → Timestamper}}: *{{Enabled for all Pipeline builds}}*. I enabled it, removed {{options}} block from Jenkinsfile and this is the result:

{noformat}
14:12:42  Started by user Gabrys, Adam
14:12:42  Running in Durability level: MAX_SURVIVABILITY
14:12:42  [Pipeline] Start of Pipeline
14:12:42  [Pipeline] node
14:12:57  Still waiting to schedule task
14:12:57  All nodes of label ‘tiny’ are offline
14:13:07  Agent zjs-agabrys-tiny-xlmd4 is provisioned from template Kubernetes Pod Template
14:13:07  Running on zjs-agabrys-tiny-xlmd4 in /var/lib/jenkins/workspace/test
14:13:07  [Pipeline] {
14:13:07  [Pipeline] stage
14:13:07  [Pipeline] { (loop)
14:13:07  [Pipeline] sh
14:13:09  + true
14:13:09  + echo line
14:13:09  line
14:13:09  + sleep 3
14:13:12  + true
14:13:12  + echo line
14:13:12  line
14:13:12  + sleep 3
14:13:14  + true
{noformat}
We want activate timestamps activated for all our jobs. so we don't have this problem anymore (even though {{timestamps}} option doesn't work).


One more interesting thing. Free style jobs never have problems with timestamps. When I add Timestamp wrapper and execute the job on agent I see:
{noformat}
14:20:07 Started by user Gabrys, Adam
14:20:07 Running as SYSTEM
14:20:07 Agent zjs-agabrys2-tiny-zfbqr is provisioned from template Kubernetes Pod Template
14:20:07 Building remotely on zjs-agabrys2-tiny-zfbqr (tiny) in workspace /var/lib/jenkins/workspace/test2
14:20:08 [test2] $ /bin/bash -xe /tmp/jenkins1316037729727606180.sh
14:20:08 + true
14:20:08 + echo line
14:20:08 line
14:20:08 + sleep 3
14:20:11 + true
14:20:11 + echo line
{noformat}

jglick@cloudbees.com (JIRA)

unread,
Nov 21, 2019, 9:06:04 AM11/21/19
to jenkinsc...@googlegroups.com

Adam Gabryś just tried your example and could not reproduce. Fresh installation of Jenkins 2.190.2, with pipeline-model-definition, timestamper, ansicolor, pipeline-model-definition, mock-slave, after configuring a Mock Agent and using that label:

Started by user unknown or anonymous
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on mock in …/mock-agents/mock/workspace/p
[Pipeline] {
[Pipeline] timestamps
[Pipeline] {
[Pipeline] stage
[Pipeline] { (loop)
[Pipeline] sh
09:00:24  + true
09:00:24  + echo line
09:00:24  line
09:00:24  + sleep 3
09:00:27  + true
09:00:27  + echo line
…

Not sure what other conditions are required to trigger this.

Freestyle projects use a completely unrelated mechanism for timestamp annotation, so that is not relevant here.

lj_2005@163.com (JIRA)

unread,
Dec 15, 2019, 10:34:03 PM12/15/19
to jenkinsc...@googlegroups.com
Joe Lee commented on Bug JENKINS-59788

Jesse Glick  Could you use some real agent eg docker or k8s agent to verify ?

jglick@cloudbees.com (JIRA)

unread,
Dec 16, 2019, 9:13:03 AM12/16/19
to jenkinsc...@googlegroups.com

mock-slave creates a separate process and a Remoting channel so it suffices to reproduce issues of this kind (you would need to use something like a Docker agent to reproduce most issues about things like process launching).

martopolis@gmail.com (JIRA)

unread,
Apr 3, 2020, 3:41:03 PM4/3/20
to jenkinsc...@googlegroups.com

I enabled Timestamper both via the global enable button as well as via the Jenkinsfile timestamps() option, however I have zero timestamps in the pipeline build output.  Freestyle projects that I've explicitly enabled it for do, indeed, have timestamps.  I'm using jenkins 2.229 with the latest timestamper.  Our Jenkinsfile is basically just a list of stages for an AWS deployment and a couple in-line shell scripts.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages