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

Audit Trail plugin fails to track queue item api calls

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • audit-trail-plugin
    • None
    • Audit Trail plugin version: 2.2
      Jenkins version: 1.609.3

      Steps to reproduce using the Jenkins GUI:

      1. Change Audit Trail configuration URL Patterns to Log in Jenkins global configuration from its default value:
      .*/(?:configSubmit|..|safeExit)
      to include also api calls:
      .*/(?:configSubmit|..|safeExit|api.*)

      2. Trigger a build and check its queueId from JENKINS_HOST/job/project_name/lastBuild/api/xml
      3. Query queue item using JENKINS_HOST/queue/item/queue-id-from-previous-step/api/xml
      4. Jenkins should say "Oops!" with a devilish grin and dump a stack trace containing this:

      Caused by: java.lang.NoSuchMethodError: hudson.model.Queue.getItem(I)Lhudson/model/Queue$Item;
      	at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:84)
      

      Queue.getItem was changed about a year ago:
      https://github.com/jenkinsci/jenkins/commit/89681c20296c5f1c134039d2e24d434e1992437b#diff-7e8de48a31688987a2521079ff3828b9L726

      Audit Trail uses the old version where ids were ints:
      https://github.com/jenkinsci/audit-trail-plugin/blob/master/src/main/java/hudson/plugins/audit_trail/AuditTrailFilter.java#L84

      I got the plugin working by updating plugin parent from 1.520 to 1.609.3 and changing Integer.parseInt to Long.parseLong on line 84.

            pierrebtz Pierre Beitz
            salsa Sami Salonen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: