Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-54128] fix deprecated call to run.getLogFile #7

Conversation

mguillem
Copy link
Contributor

Usage of linenumbers Plugin causes tons of exceptions logged to the console like. This PR fixes it and upgrades to a recent parent pom.

2021-08-12 13:51:49.649+0000 [id=1187]  WARNING o.j.p.workflow.job.WorkflowRun#getLogFile: Avoid calling getLogFile on aJob #43
java.lang.UnsupportedOperationException
        at org.jenkinsci.plugins.workflow.job.WorkflowRun.getLogFile(WorkflowRun.java:1155)
        at org.jenkinsci.plugins.linenumbers.LineNumbersAnnotator.annotate(LineNumbersAnnotator.java:54)
        at hudson.console.ConsoleAnnotator$ConsoleAnnotatorAggregator.annotate(ConsoleAnnotator.java:108)
        at hudson.console.ConsoleAnnotator$ConsoleAnnotatorAggregator.annotate(ConsoleAnnotator.java:108)
        at hudson.console.ConsoleAnnotationOutputStream.eol(ConsoleAnnotationOutputStream.java:146)
        at hudson.console.LineTransformationOutputStream.eol(LineTransformationOutputStream.java:60)
        at hudson.console.LineTransformationOutputStream.write(LineTransformationOutputStream.java:56)
        at java.io.FilterOutputStream.write(FilterOutputStream.java:77)
        at org.jenkinsci.plugins.workflow.log.FileLogStorage$1$1.write(FileLogStorage.java:238)
        at java.io.FilterOutputStream.write(FilterOutputStream.java:125)
        at org.apache.commons.io.output.ProxyOutputStream.write(ProxyOutputStream.java:91)
        at org.kohsuke.stapler.framework.io.LargeText.writeLogTo(LargeText.java:221)
        at hudson.console.AnnotatedLargeText.writeRawLogTo(AnnotatedLargeText.java:174)
        at org.jenkinsci.plugins.workflow.log.FileLogStorage$1.writeHtmlTo(FileLogStorage.java:203)
        at hudson.model.Run.writeLogTo(Run.java:1554)

See https://issues.jenkins.io/browse/JENKINS-54128.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira

@mguillem mguillem force-pushed the fix/JENKINS-54128-deprecated-Run-getLogFile branch from 238432f to d740bc3 Compare August 17, 2021 08:11
@mguillem mguillem force-pushed the fix/JENKINS-54128-deprecated-Run-getLogFile branch from d740bc3 to bc33f04 Compare August 17, 2021 12:34
@mguillem
Copy link
Contributor Author

@Vlatombe any chance to get this PR merged?

Copy link
Member

@Vlatombe Vlatombe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Vlatombe Vlatombe merged commit f72406d into jenkinsci:master Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants