[JIRA] (JENKINS-58901) Log file

9 views
Skip to first unread message

jenkins.io@ch.pkts.ca (JIRA)

unread,
Aug 12, 2019, 4:12:03 PM8/12/19
to jenkinsc...@googlegroups.com
C H created an issue
 
Jenkins / Bug JENKINS-58901
Log file
Issue Type: Bug Bug
Assignee: Unassigned
Components: core, pipeline
Created: 2019-08-12 20:11
Environment: Jenkins 2.176.2

System Properties
Name ↓
Value
awt.toolkit sun.awt.X11.XToolkit
executable-war /usr/share/jenkins/jenkins.war
file.encoding UTF-8
file.encoding.pkg sun.io
file.separator /
java.awt.graphicsenv sun.awt.X11GraphicsEnvironment
java.awt.headless true
java.awt.printerjob sun.print.PSPrinterJob
java.class.path /usr/share/jenkins/jenkins.war
java.class.version 52.0
java.endorsed.dirs /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/endorsed
java.ext.dirs /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext
java.home /usr/lib/jvm/java-8-openjdk-amd64/jre
java.io.tmpdir /tmp
java.library.path /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
java.runtime.name OpenJDK Runtime Environment
java.runtime.version 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10
java.specification.name Java Platform API Specification
java.specification.vendor Oracle Corporation
java.specification.version 1.8
java.vendor Private Build
java.vendor.url http://java.oracle.com/
java.vendor.url.bug http://bugreport.sun.com/bugreport/
java.version 1.8.0_222
java.vm.info mixed mode
java.vm.name OpenJDK 64-Bit Server VM
java.vm.specification.name Java Virtual Machine Specification
java.vm.specification.vendor Oracle Corporation
java.vm.specification.version 1.8
java.vm.vendor Private Build
java.vm.version 25.222-b10
javax.accessibility.assistive_technologies org.GNOME.Accessibility.AtkWrapper
jetty.git.hash eb70b240169fcf1abbd86af36482d1c49826fa0b
jna.loaded true
jna.platform.library.path /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:/lib64:/usr/lib:/lib:/usr/lib/x86_64-linux-gnu/libfakeroot
jnidispatch.path /tmp/jna-3506402/jna4452657821541405680.tmp
line.separator
mail.smtp.sendpartial true
mail.smtps.sendpartial true
org.apache.commons.jelly.tags.fmt.timeZone America/Los_Angeles
os.arch amd64
os.name Linux
os.version 4.15.0-1044-aws
path.separator :
sun.arch.data.model 64
sun.boot.class.path /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/classes
sun.boot.library.path /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64
sun.cpu.endian little
sun.cpu.isalist
sun.font.fontmanager sun.awt.X11FontManager
sun.io.unicode.encoding UnicodeLittle
sun.java.command /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080
sun.java.launcher SUN_STANDARD
sun.jnu.encoding UTF-8
sun.management.compiler HotSpot 64-Bit Tiered Compilers
sun.os.patch.level unknown
svnkit.http.methods Digest,Basic,NTLM,Negotiate
svnkit.ssh2.persistent false
user.dir /
user.home /root
user.language en
user.name root
user.timezone Etc/UTC
Environment Variables
Name ↓
Value
_ /usr/bin/daemon
HOME /root
JENKINS_HOME /var/lib/jenkins
LANG C.UTF-8
LOGNAME root
MAIL /var/mail/root
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PWD /root
SHELL /bin/bash
SHLVL 1
USER root
XDG_DATA_DIRS /usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_RUNTIME_DIR /run/user/0
XDG_SESSION_ID c1
Plugins
Name ↓
Version
Enabled
ace-editor 1.1 true
ansicolor 0.6.2 true
ant 1.9 true
antisamy-markup-formatter 1.5 true
apache-httpcomponents-client-4-api 4.5.5-3.0 true
authentication-tokens 1.3 true
aws-credentials 1.27 true
aws-java-sdk 1.11.594 true
blueocean 1.18.0 true
blueocean-autofavorite 1.2.4 true
blueocean-bitbucket-pipeline 1.18.0 true
blueocean-commons 1.18.0 true
blueocean-config 1.18.0 true
blueocean-core-js 1.18.0 true
blueocean-dashboard 1.18.0 true
blueocean-display-url 2.3.0 true
blueocean-events 1.18.0 true
blueocean-git-pipeline 1.18.0 true
blueocean-github-pipeline 1.18.0 true
blueocean-i18n 1.18.0 true
blueocean-jira 1.18.0 true
blueocean-jwt 1.18.0 true
blueocean-personalization 1.18.0 true
blueocean-pipeline-api-impl 1.18.0 true
blueocean-pipeline-editor 1.18.0 true
blueocean-pipeline-scm-api 1.18.0 true
blueocean-rest 1.18.0 true
blueocean-rest-impl 1.18.0 true
blueocean-web 1.18.0 true
bouncycastle-api 2.17 true
branch-api 2.5.4 true
build-time-blame 1.2.0 true
build-timeout 1.19 true
cloudbees-bitbucket-branch-source 2.4.5 true
cloudbees-folder 6.9 true
collapsing-console-sections 1.7.0 true
command-launcher 1.3 true
credentials 2.2.1 true
credentials-binding 1.19 true
display-url-api 2.3.1 true
docker-commons 1.15 true
docker-workflow 1.18 true
durable-task 1.30 true
email-ext 2.66 true
favorite 2.3.2 true
git 3.11.0 true
git-client 2.8.0 true
git-server 1.7 true
github 1.29.4 true
github-api 1.95 true
github-branch-source 2.5.5 true
gitlab-plugin 1.5.12 true
gradle 1.33 true
handlebars 1.1.1 true
handy-uri-templates-2-api 2.1.7-1.0 true
htmlpublisher 1.18 true
jackson2-api 2.9.9.1 true
jdk-tool 1.3 true
jenkins-design-language 1.18.0 true
jira 3.0.8 true
jquery 1.12.4-0 true
jquery-detached 1.2.1 true
jsch 0.1.55.1 true
junit 1.28 true
ldap 1.20 true
lockable-resources 2.5 true
mailer 1.24 true
mapdb-api 1.0.9.0 true
matrix-auth 2.4.2 true
matrix-project 1.14 true
mercurial 2.8 true
momentjs 1.1.1 true
pam-auth 1.5.1 true
pipeline-aws 1.38 true
pipeline-build-step 2.9 true
pipeline-github-lib 1.0 true
pipeline-graph-analysis 1.10 true
pipeline-input-step 2.10 true
pipeline-milestone-step 1.3.1 true
pipeline-model-api 1.3.9 true
pipeline-model-declarative-agent 1.1.1 true
pipeline-model-definition 1.3.9 true
pipeline-model-extensions 1.3.9 true
pipeline-rest-api 2.11 true
pipeline-stage-step 2.3 true
pipeline-stage-tags-metadata 1.3.9 true
pipeline-stage-view 2.11 true
plain-credentials 1.5 true
pubsub-light 1.12 true
resource-disposer 0.13 true
scm-api 2.6.3 true
script-security 1.62 true
slack 2.28 true
sse-gateway 1.19 true
ssh-credentials 1.17.1 true
ssh-slaves 1.30.1 true
structs 1.20 true
subversion 2.12.2 true
timestamper 1.10 true
token-macro 2.8 true
variant 1.3 true
workflow-aggregator 2.6 true
workflow-api 2.36 true
workflow-basic-steps 2.18 true
workflow-cps 2.73 true
workflow-cps-global-lib 2.15 true
workflow-durable-task-step 2.33 true
workflow-job 2.33 true
workflow-multibranch 2.21 true
workflow-scm-step 2.9 true
workflow-step-api 2.20 true
workflow-support 3.3 true
ws-cleanup 0.37 true
Priority: Minor Minor
Reporter: C H

I've been developing a pipeline that uses serverless to deploy an AWS website backed with lambda functions.  I started noticing that some expected log statements were absent from the console log.  Upon looking at the physical log in /var/lib/jenkins/jobs/OurProjectPortal/branches/SomeBranchName/builds/155/log, I saw that part of the log had been overwritten with NUL bytes (0x00), and this corresponded with the missing log output in the console log.  Sample:

 

vi /var/lib/jenkins/jobs/OurProjectPortal/branches/SomeBranchName/builds/155/log
========
[2019-08-12T19:35:23.994Z] + echo Installing 'serverless' and plugins:
[2019-08-12T19:35:23.994Z] Installing 'serverless' and plugins:
[2019-08-12T19:35:23.994Z] + [ -e node_modules.zip ]
[2019-08-12T19:35:23.994Z] + unzip node_modules.zip
[2019-08-12T19:35:45.805Z] ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@....
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@+ echo This decrypts secrets.blah-blah.yml.encrypted, containing db credentials and cognito user pool
[2019-08-12T19:35:45.805Z] This decrypts secrets.blah-blah.yml.encrypted, containing db credentials and cognito user pool
[2019-08-12T19:35:45.805Z] + echo

In previous situations where I've seen this, it's been caused by two processes writing to the same file using buffered I/O and no locking.

Here's the affected part of the Jenkinsfile:

 

sedhex=2f5b2e5d5b5e205c2f302d392e5d2a202f207b2020732f2e2a5c285b2e5d5b5e205c2f302d392e5d2a5c29202e2a2f5c312f3b2070207d 
sedprog=\$(echo \$sedhex | xxd -p -r)
echo "Installing 'serverless' and plugins:"
 if [ -e node_modules.zip ]; then
 unzip node_modules.zip > /dev/null 2>&1
 else
 npm install serverless serverless-python-requirements serverless-secrets-plugin serverless-plugin-git-variables
 fi
 echo ""
echo "Creating dummy secrets file:" > /dev/null
 (echo "a:"; echo " n: x") > secrets.blah-blah.yml
echo "Zipping up python functions and requirements:"
 echo "Count|Filename Extension"
 zip -r9 function.zip -x '*/requirements.txt' \
 \$(echo */requirements.txt | sed s,/requirements.txt,,g) \
 | sed -n "\$sedprog" \
 | sort | uniq -c | sort -nr
 echo ""
echo "Waiting for CloudFormation stack to be available:"
 while aws cloudformation list-stacks | jq -r '.StackSummaries[] | select(.StackName == "blah-blah") | .StackStatus' | tee /dev/stderr | grep _IN_PROGRESS; do
 date +"%F %T"
 sleep 30
 done
echo "This decrypts secrets.blah-blah.yml.encrypted, containing db credentials and cognito user pool"
 echo ""
 serverless decrypt --stage blah-blah --password 'blah-blah'
 echo ""

 

Is it possible that the

tee /dev/stderr

is what's causing this?

Thanks!

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jenkins.io@ch.pkts.ca (JIRA)

unread,
Aug 12, 2019, 4:50:04 PM8/12/19
to jenkinsc...@googlegroups.com
C H commented on Bug JENKINS-58901
 
Re: Log file

It turns out that 'tee /dev/stderr' was interacting badly with Jenkins' stdout/stderr capturing.

For those who found this issue via Google, the '-x */requirements.txt' argument to Zip needed to go at the end of the line; that's why the zip file was not created.

dbeck@cloudbees.com (JIRA)

unread,
Aug 12, 2019, 6:49:03 PM8/12/19
to jenkinsc...@googlegroups.com
Daniel Beck closed an issue as Not A Defect
 

Comment indicates there's no bug here.

Change By: Daniel Beck
Status: Open Closed
Resolution: Not A Defect

jenkins.io@ch.pkts.ca (JIRA)

unread,
Aug 12, 2019, 7:23:02 PM8/12/19
to jenkinsc...@googlegroups.com
C H commented on Bug JENKINS-58901
 
Re: Log file

Actually, there is a bug; the way Jenkins is capturing stderr and appending it to the log file is incorrect.

jenkins.io@ch.pkts.ca (JIRA)

unread,
Aug 12, 2019, 7:24:02 PM8/12/19
to jenkinsc...@googlegroups.com
C H edited a comment on Bug JENKINS-58901
 
Re: Log file
Actually, there is a bug; the way Jenkins is capturing stderr and appending it to the log file is incorrect.   There shouldn't be a loss of log data, no matter what combination of stdout and stderr writes there may be.
Reply all
Reply to author
Forward
0 new messages