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

Movie Lookup Not Working #282

Closed
Proplex opened this issue May 28, 2016 · 21 comments
Closed

Movie Lookup Not Working #282

Proplex opened this issue May 28, 2016 · 21 comments

Comments

@Proplex
Copy link

Proplex commented May 28, 2016

Plex Requests.Net Version:

1.7.4

Operating System:

WS2012

Mono Version:

Applicable Logs (from /logs/ directory or the Admin page):

From /logs/

PlexRequests.Helpers.Exceptions.ApiRequestException: Error retrieving response. Check inner details for more info. ---> System.InvalidCastException: Unable to cast object of type 'RestSharp.JsonArray' to type 'System.Collections.Generic.IDictionary`2[System.String,System.Object]'. at RestSharp.Deserializers.JsonDeserializer.CreateAndMap(Type type, Object element) at RestSharp.Deserializers.JsonDeserializer.ConvertValue(Type type, Object value) at RestSharp.Deserializers.JsonDeserializer.Map(Object target, IDictionary`2 data) at RestSharp.Deserializers.JsonDeserializer.CreateAndMap(Type type, Object element) at RestSharp.Deserializers.JsonDeserializer.ConvertValue(Type type, Object value) at RestSharp.Deserializers.JsonDeserializer.Map(Object target, IDictionary`2 data) at RestSharp.Deserializers.JsonDeserializer.CreateAndMap(Type type, Object element) at RestSharp.Deserializers.JsonDeserializer.ConvertValue(Type type, Object value) at RestSharp.Deserializers.JsonDeserializer.BuildList(Type type, Object parent) at RestSharp.Deserializers.JsonDeserializer.ConvertValue(Type type, Object value) at RestSharp.Deserializers.JsonDeserializer.Map(Object target, IDictionary`2 data) at RestSharp.Deserializers.JsonDeserializer.CreateAndMap(Type type, Object element) at RestSharp.Deserializers.JsonDeserializer.ConvertValue(Type type, Object value) at RestSharp.Deserializers.JsonDeserializer.Deserialize[T](IRestResponse response) at RestSharp.RestClient.Deserialize[T](IRestRequest request, IRestResponse raw) --- End of inner exception stack trace --- at PlexRequests.Api.ApiRequest.Execute[T](IRestRequest request, Uri baseUri) in C:\projects\requestplex\PlexRequests.Api\ApiRequest.cs:line 70 at PlexRequests.Api.CouchPotatoApi.<>c__DisplayClass9_0.b__0() in C:\projects\requestplex\PlexRequests.Api\CouchPotatoApi.cs:line 146 at Polly.Policy.<>c__DisplayClass8_0`1.b__0() at Polly.Retry.RetryEngine.Implementation(Action action, IEnumerable`1 shouldRetryPredicates, Func`1 policyStateFactory) at Polly.RetrySyntax.<>c__DisplayClass13_0.b__0(Action action, Context context) at Polly.Policy.Execute[TResult](Func`1 action, Context context) at Polly.Policy.Execute[TResult](Func`1 action) at PlexRequests.Api.RetryHandler.Execute[T](Func`1 func, TimeSpan[] timeSpan, Action`2 action) in C:\projects\requestplex\PlexRequests.Api\RetryHandler.cs:line 63 at PlexRequests.Api.CouchPotatoApi.GetMovies(Uri baseUrl, String apiKey, String[] status) in C:\projects\requestplex\PlexRequests.Api\CouchPotatoApi.cs:line 146

Reproduction Steps:

Searching for any movie results in the spinning loader and no results. This is what's found in the network response from /search/movie/*

{statusCode: 500, message: "Something went horribly, horribly wrong while servicing your request.",…}
details
:
"Nancy.RequestExecutionException: Oh noes! ---> System.ArgumentNullException: Value cannot be null.
↵Parameter name: source
↵   at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)
↵   at PlexRequests.Services.Jobs.CouchPotatoCacher.QueuedIds() in C:\projects\requestplex\PlexRequests.Services\Jobs\CouchPotatoCacher.cs:line 90
↵   at PlexRequests.UI.Modules.SearchModule.ProcessMovies(MovieSearchType searchType, String searchTerm) in C:\projects\requestplex\PlexRequests.UI\Modules\SearchModule.cs:line 205
↵   at PlexRequests.UI.Modules.SearchModule.SearchMovie(String searchTerm) in C:\projects\requestplex\PlexRequests.UI\Modules\SearchModule.cs:line 162
↵   at PlexRequests.UI.Modules.SearchModule.<.ctor>b__0_1(Object parameters) in C:\projects\requestplex\PlexRequests.UI\Modules\SearchModule.cs:line 97
↵   at CallSite.Target(Closure , CallSite , Func`2 , Object )
↵   at Nancy.Routing.Route.<>c__DisplayClass4.<Wrap>b__3(Object parameters, CancellationToken context)
↵   --- End of inner exception stack trace ---
↵   at Nancy.NancyEngine.InvokeOnErrorHook(NancyContext context, ErrorPipeline pipeline, Exception ex)"
message
:
"Something went horribly, horribly wrong while servicing your request."
statusCode
:
500

Movie searching.used to work just fine, this was sudden and there were no changes on my end. Perhaps the API changed? TV Show searching works just fine.

@tidusjar
Copy link
Member

Interesting... Is this for everything you are searching for or just a certain movie?

@Proplex
Copy link
Author

Proplex commented May 28, 2016

Everything I am searching

@mattyteds
Copy link

Same issue on freeNAS

@tidusjar
Copy link
Member

Same error @Tedrock ?

Does 1.6 work fine? Because nothing has changed in the searching...

@tidusjar
Copy link
Member

I can see something that potentially could cause the issue. I'll do some digging and when I me it, do you guys mind trying a Dev build to confirm the fix?

@Proplex
Copy link
Author

Proplex commented May 28, 2016

Sure, I wouldn't mind. For the record, I've been at 1.7.4 for a few days now. This was just something I woke up to; so I don't think it's your fault per se.

@tidusjar
Copy link
Member

I think it's something to do with something in your CP.

PlexRequests.Services.Jobs.CouchPotatoCacher.QueuedIds()

@tidusjar
Copy link
Member

Actaully the area where I think it has broken has already been improved in the dev build.

Can you please try this: https://ci.appveyor.com/project/tidusjar/requestplex/build/1.7.435/artifacts

@Proplex
Copy link
Author

Proplex commented May 28, 2016

Sure, I'll give it a try. But I believe I already fixed it; I restarted PlexRequests and now it works fine? Interesting nonetheless, but I was having http-to-https problems anyway since the domain I'm running this on has HSTS and strict https requirements and the posters weren't loading.

Thanks for the help thus far, weird bug.

@tidusjar
Copy link
Member

The latest dev build has HTTPS posters.

@Proplex
Copy link
Author

Proplex commented May 28, 2016

Okay, so I think I've nailed it down to CouchPotato. If I disable CouchPotato integration and restart PlexRequests, the search works fine. But if I enabled CP integration and restart again, the 500 error occurs.

There were no recent updates to CP, so this is interesting nonetheless. I'll look into this further.

@tidusjar
Copy link
Member

I think it's been fixed in the dev build. I think we was checking CP and we was expecting something that we didn't get.

@Proplex
Copy link
Author

Proplex commented May 28, 2016

I'm getting a Nancy.ViewEngines.ViewNotFoundException: Unable to locate view 'Index' on the current dev build on /userlogin, so let me see what's going on first and I'll let you know if the bug was fixed.

@tidusjar
Copy link
Member

Unblocked the zip?

@Proplex
Copy link
Author

Proplex commented May 28, 2016

You're a fast replier; I just realized that as I hit submit.

@Proplex
Copy link
Author

Proplex commented May 28, 2016

Yep, the Dev build appears to have fixed the issue. CP enabled and still getting results. Thanks.

@tidusjar
Copy link
Member

Ok good!

@Proplex
Copy link
Author

Proplex commented May 28, 2016

While the dev build fixed that issue, movie approval no longer works:

PlexRequests Logs:

System.ArgumentException: Cannot build uri when url segment parameter 'imdbid' value is null. Parameter name: request at RestSharp.RestClient.BuildUri(IRestRequest request) at RestSharp.RestClient.ConfigureHttp(IRestRequest request, IHttp http) at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func`3 getResponse)

Network response:

{statusCode: 500, message: "Something went horribly, horribly wrong while servicing your request.",…}
details
:
"Nancy.RequestExecutionException: Oh noes! ---> PlexRequests.Helpers.Exceptions.ApiRequestException: Error retrieving response. Check inner details for more info. ---> System.ArgumentException: Cannot build uri when url segment parameter 'imdbid' value is null.
↵Parameter name: request
↵   at RestSharp.RestClient.BuildUri(IRestRequest request)
↵   at RestSharp.RestClient.ConfigureHttp(IRestRequest request, IHttp http)
↵   at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func`3 getResponse)
↵   --- End of inner exception stack trace ---
↵   at PlexRequests.Api.ApiRequest.ExecuteJson[T](IRestRequest request, Uri baseUri) in C:\projects\requestplex\PlexRequests.Api\ApiRequest.cs:line 119
↵   at PlexRequests.Api.CouchPotatoApi.<>c__DisplayClass6_0.<AddMovie>b__0() in C:\projects\requestplex\PlexRequests.Api\CouchPotatoApi.cs:line 65
↵   at Polly.Policy.<>c__DisplayClass8_0`1.<Execute>b__0()
↵   at Polly.Retry.RetryEngine.Implementation(Action action, IEnumerable`1 shouldRetryPredicates, Func`1 policyStateFactory)
↵   at Polly.RetrySyntax.<>c__DisplayClass13_0.<WaitAndRetry>b__0(Action action, Context context)
↵   at Polly.Policy.Execute[TResult](Func`1 action, Context context)
↵   at Polly.Policy.Execute[TResult](Func`1 action)
↵   at PlexRequests.Api.RetryHandler.Execute[T](Func`1 func, TimeSpan[] timeSpan, Action`2 action) in C:\projects\requestplex\PlexRequests.Api\RetryHandler.cs:line 63
↵   at PlexRequests.Api.CouchPotatoApi.AddMovie(String imdbid, String apiKey, String title, Uri baseUrl, String profileId) in C:\projects\requestplex\PlexRequests.Api\CouchPotatoApi.cs:line 65
↵   at PlexRequests.UI.Modules.ApprovalModule.RequestMovieAndUpdateStatus(RequestedModel request, String qualityId) in C:\projects\requestplex\PlexRequests.UI\Modules\ApprovalModule.cs:line 182
↵   at PlexRequests.UI.Modules.ApprovalModule.Approve(Int32 requestId, String qualityId) in C:\projects\requestplex\PlexRequests.UI\Modules\ApprovalModule.cs:line 106
↵   at PlexRequests.UI.Modules.ApprovalModule.<.ctor>b__0_0(Object parameters) in C:\projects\requestplex\PlexRequests.UI\Modules\ApprovalModule.cs:line 65
↵   at CallSite.Target(Closure , CallSite , Func`2 , Object )
↵   at Nancy.Routing.Route.<>c__DisplayClass4.<Wrap>b__3(Object parameters, CancellationToken context)
↵   --- End of inner exception stack trace ---
↵   at Nancy.NancyEngine.InvokeOnErrorHook(NancyContext context, ErrorPipeline pipeline, Exception ex)"
message
:
"Something went horribly, horribly wrong while servicing your request."
statusCode
:
500

@tidusjar
Copy link
Member

tidusjar commented May 28, 2016

Can you go on gitter?
https://gitter.im/tidusjar/PlexRequests.Net

@tidusjar
Copy link
Member

There was a bug within Dapper.Contrib where it was not returning us the id after inserting via an Async method. Updated Dapper.Contrib and it now works.

@tidusjar
Copy link
Member

This has been fixed in the Dev build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants