@Franklin
Please try this:
1. On ambari agent host please find this script "/usr/lib/ambari-agent/lib/ambari_agent/CustomServiceOrchestrator.py" and then search for a string with 'if the return type is not used'
# grep -A2 'if the return type is not used' /usr/lib/ambari-agent/lib/ambari_agent/CustomServiceOrchestrator.py
# if the return type is not used
base_dir = self.file_cache.get_service_base_dir(command)
script_path = self.resolve_script_path(base_dir, script)
.
2. Just add a new line on all agent hosts self.file_cache.get_host_scripts_base_dir(command) there as following Just below the commented line:
# grep -A2 'if the return type is not used' /usr/lib/ambari-agent/lib/ambari_agent/CustomServiceOrchestrator.py
# if the return type is not used
self.file_cache.get_host_scripts_base_dir(command)
base_dir = self.file_cache.get_service_base_dir(command)
script_path = self.resolve_script_path(base_dir, script)
.
**NOTE:** Python is Indentation sensitive so you will need to put the same indentation while adding the line there (else it might cause some syntax error)
3. Clear the Agent Cache Dir (or move it as backup)
# mv /var/lib/ambari-agent/cache /var/lib/ambari-agent/cache_OLD
.
4. Restart the ambari server and agent.
# ambari-server restart
# ambari-agent restart
.
5. Now check the host script dir if it has pulled file the custom scripts from ambari server host.
# ls -lart /var/lib/ambari-agent/cache/host_scripts/
.
It looks related to: https://issues.apache.org/jira/browse/AMBARI-25123