'Jenkins workspace is being deleted and also 'Workspace clean-up.log' file is getting generated everyday even without the Workspace Cleanup plugin

Jenkins version : 2.332.1

We have been having this weird problem of some (but not all) of the Jenkins pipeline workspaces being removed from the Unix host where Jenkins is hosted. We don't have a master-slave setup, so this is the only Jenkins host we have. We also don't have any option selected in any of our pipelines to remove the workspace after the jobs have run to completion.

Initially, we had the Workspace Cleanup plugin installed (version unsure of), but we've since uninstalled it and have also removed the binaries from under the <JENKINS_HOME>/plugins/ directory. Yet we still see that the log files with the name pattern 'Workspace clean-up.log' are being generated under the <JENKINS_HOME>/logs/tasks/ directory. Following is the content from one of these log files from a few days earlier:

Started at Thu May 12 02:22:42 IST 2022
Checking DeployRCN
Checking DeployTGV
Checking MTABTestCycle1Pipeline
Checking MTABTestCycle2Pipeline
Checking MTABTestCycle3Pipeline
Deleting /var/lib/jenkins/workspace/MTABTestCycle3Pipeline on Jenkins
Checking TestTGV
Finished at Thu May 12 02:22:43 IST 2022. 1157ms

And the following is the log snippet from last night:

Started at Fri May 13 02:22:42 IST 2022
Checking DeployRCN
Checking DeployTGV
Checking MTABTestCycle1Pipeline
Checking MTABTestCycle2Pipeline
Checking MTABTestCycle3Pipeline
Checking TestTGV
Finished at Fri May 13 02:22:42 IST 2022. 36ms

So although no workspace got removed last night, we're still unsure how this activity is still taking place when we've removed the very plugin since. We don't want this happening ever again as we need to deploy the deleted workspace manually every time this happens.



Solution 1:[1]

@Dipranjan Rakshit, Just wanted to check, After you uninstalled the workspace clean plugin, did you guys restarted jenkins server? If not, I would suggest that. Adding to this, please make sure entries from the pipeline script and in the configuration section is removed

ref : https://plugins.jenkins.io/ws-cleanup/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tapan Hegde