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

Job Configuration History Plugin doesn't seem to honor "Max number of days to keep history entries" for deleted jobs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Labels:
    • Environment:
      Jenkins 2.204.2 (newest LTS)
      Job Configuration History Plugin 2.24 (most recent)
      Java OpenJDK8U-jdk_x64_linux_hotspot_8u232b09
      Running on Redhat 7
      No container
    • Similar Issues:

      Description

      I have configured the plugin as follow:

      • Use different history directory than default:: [Empty]
      • Max number of history entries to keep: 20
      • Max number of days to keep history entries: 365
      • Max number of history entries to show per page: [Empty]
      • Configuration exclude file pattern: queue|nodeMonitors|UpdateCenter|global-build-stats
      • Do not save duplicate history: ON

        * Save Maven module configuration changes
        : ON

        * Show build badges: Always
      • Exclude users: [Empty]

      Now to my amazement, I found on the FS files like:
      drwxr-xr-x 6 lthy ne 4096 Nov 11 2016 home/config-history/jobs/testJob_deleted_20161111_152741_018
      drwxr-xr-x 6 lthy ne 4096 Jun 29 2016 home/config-history/jobs/testMultiBranch_deleted_20160629_190653_773
      drwxr-xr-x 8 ltphy ne 4096 Aug 30 2016 home/config-history/jobs/Try1_deleted_20160830_093601_349

      So this looks like the job got deleted in 2016. (I have similar cases for later years.)

      With "Max number of days to keep history entries: 365" I would have expected everything deleted more than a year ago to be removed.

        Attachments

          Activity

          Hide
          jochenafuerbacher Jochen A. Fürbacher added a comment -

          This might be a permission issue. Your ls shows two different users: lthy and ltphy. The files only have write permission for their own user, so the user lthy cannot delete a file of user ltphy and vice versa.

          What's your jenkins system user? If your jenkins system user isn't lthy nor ltphy, JobConfigHistory cannot delete these files.

          Could you also check the jenkins logfile? You should see some entries like Should delete: <filename> and maybe a warning like problem deleting history file: <filename>.

          Show
          jochenafuerbacher Jochen A. Fürbacher added a comment - This might be a permission issue. Your ls shows two different users: lthy and ltphy . The files only have write permission for their own user, so the user lthy cannot delete a file of user ltphy and vice versa. What's your jenkins system user? If your jenkins system user isn't lthy nor ltphy , JobConfigHistory cannot delete these files. Could you also check the jenkins logfile? You should see some entries like Should delete: <filename> and maybe a warning like problem deleting history file: <filename> .
          Hide
          rgruber29 Rainer Gruber added a comment -

          I have the same problem, but the permissions are correct (jenkins user, permissons drwxrwxr-x, no warnings in log).

          • as I can see: the history entries for active jobs are deleted after the specified number of days
          • deleted jobs (e.g. zzz_deleted_20181119_105513_317) are too old but seem to be untouched. All history-timestamp directory are too old but all stay in filesystem.
          • A look at the sources: JobConfigHistoryPurger iterates in purgeSystemOrJobHistory will delete the inner timestamp directory using method deleteDirectory(historyDir) - but I didn't find the code where the outer directory like 'zzz_deleted_20181119_105513_317' should be deleted.

           

          System: Redhat Enterprise Linux 7, Jenkins 2.245, Job Config History Plugin 2.26

          Plugin configuration (unmentioned fields are empty):

          • max number of days=183
          • do not save duplicate history
          • build badges=always
          • show change message window

           

          Show
          rgruber29 Rainer Gruber added a comment - I have the same problem, but the permissions are correct (jenkins user, permissons drwxrwxr-x, no warnings in log). as I can see: the history entries for active jobs are deleted after the specified number of days deleted jobs (e.g. zzz_deleted_20181119_105513_317) are too old but seem to be untouched. All history-timestamp directory are too old but all stay in filesystem. A look at the sources: JobConfigHistoryPurger iterates in purgeSystemOrJobHistory will delete the inner timestamp directory using method deleteDirectory(historyDir) - but I didn't find the code where the outer directory like 'zzz_deleted_20181119_105513_317' should be deleted.   System: Redhat Enterprise Linux 7, Jenkins 2.245, Job Config History Plugin 2.26 Plugin configuration (unmentioned fields are empty): max number of days=183 do not save duplicate history build badges=always show change message window  

            People

            Assignee:
            stefanbrausch Stefan Brausch
            Reporter:
            martinjost Martin Jost
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: