Task is not working for Cache 2017.2.2 as there is no error message but the data does not get cleaned.
Hello everybody. I have a problem a little bit strange. The thing is that there is a Task on Cache that by default is executed everyday at 4:00:00 that, with my settings, will delete all the Audit logs with more than 70 days of existence. The problem is that everyday this task is executed without an error message (status "Success" after the task is finished) but no data is cleaned, the same if I executed this particular task on the "Task Schedule" screen. I'll put here a screenshot of the message after executing the task on the "Task Schedule":
I've checked for several things on Caché Management Portal settings but nothing works, and also executed an Integrity check with that shows no problems and now I don't know what to look for to resolve this issue. I know is has to base something in the DB as I've made a copy of it and mounted it in another PC, where the same issue happens every day.
Can anyone figure out what causes this problem?
Thank you so much,
Pablo.
Try calling the method ##сlass(%SYS.Audit).Delete() manually and see what result it will return.
Hi Vitaliy. I forgot to say that the audit logs are in other namespace called "ACB". Whatever, I also tried to delete the logs manually via SQL and it works. There is something in the task itself or the DB preventing the task to have a normal behavior. I have updated the main post with the task configuration, so anyone can see if there is a problem there.
Thanks for your help,
Pablo.
I am confused by the name of your task "Clean Audit Log Tables" and the fact that for some reason it is in the ACB namespace. This is your own task?By default, Caché already has a system task PurgeAudit in the %SYS namespace, where you can also specify the number of days (Purge Audit Log)
Yes, it's a namespace and a task created by me. The thing is that it works normally in my own database or in other PCs databases, but not in this particular one. That cache task PurgeAudit works also with this database, but as you point, this is for the namespace %SYS and not other one than that.
Now it's clearer, you're cleaning up own audit records.
As @Yaron Munz pointed out, it's most likely that the Task2 user does not have some rights.
For simplicity, you can login to Caché Terminal under this user in the ACB namespace and call your code:
I will take a look, thank you :)
Hello Vitaliy, as I said to Yaron, I've granted to the user all kind of rights but it continues like that. I've also change user to Administrator but nothing has changed. It seems it is also not related with the user who runs the task.
I also noticed three things from your screenshots:
1. Yes, it should be like that, as there are other systems where the configuration is like that and the task works perfectly. I will change to see what happens
2.Yes, same as above. Although, I will change it too
3. That is because through the Task Schedule tool I manually executed the task after son changes.
Check the user "task2" permissions, maybe this user does not have permission to the audit databse?
I will check, thank you :)
I've granted to the user all kind of rights but it continues like that. I've also change user to Administrator but nothing has changed. It seems it is also not related with the user who runs the task.