JagandeepBrar / lunasea

Self-hosted software controller built using Flutter
https://www.lunasea.app
GNU General Public License v3.0
1.28k stars 63 forks source link

[Bug] Adding content results in `_oneByteString` Exception #264

Closed Centterm closed 4 years ago

Centterm commented 4 years ago

Describe the Bug When adding a movie or tv show within the radarr or sonarr part of the app, I get the an error and the movie/series will not be added. The log states the following Radarr: Failed to add movie (movie title): Exception:

type '_OneByteString' is not a subtype of type 'int' of 'index'

Stack Trace

#0      RadarrAPI.addMovie (package:lunasea/modules/radarr/core/api/api.dart:85)
<asynchronous suspension>
#1      _State._addMovie.<anonymous closure> (package:lunasea/modules/radarr/routes/add_details.dart)
<asynchronous suspension>

To Reproduce

Expected Behaviour

Versions 4.0.0 (4000102)

Additional context This has happend after I resetup my server and changed everything to docker. The test-connection works. Api Key is in place. I have tested two ios devices. Feel free to change the title if the _oneByteString thing is unrelated to this.

JagandeepBrar commented 4 years ago

Hi there, this error, while confusing at first glance, actually is saying that Sonarr has sent back an invalid response object. This typically occurs when the POST data being sent to Sonarr isn't being handled correctly. Calls that just fetch data (including the connection test) are GET requests, without any data body, which is why they are being processed correctly.

Some things you can check and ensure:

Beyond that, I can't help too much as this occurs from networking errors. Also ensure that the host entered into LunaSea is the correct protocol (http or https) as this is considered a redirect as well, and ensure that you do not have any extra data appended to the host (some users accidentally copy the /login?=... path for example).

Centterm commented 4 years ago

I knew it must be something with the network (as it worked flawlessly before dockering stuff) - but I was not able to figure it out...

Thanks for your hint, with this I figured out that the problem was due to me changing the base url path (/radarr and /sonarr). I had to add them to the LunaSea config in the url section. Thanks again.

Btw. the app is really awesome and well made! I will buy you a coffee!