Unable to run python script with inputs.conf, getting below errors
03-21-2019 10:11:03.474 -0400 ERROR ExecProcessor - message from "python $Splunkhome/etc/apps/XX/bin/X.py" File "$Splunkhome/etc/apps/XX/bin/X.py", line 100, in
03-21-2019 10:11:03.474 -0400 ERROR ExecProcessor - message from "python $Splunkhome/etc/apps/XX/bin/X.py" fileIo = open(logFile,'w')
03-21-2019 10:11:03.474 -0400 ERROR ExecProcessor - message from "python $Splunkhome/etc/apps/XX/bin/X.py" IOError: [Errno 13] Permission denied: u'.//21032019-101102-datafeed.json'
But I can run script manually. $Splunkhome/bin/splunk cmd python $Splunkhome/etc/apps/XX/bin/X.py
Based on logs which you have provided it is saying that splunk process which is running as splunk user doesn't have permission to read
Usually I do this to test/troubleshoot scripts in Splunk:
$SPLUNK_HOME/bin/splunk cmd /bin/bash
This will start a shell session with all Splunk environment settings. Then I start the script like this:
$SPLUNK_HOME/bin/splunk cmd $SPLUNK_HOME/etc/apps/XX/bin/X.py
This helps a lot to understand where and/or why scripts fail to run.
In addition I add logging lines into the script that will tell me variables being used and which step is being processed. You can add them like this:
logging.debug('what ever you want to show in the logfile')
Hope that helps ...