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

Sonarr requests - "message": "constraint failed\r\nNOT NULL constraint failed: Series.Images" #440

Closed
godsplague opened this issue Jul 26, 2016 · 41 comments

Comments

@godsplague
Copy link

godsplague commented Jul 26, 2016

If this is a bug report please make sure you have filled the following in:
(If it's not a bug and a feature request then just remove the below)

Plex Requests.Net Version: 1.8.4

Operating System: win 10 x64

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

capture

Reproduction Steps:

Attempting to request tv series through sonarr. In the admin setup everything seems to be connected properly and test connectivity succeeds and is able to pull my unique quality profiles just fine. But when I go to request I get the oops something went wrong error. Tried showing you the debug log but it looks like everything is working ok though it is not. I have no issue accessing sonarr or plexrequests from inside my network or outside. Sorry if you need a different log just let me know. Thanks in advance

@sch1308
Copy link

sch1308 commented Jul 26, 2016

getting the same error on 1.8.4
image

@tidusjar
Copy link
Member

@godsplague If you are able to reproduce it and get the Something went wrong error. Can do please do the following:

Open up the developers console (F12 on Chrome), go to the Network Tab
image

Then press request to get the error message.
You should see a red entry in the network area now, something like this:
image

(There should only be 1 red entry).
If you then click on that and press the preview tab and post the content on here?

@sch1308 I'll take a look at where that error is happening in the code and plug it.

@tidusjar
Copy link
Member

@sch1308 There should be more logs that I require, one with "Adding Series" and also "Seasons = X, out of X seasons"

also "Sonarr API Options:"

@godsplague
Copy link
Author

hopefully this is what you need.
capture

I clicked that error and here is the text it gave me
http://pastebin.com/PpYw4P3K

@tidusjar
Copy link
Member

Thanks that helped. It seems that it failed to send something to Sonarr (It was being Auto Approved). It tried to put the Sonarr error messages on screen for you but it didn't contain any error messages (which is really strange).

I have fixed the exception being thrown, but I am not sure why Sonarr failed to accept the TV show (Anything in your Sonarr logs?).

@Collisionc
Copy link

This happened to me once and it was due to Sonarr not being able to find the show, even when I searched for it by name inside sonarr. The only way I could add the show was by using the tvbd: prefix instead of the show name.

@godsplague
Copy link
Author

Bizarre, checked the sonarr logs, which makes sense. Here is what I got (I cleared it and just did a request for a random title) http://pastebin.com/jyPPpdgh
seems like in the logs everything is working as it should be but it never gets added to the series in sonarr as it should, but I can go into sonarr and searcch the series myself and it finds it using the exact same search text. I might open up a support on sonarr's site as well and see what they think. Thanks for your help here, let me know if you think of anything else

@godsplague
Copy link
Author

is there any way to see the full JSON payload for the add series request from PlexRequests? I'm working with sonarr support as well to see what's going on https://forums.sonarr.tv/t/sonarr-having-issues-adding-series-requested-from-other-programs/11497

@tidusjar
Copy link
Member

Id have to give you a custom build so we can output it to the log. You okay with that?

On 27 Jul 2016, at 2:00 am, godsplague notifications@github.com wrote:

is there any way to see the full JSON payload for the add series request from PlexRequests? I'm working with sonarr support as well to see what's going on https://forums.sonarr.tv/t/sonarr-having-issues-adding-series-requested-from-other-programs/11497


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@godsplague
Copy link
Author

I'd be willing to try it, this is the only break in the chain on my whole media operation. I'd hate to have to find an alternative for plexrequests.net or sonarr. Seems odd I'm the only one having this issue though.

@tidusjar
Copy link
Member

I agree,

looking at the code, if you set your log level to Trace we should be able to see your options and the response from Sonarr.

Options is near the Sonarr API Options: log.

Response from Sonarr is near the Api Content Response: log

@godsplague
Copy link
Author

does this shed any light? trace log on sonarr right after a request. http://pastebin.com/NBUKkKTE
Also is this an issue? Looks like it has extra backslashes in the path?
capture

@tidusjar
Copy link
Member

This is the issue:
{ "message": "constraint failed\r\nNOT NULL constraint failed: Series.Images" }

That's what we are getting back from Sonarr. I've updated the Sonarr thread post. Let's see if they are able to shed any light

@tidusjar
Copy link
Member

Issue raised on Sonarr Sonarr/Sonarr#1403

@godsplague
Copy link
Author

Thank you very much for your support, seems odd I'm the first to bring up this issue. Am I doing things in a weird way or what? hahah

@tidusjar
Copy link
Member

I don't think so. I think you are just on an earlier release than everyone else. Everyone will end up with this issue... Which sucks.

@Collisionc
Copy link

Collisionc commented Jul 28, 2016

Yeah, it's happening everytime for me now. I didn't realize it because most people were requesting movies, not tv shows. Plexrequests-meteor is also broke.

@godsplague
Copy link
Author

Did it work previously? Wondering if going back one version would fix for the time being, or one version back on sonarr. You using sonarr too?

@Collisionc
Copy link

Sonarr. I believe it's a change on Sonarr's end, as meteor plex requests has been rock solid for about 6 months until recently, and they haven't changed anything in a few months.

@tidusjar
Copy link
Member

Correct, it's an issue in Sonarr

@godsplague
Copy link
Author

Makes sense, maybe I'll try going back one version on sonarr and see if it fixes when I have some more time. Not to sound rude at all but they have a lot going on I'm sure and who knows how long until it sees a fix

@tidusjar
Copy link
Member

tidusjar commented Jul 28, 2016

Yeah, I raised a bug with them as I couldn't add an unmontiored series using the API (Which i need for the feature to request individual episodes). They fixed it but it could be a while until it's released (Since they have some big changes at the moment), then it could be even longer for people to update, so im working around it for now.

@Collisionc
Copy link

I run sonarr on the development branch and that was already pushed, it doesn't fix the error that we are seeing in PlexRequests.

@tidusjar
Copy link
Member

I'm not aware of any change I can do to fix it. It's an internal Sonarr error.

I'll speak to Markus (Sonarr Dev) at some point today. But I suggest you downgrade Sonarr for now.

@godsplague
Copy link
Author

Thanks for your help

Sent via the Samsung Galaxy S7 active, an AT&T 4G LTE smartphone

-------- Original message --------
From: Jamie notifications@github.com
Date: 7/29/16 1:45 AM (GMT-06:00)
To: "tidusjar/PlexRequests.Net" PlexRequests.Net@noreply.github.com
Cc: godsplague army-man89@hotmail.com, Mention mention@noreply.github.com
Subject: Re: [tidusjar/PlexRequests.Net] Sonarr requests - oops something went wrong (#440)

I'm not aware of any change I can do to fix it. It's an internal Sonarr error.

I'll speak to Markus (Sonarr Dev) at some point today. But I suggest you downgrade Sonarr for now.

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/440#issuecomment-236107027, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQYBy5tmytvAOB23jufd0OMfuz6QI598ks5qaaGhgaJpZM4JUu3C.

tidusjar pushed a commit that referenced this issue Jul 29, 2016
@tidusjar
Copy link
Member

@godsplague I have a potential workaround. Can you try out this build?

https://ci.appveyor.com/project/tidusjar/requestplex/build/1.9.676/artifacts

@godsplague
Copy link
Author

I'll give it a try as soon as I am able, thanks!

Sent via the Samsung Galaxy S7 active, an AT&T 4G LTE smartphone

-------- Original message --------
From: Jamie notifications@github.com
Date: 7/29/16 11:07 AM (GMT-06:00)
To: "tidusjar/PlexRequests.Net" PlexRequests.Net@noreply.github.com
Cc: godsplague army-man89@hotmail.com, Mention mention@noreply.github.com
Subject: Re: [tidusjar/PlexRequests.Net] Sonarr requests - oops something went wrong (#440)

@godsplaguehttps://github.com/godsplague I have a potential workaround. Can you try out this build?

https://ci.appveyor.com/project/tidusjar/requestplex/build/1.9.676/artifacts

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/440#issuecomment-236220983, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQYBy0NL3smy6svGAdOZxeq6da9-09m4ks5qaiQ2gaJpZM4JUu3C.

@tidusjar
Copy link
Member

tidusjar commented Jul 29, 2016

@godsplague That's cool, no rush. It should fix it, just want to confirm.

@Collisionc this build should work around the issue: https://ci.appveyor.com/project/tidusjar/requestplex/build/1.9.676/artifacts

@Collisionc
Copy link

I had to delete my sqlite file to get plexrequestsnet to startup without errors, but when I did that and re-setup sonarr it still gives me "Something went wrong" when requesting a tv show.

@tidusjar
Copy link
Member

You had to delete your database?!?!

Can you please send me your latest backup (in the backup folder) at jamierees@outlook.com

What error are you getting in the browsers console?

On 29 Jul 2016, at 8:55 pm, Alex notifications@github.com wrote:

I had to delete my sqlite file to get plexrequestsnet to startup without errors, but when I did that and re-setup sonarr it still gives me "Something went wrong" when requesting a tv show.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@Collisionc
Copy link

Collisionc commented Jul 29, 2016

The database had been sitting at 364 MB for a few days (Somehow trace logging was enabled), but didn't seem to bother plexrequestsnet until this build. I had turned off trace logging, cleared the logs from the database, but it didn't automatically shrink it. I compacted/vacuumed the database down to 164 kb and was able to get plexrequestsnet to load it again.

Object
details
:
"Nancy.RequestExecutionException: Oh noes! ---> Newtonsoft.Json.JsonSerializationException: Error converting value 70366 to type 'PlexRequests.UI.Models.EpisodeRequestModel'. Path '', line 1, position 5. ---> System.ArgumentException: Could not cast or convert from System.Int64 to PlexRequests.UI.Models.EpisodeRequestModel.↵ at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable (System.Object value, System.Type initialType, System.Type targetType) <0x411c03c0 + 0x001bb> in :0 ↵ at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast (System.Object initialValue, System.Globalization.CultureInfo culture, System.Type targetType) <0x41addd70 + 0x000a7> in :0 ↵ at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType (Newtonsoft.Json.JsonReader reader, System.Object value, System.Globalization.CultureInfo culture, Newtonsoft.Json.Serialization.JsonContract contract, System.Type targetType) <0x4151a2f0 + 0x002bb> in :0 ↵ --- End of inner exception stack trace ---↵ at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType (Newtonsoft.Json.JsonReader reader, System.Object value, System.Globalization.CultureInfo culture, Newtonsoft.Json.Serialization.JsonContract contract, System.Type targetType) <0x4151a2f0 + 0x0034f> in :0 ↵ at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) <0x41513730 + 0x00127> in :0 ↵ at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) <0x41511930 + 0x001db> in :0 ↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7f9335d3b2a0 + 0x00029> in :0 ↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7f9335d39170 + 0x000a7> in :0 ↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7f9335d390f0 + 0x0006b> in :0 ↵ at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x7f9335d390a0 + 0x0003a> in :0 ↵ at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7f9335d394a0 + 0x00017> in :0 ↵ at PlexRequests.UI.Modules.SearchModule+<<-ctor>b__0_8>d.MoveNext () <0x41db5360 + 0x004ac> in :0 ↵ --- End of inner exception stack trace ---↵ at Nancy.NancyEngine.InvokeOnErrorHook (Nancy.NancyContext context, Nancy.ErrorPipeline pipeline, System.Exception ex) <0x41dab8c0 + 0x002c3> in :0 "
message
:
"Something went horribly, horribly wrong while servicing your request."
statusCode
:
500

Is the error that is in the console.

@tidusjar
Copy link
Member

Ah ok strange...

That's a new bug from the tv episode request work I am doing. It's not fully finished yet (as you can see).

If I get time tomorrow I'll create a new branch off master (latest release) and add the fix into there.

On 29 Jul 2016, at 10:58 pm, Alex notifications@github.com wrote:

The database had been sitting at 364 MB for a few days (Somehow trace logging was enabled), but didn't seem to bother plexrequestsnet until this build. I had cleared the logs from the database, but it didn't automatically shrink it. I compacted/vacuumed the database down to 164 kb and was able to get plexrequestsnet to load it again.

Object
details
:
"Nancy.RequestExecutionException: Oh noes! ---> Newtonsoft.Json.JsonSerializationException: Error converting value 70366 to type 'PlexRequests.UI.Models.EpisodeRequestModel'. Path '', line 1, position 5. ---> System.ArgumentException: Could not cast or convert from System.Int64 to PlexRequests.UI.Models.EpisodeRequestModel.↵ at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable (System.Object value, System.Type initialType, System.Type targetType) <0x411c03c0 + 0x001bb> in :0 ↵ at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast (System.Object initialValue, System.Globalization.CultureInfo culture, System.Type targetType) <0x41addd70 + 0x000a7> in :0 ↵ at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType (Newtonsoft.Json.JsonReader reader, System.Object value, System.Globalization.CultureInfo culture, Newtonsoft.Json.Serialization.JsonContract contract, System.Type targetType) <0x4151a2f0 + 0x002bb> in :0 ↵ --- End of inner exception stack trace ---↵ at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType (Newtonsoft.Json.JsonReader reader, System.Object value, System.Globalization.CultureInfo culture, Newtonsoft.Json.Serialization.JsonContract contract, System.Type targetType) <0x4151a2f0 + 0x0034f> in :0 ↵ at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) <0x41513730 + 0x00127> in :0 ↵ at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) <0x41511930 + 0x001db> in :0 ↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7f9335d3b2a0 + 0x00029> in :0 ↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7f9335d39170 + 0x000a7> in :0 ↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7f9335d390f0 + 0x0006b> in :0 ↵ at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x7f9335d390a0 + 0x0003a> in :0 ↵ at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7f9335d394a0 + 0x00017> in :0 ↵ at PlexRequests.UI.Modules.SearchModule+<<-ctor>b__0_8>d.MoveNext () <0x41db5360 + 0x004ac> in :0 ↵ --- End of inner exception stack trace ---↵ at Nancy.NancyEngine.InvokeOnErrorHook (Nancy.NancyContext context, Nancy.ErrorPipeline pipeline, System.Exception ex) <0x41dab8c0 + 0x002c3> in :0 "
message
:
"Something went horribly, horribly wrong while servicing your request."
statusCode
:
500

Is the error that is in the console.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@Collisionc
Copy link

No rush.

Another thing that I've noticed, cpu usage and memory usage on the program have skyrocketed in the build you linked. On my ubuntu VPS it's currently using 2 GB of ram and sitting at 30% cpu usage, and the ram usage is slowly creeping up over time.

Also, in the log this error message is being spammed:

System.InvalidOperationException: There is an error in XML document (1, 2). ---> System.InvalidOperationException: was not expected. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () <0x402af720 + 0x000b7> in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x7f9335eef5d0 + 0x000a1> in :0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, XmlDeserializationEvents events) <0x41bf7ac0 + 0x00823> in :0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) <0x41bf7a20 + 0x0007f> in :0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) <0x41bf7600 + 0x00097> in :0 at PlexRequests.Api.ApiRequest.DeserializeXml[T](System.String input) <0x410de5f0 + 0x000c3> in :0

@tidusjar
Copy link
Member

tidusjar commented Aug 1, 2016

Ah ok interesting, That's to do with the new Episode cacher job I added in (I haven't fully tested that yet, so that's probably where the memory leak is coming from).

What it does is goes through your Plex library and caches the episodes you have locally so we then know what to stop you from requesting in the UI.

@tidusjar tidusjar changed the title Sonarr requests - oops something went wrong Sonarr requests - "message": "constraint failed\r\nNOT NULL constraint failed: Series.Images" Aug 2, 2016
@tidusjar
Copy link
Member

tidusjar commented Aug 2, 2016

Here is a build that has been taken from Master (There is no new functionality) with the workaround

https://ci.appveyor.com/project/tidusjar/requestplex/build/1.8.680/artifacts

@Collisionc @godsplague

@Collisionc
Copy link

I pulled the latest dev commit and built it, it works fine on that branch too. I'm able to add series on sonarr with no issues so far.

@godsplague
Copy link
Author

Awesome, I'll try it later today as well. Thanks!

@godsplague
Copy link
Author

godsplague commented Aug 3, 2016

damn, no dice for me. http://pastebin.com/QKe8srwr Just tells me Something went wrong at the top right error. For the installation I just made a copy of the entire old plexrequest folder and then I copied in all the new files to overwrite.

OOPS, my mistake, I forgot to handle the check box on the .rar file. Working fine now!

@tidusjar
Copy link
Member

tidusjar commented Aug 3, 2016

Yeah the unblock is a PITA!

@cjdbury
Copy link

cjdbury commented Aug 5, 2016

Hey @tidusjar I've been having the same "Something went wrong" problem and that new build fixed it. Thanks!

@tidusjar
Copy link
Member

tidusjar commented Aug 5, 2016

@cjdbury Yeah it's probably due to the bug in Sonarr

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

5 participants