Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

303 HTTP response #20

Closed
richowen opened this issue Nov 12, 2023 · 14 comments · Fixed by #22
Closed

303 HTTP response #20

richowen opened this issue Nov 12, 2023 · 14 comments · Fixed by #22
Assignees
Labels
bug Something isn't working

Comments

@richowen
Copy link

Hi, im on unraid, getting this error after community applications setup, changing sonarr and watchlist to matching networks doesnt help.

Exception in thread "main" java.lang.IllegalArgumentException: Unable to connect to Sonarr at http://192.168.1.2:8989, with error org.http4s.client.UnexpectedStatus: unexpected HTTP status: 303 See Other for request GET http://192.168.1.2:8989/api/v3/rootFolder
at configuration.Configuration.throwError(Configuration.scala:146)
at configuration.Configuration.$anonfun$getSonarrConfig$4(Configuration.scala:41)
at >>$extension @ org.typelevel.keypool.KeyPool$Builder.keepRunning$1(KeyPool.scala:370)
at >>$extension @ org.typelevel.keypool.KeyPool$Builder.keepRunning$1(KeyPool.scala:370)
at void @ org.typelevel.keypool.KeyPool$.reap(KeyPool.scala:187)
at unsafeRunSync @ configuration.Configuration.(Configuration.scala:19)
at getAndSet @ org.typelevel.keypool.KeyPool$.destroy(KeyPool.scala:120)
at >>$extension @ org.typelevel.keypool.KeyPool$Builder.keepRunning$1(KeyPool.scala:370)
17:31:51.137 [io-compute-15] ERROR configuration.Configuration - Unable to connect to Sonarr at http://192.168.1.2:8989, with error org.http4s.client.UnexpectedStatus: unexpected HTTP status: 303 See Other for request GET http://192.168.1.2:8989/api/v3/rootFolder

@nylonee
Copy link
Owner

nylonee commented Nov 12, 2023

Thanks for the logs, I'll take a look and see if I can spot the issue. Out of curiosity is there anything interesting when you go to http://192.168.1.2:8989/api/v3/rootFolder in a browser?

Also could you let me know what version of Sonarr you're using?

@richowen
Copy link
Author

hi,

http://192.168.1.2:8989/sonarr/api/v3/rootFolder gives:

{
  "error": "Unauthorized"
}

From the api docs:

curl -X 'GET' \
  'http://192.168.1.2:8989/api/v3/rootfolder?apikey=5c4c2175c1a74d15b1f666bf44869925' \
  -H 'accept: application/json'

gives:

