Custom Script failing to execute

I’m trying to run a custom script on ubuntu 16.04 and it seems like something is messing up inside of sonarr. It tries to runs it, fails with a 255 and shows no output in the log.

Right now I’m running a simple script that should work to output the env variables and nothing is happening.

 #!/bin/bash
 echo "Reading environment variables"
 env > /tmp/env_var.txt
 echo "Check env_var for results"

Here is a snippet from the debug log

17-2-19 13:16:09.0|Debug|CustomScript|Executing external script: /mnt/Media/RemoveTorrentScript.sh
17-2-19 13:16:09.0|Debug|RemoveTorrentScript.sh|Starting /mnt/Media/RemoveTorrentScript.sh 
17-2-19 13:16:09.1|Debug|CustomScript|Executed external script: /mnt/Media/RemoveTorrentScript.sh - Status: 255
17-2-19 13:16:09.1|Debug|CustomScript|Script Output: 

17-2-19 13:16:09.1|Debug|Api|[GET] /api/queue??sort_by=timeleft&order=asc: 200.OK (5 ms)```

Status 255 appears to be a general error that it failed to execute. It could be a number of things.

Is that file executable by the user running Sonarr?

So it has full permission (777)
-rwxrwxrwx 1 1026 users 109 Feb 19 13:57 RemoveTorrentScript.sh

I even tried changing the user/group to same as running sonarr and still get 255

It’s possible Sonarr doesn’t know how to execute it (which shell to use), in that case you’d set the script path to the shell to run and the arguments to whatever is required to execute that script. I’m not sure exactly sure what that would look like though.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.