Why are my logs flooded with Avoid calling getLogFile warnings?

Issue

You observe that your logs include lots of traces like the one shown below:

org.jenkinsci.plugins.workflow.job.WorkflowRun getLogFile
WARNING: Avoid calling getLogFile on JobXXX #BuildYYY
java.lang.UnsupportedOperationException
at org.jenkinsci.plugins.workflow.job.WorkflowRun.getLogFile(WorkflowRun.java:1082)
at hudson.plugins.timestamper.io.LogFileReader.nextLine(LogFileReader.java:157)
at hudson.plugins.timestamper.action.TimestampsActionOutput$1.readNextLine(TimestampsActionOutput.java:173)
at hudson.plugins.timestamper.action.TimestampsActionOutput$1.read(TimestampsActionOutput.java:132)
at java.io.BufferedReader.fill(BufferedReader.java:161)

This can fill the logs and cause different problems in your instance.

Environment

Resolution

This is a known issue, JENKINS-54128 related to the timestamper plugin and its interaction with workflow-job plugin and groovy-postbuild plugin.

In order to correct the problem:
1. Take a backup as per the Backup and restore guide
2. Upgrade the above mentioned plugins (or at least the one that you are using), to the versions listed below:

Workaround

If you can get rid of the warnings in the logs, one easy way to do it is to set the log level for org.jenkinsci.plugins.workflow.job.WorkflowRun to SEVERE. That will remove the warning messages from your logs, but our recommendations is that you move to a more long term solution by planning the plugin updates suggested in the previous section.

Tested product/plugin versions

References

Have more questions?

0 Comments

Please sign in to leave a comment.