[DBCleaner] Running DBCleaner_API from timer runs into error regarding credentials

[DBCleaner] Running DBCleaner_API from timer runs into error regarding credentials

  
Forge Component
(20)
Published on 17 Mar by Acácio Porta Nova
20 votes
Published on 17 Mar by Acácio Porta Nova
When a created action (that uses DBCleaner_API (ModuleVersion_ListOldest and ModuleVersion_Delete)  is being runned as a timer it fails with the following message: "Current user does not hold the necessary credentials for invoking this action." I can see in that log message that the user of the job is empty. So my question is: How can I define a user to run the timer?

The module is configured to use ServiceCenter as User Provider, so that's ok.
The DBCleaner API is documented here.

You'll notice that most actions require Administrator privileges to run. You'll need to use the built-in Login action in the timer in order to make sure it is running with the right credentials.
Hi Ricardo,

Thanks for your fast response.

Am I correct that I have to implement a User_Login action in the Action that's called using a timer (a timer is in my opinion only something that starts an action when for example a schedule is planned)?

How can I do this without saving any user credentials in clear text in the eSpace? I was thinking about the User_Login action from the Users eSpace, but that need unencrypted information.

Thanks.
Solution
You can use the built-in Login function which only takes a user id.
Solution
Hi Ricardo,

That worked like a charm. We have now a timer in place that removes old, untagged version from the dev environment. Now i am going to check the functionality regarding DB cleanup (attributes and entities :D)

Thanks again.