Sonarr version 3.0.9.1549:
Mono version (if Sonarr is not running on Windows):
OS: Windows 10 (21H2):
Debug logs:
2022-11-07 15:21:42.8|Debug|CustomScript|Executing external script: M:\scripts\sonarr\execute.bat
2022-11-07 15:21:42.8|Debug|cmd.exe|Starting cmd.exe /c M:\scripts\sonarr\execute.bat
2022-11-07 15:21:42.9|Debug|cmd.exe|C:\Windows\system32>"C:\Users\(removed)\AppData\Local\Programs\Python\Python310\python.exe" "M:\scripts\sonarr\test_script.py"
2022-11-07 15:21:42.9|Error|cmd.exe|Access is denied.
2022-11-07 15:21:43.0|Debug|CustomScript|Executed external script: M:\scripts\sonarr\execute.bat - Status: 1
2022-11-07 15:21:43.0|Debug|CustomScript|Script Output:
07.11.2022 14:21:42 - Standard - C:\Windows\system32>"C:\Users\(removed)\AppData\Local\Programs\Python\Python310\python.exe" "M:\scripts\sonarr\test_script.py"
07.11.2022 14:21:42 - Error - Access is denied.
2022-11-07 15:21:43.0|Warn|SonarrErrorPipeline|Invalid request Validation failed:
-- : Script exited with code: 1
Description of issue:
I am trying to make a Python test custom script to see if I can get this working on windows.
If I set Sonarr to run my Python script M:\scripts\sonarr\test_script.py
I get the error “The system cannot find the file specified”
However, if I change the path to a BAT file I get a different error: “Script exited with code: 1”, in other words, something went wrong.
I have checked:
Python is added to PATH
My directories are:
📂 M:
┣ 📂 scripts
┃ ┣ 📂 sonarr
┃ ┃ ┣ 📃 execute.bat
┃ ┃ ┣ 📃 test_script.py
execute.bat:
python "M:\scripts\sonarr\test_script.py"
test_script.py:
from os import environ
try:
test = environ.get('sonarr_eventtype')
except Exception as e:
raise e
sonarr.debug.txt: