rep_daemon - Unable to remove file from /CATALINA_BASE/temp/xxxx.gz

Document ID : KB000099887
Last Modified Date : 01/06/2018
Show Technical Document Details
Customer is getting errors in the stdlog file, when rep_daemon tries to remove the .gz files from CATALINA_BSE\temp folder:

05/25 11:13:56.36 xxxx rep_daemon 8848 ERROR FileMng.c 839 DeleteFile() - Unable to remove file D:/PROGRA~2/CA/SERVIC~1/bopcfg/www/CATALINA_BASE/temp/bc32c34c-44ca-4877-8123-585a7c331f7b5500926439664205049.gz (error code: 5) 

this is causing some disk space problems in Service Desk manager server
Ca Service Desk Manager 14.1.x
Some possible reasons that prevent a file deletion are: 
1. file locked by another user 
2. Lack of permission 
3. invalid path to the file 
4. Antivirus blocking the deletion 
5. file does not exist 
6. Lack of permission in CATALINA_BASE\temp folder from the repository user

So, the Service Desk application is trying to delete some files from temporary folder and is receiving a message from Operating System, telling that the deletion is denied. 
Some possible actions for resolution:

Check with the Security team, if there is any security policy that is preventing the application to delete files in that folder or if the Service Desk folder are protected from deletion, etc. 

Ensure that the user that was configured as repository user has necessary access and permission on the temp folder. 

Start a file monitor or something to monitor the temp folder and reproduce the problem to see what process is trying to delete the file and what is preventing the operation.