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

AuditTrail java.nio.file.NoSuchFileException for log file handler

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • audit-trail-plugin
    • RHEL7
      Jenkins ver. 2.138.3

      Installed and encountered same exception with the audit trail plugin version 2.4 and 2.3. 

      It was a fresh install and added log file as logger in configure. Started getting following exception in logs when users change the configurations where it was expected to log these activities.

      java.nio.file.NoSuchFileException: /data/jenkins/logs/audit/audit-0.log.lck

      I have removed the logger and created another logger, the issue stays same.

      No log file is created under this folder.

       

          [JENKINS-56108] AuditTrail java.nio.file.NoSuchFileException for log file handler

          Semanur Gulen created issue -
          Semanur Gulen made changes -
          Environment Original: RHEL7
          New: RHEL7
          Jenkins ver. 2.138.3

          Sylvia Qi added a comment -

          I encountered the same issue, but later discovered it had to do with the audit trail log directory. When I had the audit trail log directory set to /var/log/jenkins/audit-%g.log, I got that error. Then I changed it to /var/jenkins_home/logs/audit-%g.log, it worked. The default jenkins log dir of my installation is /var/jenkins_home/logs. 

          Hope this helps. 

          Sylvia Qi added a comment - I encountered the same issue, but later discovered it had to do with the audit trail log directory. When I had the audit trail log directory set to /var/log/jenkins/audit-%g.log, I got that error. Then I changed it to /var/jenkins_home/logs/audit-%g.log, it worked. The default jenkins log dir of my installation is /var/jenkins_home/logs.  Hope this helps. 

          Sylvia Qi added a comment -

          After further testing, it appears that the initial configuration of this plugin does not work (I deployed Jenkins using a helm chart, so the plugin was configured as code). After the deployment, I am getting the same error when performing some action that would trigger the plugin to create a log file. Then, I went into the Jenkins Configure System UI and manually update one of the values in the plugin configuration, say, Log File Size, save the configuration, then the error goes away, and the plugin started working correctly. This behavior is consistently repeatable. 

          Sylvia Qi added a comment - After further testing, it appears that the initial configuration of this plugin does not work (I deployed Jenkins using a helm chart, so the plugin was configured as code). After the deployment, I am getting the same error when performing some action that would trigger the plugin to create a log file. Then, I went into the Jenkins Configure System UI and manually update one of the values in the plugin configuration, say, Log File Size, save the configuration, then the error goes away, and the plugin started working correctly. This behavior is consistently repeatable. 

          Allan BURDAJEWICZ added a comment - Might be something to fix in there: https://github.com/jenkinsci/audit-trail-plugin/blob/master/src/main/java/hudson/plugins/audit_trail/AuditTrailPlugin.java#L65-L84

          Pierre Beitz added a comment -

          Apologies, I missed the bug report, somehow the plugin default assignee wasn't changed on plugin ownership transfer.

           

          Regarding the reported issue, it appears that the path you are specifying doesn't exist on the host and the FileHandler used by the plugin is not able to create the intermediate missing directories. I'll make a fix for this, in the meantime, workaround is to manually create the intermediate directories.

          After further testing, it appears that the initial configuration of this plugin does not work (I deployed Jenkins using a helm chart, so the plugin was configured as code). After the deployment, I am getting the same error when performing some action that would trigger the plugin to create a log file. Then, I went into the Jenkins Configure System UI and manually update one of the values in the plugin configuration, say, Log File Size, save the configuration, then the error goes away, and the plugin started working correctly

          qisylvia this description makes me think that you are describing a different issue, with an incompatibility between the jcasc plugin in the audit trail plugin. I can see that you logged JENKINS-57232 that seems to cover the issue, I propose to discuss this specific issue in there and keep JENKINS-56108 for the issue reported initially.

          Pierre Beitz added a comment - Apologies, I missed the bug report, somehow the plugin default assignee wasn't changed on plugin ownership transfer.   Regarding the reported issue, it appears that the path you are specifying doesn't exist on the host and the FileHandler used by the plugin is not able to create the intermediate missing directories. I'll make a fix for this, in the meantime, workaround is to manually create the intermediate directories. After further testing, it appears that the initial configuration of this plugin does not work (I deployed Jenkins using a helm chart, so the plugin was configured as code). After the deployment, I am getting the same error when performing some action that would trigger the plugin to create a log file. Then, I went into the Jenkins Configure System UI and manually update one of the values in the plugin configuration, say, Log File Size, save the configuration, then the error goes away, and the plugin started working correctly qisylvia this description makes me think that you are describing a different issue, with an incompatibility between the jcasc plugin in the audit trail plugin. I can see that you logged JENKINS-57232 that seems to cover the issue, I propose to discuss this specific issue in there and keep JENKINS-56108 for the issue reported initially.
          Pierre Beitz made changes -
          Assignee Original: Tomasz Sęk [ tsek ] New: Pierre Beitz [ pierrebtz ]
          Pierre Beitz made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Pierre Beitz made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Pierre Beitz made changes -
          Remote Link New: This issue links to "PR-13 (Web Link)" [ 22754 ]

            pierrebtz Pierre Beitz
            semanur Semanur Gulen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: