Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54128

Deprecated calls to Run.getLogFile

    Details

    • Similar Issues:
    • Released As:
      workflow-job 2.29 groovy-postbuild-2.5

      Description

      Timestamper causes lots of WARNING messages in the log:

      Oct 17, 2018 8:19:32 AM org.jenkinsci.plugins.workflow.job.WorkflowRun getLogFile
      WARNING: Avoid calling getLogFile on **** #3
      java.lang.UnsupportedOperationException
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.getLogFile(WorkflowRun.java:1064)
      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)
      at java.io.BufferedReader.readLine(BufferedReader.java:324)
      at java.io.BufferedReader.readLine(BufferedReader.java:389)
      at hudson.plugins.timestamper.action.TimestampsAction.doIndex(TimestampsAction.java:102)
      at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
      at org.kohsuke.stapler.IndexDispatcher.dispatch(IndexDispatcher.java:27)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:384)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      at org.kohsuke.stapler.MetaClass$3.doDispatch(MetaClass.java:212)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:253)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:253)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:253)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
      at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:59)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      at hudson.plugins.locale.LocaleFilter.doFilter(LocaleFilter.java:42)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:124)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:105)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      at org.eclipse.jetty.server.Server.handle(Server.java:503)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
      at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:748)
      zebra-cd-preprod-jenkins-587d4f6d59-k7cv4 zebra-cd-preprod-jenkins

      Installed plugins:

      scm-api:2.2.8
      docker-workflow:1.17
      bouncycastle-api:2.17
      parameter-separator:1.0
      script-security:1.46
      ssh-agent:1.17
      htmlpublisher:1.17
      kubernetes:1.12.7
      workflow-aggregator:2.6
      jquery:1.12.4-0
      plain-credentials:1.4
      jackson2-api:2.8.11.3
      greenballs:1.15
      pipeline-utility-steps:2.1.0
      pipeline-stage-tags-metadata:1.3.2
      jquery-detached:1.2.1
      timestamper:1.8.10
      kubernetes-credentials:0.4.0
      pipeline-milestone-step:1.3.1
      workflow-api:2.30
      ansicolor:0.5.2
      authentication-tokens:1.3
      pipeline-graph-analysis:1.7
      branch-api:2.0.20
      variant:1.1
      workflow-step-api:2.16
      matrix-auth:2.3
      mattermost:2.5.2
      workflow-cps-global-lib:2.12
      ldap:1.20
      pipeline-build-step:2.7
      apache-httpcomponents-client-4-api:4.5.5-3.0
      structs:1.17
      git:3.9.1
      pipeline-stage-step:2.3
      workflow-support:2.21
      antisamy-markup-formatter:1.5
      workflow-basic-steps:2.11
      workflow-cps:2.58
      pipeline-model-extensions:1.3.2
      pipeline-rest-api:2.10
      gitlab-plugin:1.5.10
      docker-commons:1.13
      workflow-multibranch:2.20
      uno-choice:2.1
      ssh-credentials:1.14
      pipeline-input-step:2.8
      credentials:2.1.18
      workflow-durable-task-step:2.22
      pipeline-model-declarative-agent:1.1.1
      token-macro:2.5
      momentjs:1.1.1
      pipeline-model-definition:1.3.2
      git-client:2.7.3
      git-server:1.7
      durable-task:1.26
      ace-editor:1.1
      ssh-slaves:1.28.1
      jsch:0.1.54.2
      performance:3.12
      pipeline-model-api:1.3.2
      workflow-job:2.26
      command-launcher:1.2
      cloudbees-folder:6.6
      display-url-api:2.2.0
      rebuild:1.29
      locale:1.3
      credentials-binding:1.16
      mailer:1.21
      matrix-project:1.13
      workflow-scm-step:2.7
      collapsing-console-sections:1.7.0
      job-dsl:1.70
      handlebars:1.1.1
      junit:1.26.1
      pipeline-stage-view:2.10
      configuration-as-code:1.1

      Jenkins version: 2.147

        Attachments

          Issue Links

            Activity

            Hide
            slide_o_mix Alex Earl added a comment -

            I removed token macro since the PR was merged and released.

            Show
            slide_o_mix Alex Earl added a comment - I removed token macro since the PR was merged and released.
            Hide
            basil Basil Crow added a comment -

            I removed the timestamper-plugin component from this issue, since a fix has been released in Timestamper 1.11.1.

            FYI, the usage-in-plugins job shows that there are still 16 plugins with calls to the deprecated Run#getLogFile method. Most of these plugins haven't been updated in over a year, but I noticed that google-storage, sauce-ondemand, stoplightio-report, and token-macro have all had recent updates, so I added them to this issue's component list.

            Show
            basil Basil Crow added a comment - I removed the timestamper-plugin component from this issue, since a fix has been released in Timestamper 1.11.1 . FYI, the usage-in-plugins job shows that there are still 16 plugins with calls to the deprecated Run#getLogFile method. Most of these plugins haven't been updated in over a year, but I noticed that google-storage , sauce-ondemand , stoplightio-report , and token-macro have all had recent updates, so I added them to this issue's component list.
            Hide
            basil Basil Crow added a comment -

            I posted jenkinsci/timestamper-plugin#52, which eliminates the last call to the last call to Run#getLogFile in Timestamper and replaces it with a call to Run#getLogReader.

            Show
            basil Basil Crow added a comment - I posted jenkinsci/timestamper-plugin#52 , which eliminates the last call to the last call to Run#getLogFile in Timestamper and replaces it with a call to Run#getLogReader .
            Hide
            basil Basil Crow added a comment -

            Tobias Gruetzmacher, I have a rough draft of a fix for Timestamper. I plan to post a PR soon and release the fix in the forthcoming Timestamper 1.11.1 release. To help me test this new functionality, would you mind posting the stack trace that you are seeing with the call to getLogFile?

            Show
            basil Basil Crow added a comment - Tobias Gruetzmacher , I have a rough draft of a fix for Timestamper. I plan to post a PR soon and release the fix in the forthcoming Timestamper 1.11.1 release. To help me test this new functionality, would you mind posting the stack trace that you are seeing with the call to getLogFile ?
            Hide
            tgr Tobias Gruetzmacher added a comment -

            Is there a fix for timestamper-plugin? Since LogFileReader.nextLine() is called for every line when downloading logs from Jenkins, the log is flooded with bogus errors. I took a look at https://github.com/jenkinsci/timestamper-plugin/blob/master/src/main/java/hudson/plugins/timestamper/io/LogFileReader.java#L157 but am at a loss on how to keep the contract of that method while avoiding the call to getLogFile. (Would be nice if Run had a method hasLog()...)

            Show
            tgr Tobias Gruetzmacher added a comment - Is there a fix for timestamper-plugin ? Since LogFileReader.nextLine() is called for every line when downloading logs from Jenkins, the log is flooded with bogus errors. I took a look at https://github.com/jenkinsci/timestamper-plugin/blob/master/src/main/java/hudson/plugins/timestamper/io/LogFileReader.java#L157 but am at a loss on how to keep the contract of that method while avoiding the call to getLogFile . (Would be nice if Run had a method hasLog() ...)

              People

              • Assignee:
                Unassigned
                Reporter:
                aroq Alexander Tolstikov
              • Votes:
                5 Vote for this issue
                Watchers:
                26 Start watching this issue

                Dates

                • Created:
                  Updated: