After upgrading to ws-cleanup 0.24 in order to get the asynchronous cleanup function we noticed the workspaces on our slaves getting renamed to the form of ${WORKSPACE}ws-cleanup${TIMESTAMP}. (ie, job1 would become job1_ws-cleanup_1411197183394). The expected behavior under ws-cleanup 0.24 is that these were temporary to support asynchronous processing and would be deleted. However, these directories never get removed from the slave. Over time, the slave hard drives filled up resulting in build failures.
After upgrading to ws-cleanup 0.24 in order to get the asynchronous cleanup function weWe noticed the workspaces on our slaves getting renamed to the form of ${WORKSPACE}_ws-cleanup_${TIMESTAMP}. (ie, job1 would become job1_ws-cleanup_1411197183394). The expected behavior under ws-cleanup 0.24 is that these were temporary to support asynchronous processing and would be deleted. However, these directories never get removed from the slave. Over time, the slave hard drives filled up resulting in build failures.
Same here Jenkins v. 2.140 / WS-Cleanup plugin v. 0.34. Seems that the ${WORKSPACE}ws-cleanup${TIMESTAMP} directory is somehow owned by root and therefore causes the async resource disposer to fail due to lack of permissions. Workaround is to add a cron job to chown ${WORKSPACE}ws-cleanup${TIMESTAMP} which allows async cleanup to occur.
Same here on Jenkins v. 2.140 / WS-Cleanup plugin v. 0.34. Seems that the {{${WORKSPACE}_ws-cleanup_$\{TIMESTAMP}}} directory is somehow owned by root and therefore causes the async resource disposer to fail due to lack of permissions. Workaround is to add a cron job to chown {{${WORKSPACE}_ws-cleanup_$\{TIMESTAMP}}} which allows async cleanup to occur.
Same here on Jenkins v. 2.140 / WS-Cleanup plugin v. 0.34. Seems that the ${WORKSPACE}\_ws-cleanup_cleanup\_$\{TIMESTAMP} directory is somehow owned by root and therefore causes the async resource disposer to fail due to lack of permissions. Workaround is to add a cron job to chown ${WORKSPACE}\_ws-cleanup_cleanup\_$\{TIMESTAMP} which allows async cleanup to occur.
On second thoughts I think this is an improvement, not a defect. Nobody promised async cleanup will handle ownership errors etc. It would be nice to have support for it, but any solution will be hacky and
Agreed, in general, Jenkins does not promis it will delete anything not owned by the user running the agent. The correct course of action is to see, why are those directories owned by other users.
I hope for security purposes that the Jenkins agent process cannot become the root user as a general pattern. I don't think the plugin has any way to ask the operating system to promote the cleanup operation to root permission. Even if it did, I don't think it would be wise to make such a request, since agents that can easily become the root user can then also be used to harm the operating system that is hosting the agent
For some reason, here the problems appears on jobs that are using Docker images running root user inside. I would expect Jenkins to establish a permission mapping between its euid and container's root. What is even stranger is that not all files created in the relevant steps are surviving.