Jenkins keep cleaning up my workspace unexpectedly

Viewed 317

I have Jenkins in my Docker container to run the testing. I noticed a weird thing that my workspace was removed every day.

Check the docker logs:

2021-11-26 08:26:57.511+0000 [id=450812]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Workspace clean-up. 7,676 ms
2021-11-27 08:26:49.834+0000 [id=461439]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Workspace clean-up
2021-11-27 08:26:49.835+0000 [id=461439]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Workspace clean-up. 0 ms
2021-11-28 08:26:49.834+0000 [id=479487]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Workspace clean-up
2021-11-28 08:26:49.835+0000 [id=479487]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Workspace clean-up. 0 ms
2021-11-29 08:26:49.834+0000 [id=497481]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Workspace clean-up
2021-11-29 08:26:49.835+0000 [id=497481]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Workspace clean-up. 0 ms
2021-11-30 08:26:49.834+0000 [id=515511]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Workspace clean-up
2021-11-30 08:26:52.726+0000 [id=515511]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Workspace clean-up. 2,891 ms
2021-12-01 08:26:49.834+0000 [id=516550]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Workspace clean-up
2021-12-01 08:27:00.562+0000 [id=516550]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Workspace clean-up. 10,727 ms
2021-12-02 08:26:49.834+0000 [id=520493]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Workspace clean-up
2021-12-02 08:26:59.681+0000 [id=520493]        INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Workspace clean-up. 9,847 ms

Looks like Jenkins removes the workspace every 24 hours. The weird thing is I do have a workspace cleanup plugin in my Jenkins but I have disabled it in the Plugin Manger and I don't have any workspace cleanup plugin syntax in my pipeline script.

Is there any other default feature/function/plug-in that will remove my workspace periodically?

I am very new to Jenkins, any help is appreciated!

         ########################  Updated on 12/4 ########################

I found this discussion is very similar to my question: Jenkins is deleting workspaces on slaves

I changed this parameter to true in the Script Console.

hudson.model.WorkspaceCleanupThread.disabled = true

The weird thing is that the workspace clean up still happen, but at least this time it didn't remove the folder:

2021-12-03 21:15:02.446+0000 [id=19935] INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Workspace clean-up
2021-12-03 21:15:05.225+0000 [id=19935] INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Workspace clean-up. 2,778 ms
2021-12-04 21:15:02.447+0000 [id=38002] INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Workspace clean-up
2021-12-04 21:15:02.447+0000 [id=38002] INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Workspace clean-up. 0 ms
0 Answers
Related