[
  {
    "path": "/tv",
    "accessible": true,
    "freeSpace": 42470292189184,
    "unmappedFolders": [ etc...

sonarr version:

Version
    3.0.10.1567
Package Version
    3.0.10.1567-ls212 by [linuxserver.io](https://linuxserver.io/) 
Mono Version
    6.12.0.200
AppData directory
    /config
Startup directory
    /app/sonarr/bin
Mode
    Console

tested on windows aswell, same error

@richowen
Copy link
Author

docker run
  -d
  --name='Watchlistarr'
  --net='bridge'
  -e TZ="Europe/London"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Server"
  -e HOST_CONTAINERNAME="Watchlistarr"
  -e 'SONARR_API_KEY'='myapi'
  -e 'SONARR_BASE_URL'='http://192.168.1.2:8989'
  -e 'RADARR_API_KEY'='myapi'
  -e 'RADARR_BASE_URL'='http://192.168.1.2:7878'
  -e 'PLEX_WATCHLIST_URL_1'='watchlistrss'
  -e 'PLEX_WATCHLIST_URL_2'='watchlistrss'
  -e 'REFRESH_INTERVAL_SECONDS'='15'
  -e 'SONARR_QUALITY_PROFILE'=''
  -e 'SONARR_ROOT_FOLDER'=''
  -e 'RADARR_QUALITY_PROFILE'=''
  -e 'RADARR_ROOT_FOLDER'=''
  -e 'SONARR_BYPASS_IGNORED'=''
  -e 'RADARR_BYPASS_IGNORED'=''
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://github.com/nylonee/watchlistarr/blob/main/watchlistarr.png?raw=true' 'nylonee/watchlistarr:alpha'

is my docker run on unraid

@richowen
Copy link
Author

2023-11-12 18:07:15.3|Info|Auth|Auth-Unauthorized ip 192.168.1.10 url 'http://192.168.1.2:8989/sonarr/api/v3/rootFolder'

from sonarr logs.

Ive setup overseerr today with the same api keys and ips, thats working fine

@nylonee
Copy link
Owner

nylonee commented Nov 12, 2023

Thanks for these. I will review the logs and see if I'm missing a use case, are you using login authentication on Sonarr?

Also unrelated, but could you use the latest or beta version of watchlistarr? The alpha tag is linked to the latest PR that anybody has raised, so it'll be extremely unstable!

@richowen
Copy link
Author

yeh i was just testing with alpha, ill swap back.

no authentication: https://share.richowen.me/JOwa3/VAmedape64.png/raw

@richowen
Copy link
Author

ok its something to do with my URLBASE in sonarr/radarr, removed the /sonarr in the sonarr general and its connected, but i kinda need the url base lol

@nylonee
Copy link
Owner

nylonee commented Nov 12, 2023

Interesting, I'll replicate your setup (tomorrow) with the URLbase behind a reverse proxy and see if I can get the same error. Thanks for all the help debugging!

@richowen
Copy link
Author

thanks, glhf :D

@richowen
Copy link
Author

bit more info, changed to subdomains, connects ok but then throws:

19:17:28.778 [io-compute-21] INFO WatchlistSync$ - Failed to add show The Wire (2002): org.http4s.client.UnexpectedStatus: unexpected HTTP status: 400 Bad Request for request POST https://sonarr.richowen.me/api/v3/series

@richowen
Copy link
Author

tried with and without sonarr auth

@richowen
Copy link
Author

richowen commented Nov 12, 2023

2023-11-12 19:34:00.0|Info|Auth|Auth-Unauthorized ip 172.19.0.1 url 'http://192.168.1.2:8989/sonarr/api/v3/queue?apikey=(removed)&includeEpisode=true'
2023-11-12 19:34:02.3|Warn|SonarrErrorPipeline|Invalid request Validation failed: 
 -- LanguageProfileId: Language profile does not exist

@nylonee
Copy link
Owner

nylonee commented Nov 13, 2023

Thanks, I've raised a new issue for the Language profile error here, I'll fix both issues separately

@nylonee nylonee added the bug Something isn't working label Nov 13, 2023
@nylonee
Copy link
Owner

nylonee commented Nov 13, 2023

Regarding this issue, I was able to replicate it by setting my URLBase to /sonarr:

15:03:49.282 [io-compute-3] ERROR configuration.Configuration - Unable to connect to Sonarr at http://REDACTED, with error org.http4s.client.UnexpectedStatus: unexpected HTTP status: 302 Found for request GET http://REDACTED/api/v3/rootFolder
Exception in thread "main" java.lang.IllegalArgumentException: Unable to connect to Sonarr at http://REDACTED, with error org.http4s.client.UnexpectedStatus: unexpected HTTP status: 302 Found for request GET http://REDACTED/api/v3/rootFolder
        at configuration.Configuration.throwError(Configuration.scala:146)
        at configuration.Configuration.$anonfun$getSonarrConfig$4(Configuration.scala:41)
        at >>$extension @ org.typelevel.keypool.KeyPool$Builder.keepRunning$1(KeyPool.scala:370)
        at >>$extension @ org.typelevel.keypool.KeyPool$Builder.keepRunning$1(KeyPool.scala:370)
        at void @ org.typelevel.keypool.KeyPool$.reap(KeyPool.scala:187)
        at unsafeRunSync @ configuration.Configuration.<init>(Configuration.scala:19)
        at getAndSet @ org.typelevel.keypool.KeyPool$.destroy(KeyPool.scala:120)
        at >>$extension @ org.typelevel.keypool.KeyPool$Builder.keepRunning$1(KeyPool.scala:370)

I think the fix would be to allow the user to define a baseurl via the environment variable:
-e 'SONARR_BASE_URL'='http://localhost:8989/sonarr'

I'll fix that up now. Thanks for spotting this and all your debug logs! Made my life so much easier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants