(Solved)/api/release/push - not found

Sonarr version (exact version): 2.0.0.5301
Mono version (if Sonarr is not running on Windows): 5.8.0.127
OS: Debian
Debug logs: Not Applicable (hence the issue I think)
Description of issue: I am trying to set up autodl-curl-sonarr. When I manually run the script I get no errors now (initially has bash command not found error) however nothing happens in Sonarr.

There are no logs on debug or any other level either, hence I am assuming the script is not hitting Sonarr at all.

This leaves me with only one assumption that api/release/push is not getting hit. When I access localhost or 127.0.0.1/api/release/push?apikey=‘key’ I get a not found error. Same thing happens when I try /sonarr/api/release/push. My URL base in Sonarr is /sonarr.

Can anyone please suggest what can be done or any other ideas that I havent thought of?

youre hitting the api, just giving it the wrong commands. its telling you the api command you gave it was not found/complete

try /api/downloadclient?apikey=key for a list of all download clients

or /api/downloadclient/1?apikey=key to see the first entry (first as in created, not first in the GUI)

what were you expecting to get back for /api/release/push?

edit;

/api/release?episodeId=1&apikey=key should give you the first entry

so the script should be able to pull the release out of the cache, then use its properties to push it to a download client

/api/release/push?title=(string)&downloadUrl=(string)&protocol=Usenet or Torrent)&publishDate=(ISO8601 Date)&apikey=key

if you miss any of those parameters you get the notfound instead (which makes it hard to manually test them)

1 Like

Thanks for your reply. I am tyring to run this -

https://github.com/Zymest/autodl-curl-sonarr

My autodl is grabbing and sending the releases to Sonarr. The script has all the parameters however it wasn’t returning any data. Hence I ‘assumed’ the issue was api/release (I am wrong looks like). However not sure why its still not hitting Sonarr in order for me to troubleshoot.

ok, its using the passed args to fill in the command

upload-args = “$(TorrentName)” “$(TorrentUrl)” YOUR_SONARR_API_KEY

and then hard coding the torrent type and date

you just have to make sure that http://localhost:8989 is correct, ie the script is running on the same host as sonarr and youre using the default port as well

from where ever the script is running can you run this
/usr/bin/curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Api-Key: your_api_key_goes_here" -X POST -d '{}' http://localhost:8989/api/downloadclient

that should return something other than NotFound (a list of your download clients). if it doesnt then you need to tweak the hostname and port parts of the URL on the end until it does work, then update the script with the hostname and port that you get working

1 Like

Thanks again. Localhost:8989 looks right as I can access Sonarr through x2go if I open that on the same server (or 127.0.0.1) with 8989 port.

Here is the first output if i run the script exactly as you advised:

https://pastebin.com/Lmgkdq4X

Here is the second output if I run /sonarr/api/downloadclient (I know this is not mentioned but ran it anyway)

https://pastebin.com/cvNcYnPJ

first one got a 303 redirect to /sonar/…

second one got a json output back but sonarr didnt like the input at all

any chance you could kill the redirect and try it without it? just that sonarr may not like getting /sonarr/api and want just /api

1 Like

In order to redirect I would need to remove URL base right? When I tried to remove it I could no longer login to Sonarr and has to edit config file to add urlbase to log back in. If it helps here is my Sonarr setting:
https://unsee.cc/247eb4a1/

Sonarr is installed on a dedi seedbox (mentioning this in case it is relevant).

Your time in helping troubleshoot is much appreciated.

ok, back to basics

/usr/bin/curl http://localhost:8989/sonarr/api/downloadclient/1?apikey=your_api_key_goes_here

does that pull out data for your first download client?

and i see where i screwed up for the other command, i forgot to change the POST to a GET when i pasted it in, sorry

/usr/bin/curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Api-Key: your_api_key_goes_here" -X GET -d '{}' http://localhost:8989/sonarr/api/downloadclient

1 Like

This gives the required output as below:
https://pastebin.com/0RjHv25x

Sorry, I didnt spot that either, this also gives the desired results as below:
https://pastebin.com/fLgg2Pip

Thank you

ok, so we know that localhost:8989/sonarr/api works so you should be able to edit the script and just add in the /sonarr/ part into the URL on the end and it should work

{
/usr/bin/curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Api-Key: $apiKey" -X POST -d '{"title":"'"$title"'","downloadUrl":"'"$downloadUrl"'","downloadProtocol":"torrent","publishDate":"'"$date"'"}' http://localhost:8989/sonarr/api/release/push
} &> /dev/null

1 Like

This is exactly what I had run earlier (localhost and 127…). I am going to restart the service just to be safe and will report back.

Edit:
Dang it. What do you know, this is the exact same thing I had started with seems to be working now.

The only thing that I did was reinstall Sonarr.

Happy to report that it works 99% of the time. The only error noticed a few times- “NzbDroneErrorPipeline - Request Failed. POST /api/release/push: Sequence contains no elements”.

Thanks again @rhom for your patience and help.

Edit 2 - I have a few shows airing tomorrow, will report back if something doesnt work.

Edit 3 - all good. It’s working just fine. Reinstall did the trick. Thanks a ton.

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