This article walks you through the Debugging process when your Delegates are not getting the defined Profiles applied on them.
A Delegate Profile enables you to run a startup script on the host/container/pod for a Harness Delegate when the Delegate is installed, or any time after that. You can create a single Delegate Profile and apply it to multiple Delegates. Or create Multiple profiled and apply them to delegates.
We have seen cases where customers notice that the chosen profile on a Delegate has not been applied and due to this, they run into issues when using Deployment as the Profile might have the required resources that were to be installed.
To debug the issue we can first start by checking the Harness UI delegates page to see when the last Profile was applied. If the time stamp here is outdated this means that the selected Profile has not been applied and to debug this further you would need to toggle the Profile from the selection menu on the delegate.
This will create delegate logs around the same Profile and you would see something like below in the logs :
Unable to check/start delegate profile, shouldContactManager :true, currently executing profile :false, isLocked :true, frozen :false.
The main thing to note here from the logs is the Attribute isLocked we can see that the value for this is set to True :
This attribute is set to True when the profile being applied resulted in continuous failures and was not successful in any attempts, due to this there is file created on the delegate called profile.lock if this file exists, Harness does not allow for new Profiles to be applied.
The best resolution for cases like this would be to log into the Delegate where the log line with this Attribute is being seen and to delete the file. This way when the next time a Profile is applied it will run successfully.