Backup plugin: unable to delete files in a Local Storage


  • My backup job is failing with a similar traces like the following in the Console Build logs:
Caused: Unable to delete /var/lock - files in dir: [/var/lock/subsys] 
at hudson.Util.tryOnceDeleteFile( 
at hudson.Util.deleteFile( 
Caused: Unable to delete '/var/lock'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts. 
at hudson.Util.deleteFile( 
at com.infradna.hudson.plugins.backup.retention.UpToNRetentionPolicy.scrub( 
at com.infradna.hudson.plugins.backup.BackupBuilder.scrub( 
at com.infradna.hudson.plugins.backup.BackupBuilder.doPerform( 
at com.infradna.hudson.plugins.backup.BackupBuilder.perform( 
at hudson.tasks.BuildStepMonitor$1.perform( 
at hudson.model.AbstractBuild$AbstractBuildExecution.perform( 
at hudson.model.Build$ 
at hudson.model.Build$BuildExecution.doRun( 
at hudson.model.AbstractBuild$ 
at hudson.model.Run.execute( 
at hudson.model.ResourceController.execute( 
An attempt to send an e-mail to empty list of recipients, ignored. 
Finished: FAILURE



This happens when backup target folder is a LocalFileStore type and the target folder contains a subfolder.

For example, having this folder structure

└── folder.example
    └── subfolder.example

If folder.example is configured as backup target folder from a local file system, it will fail. The solution is using folder.example/subfolder.example instead.

1. CloudBees Backup plugin >= 3.38.12 solves the issue, meaning that a Backup Target folder can contain subfolders.
2. For disaster recovery, it is highly recommended that you send the backup to a network drive, NFS-mounted directory, etc. see Backup Plugin - Local directory

Have more questions?


Please sign in to leave a comment.