Sonarr Plugin GUI Update Issues

Status
Not open for further replies.

AdianIV

Dabbler
Joined
Feb 7, 2015
Messages
26
FreeNAS Version: FreeNAS-9.3-STABLE-201502142001
I can provide hardware specs as needed, but I'm not sure they'll be relevant in this case.

I've just recently installed FreeNAS to a custom built server. I currently have a Windows server running Sonarr, and my FreeNAS plugin installation is behaving differently in the following ways:
  1. Tasks within Sonarr do not appear to be writing back to the GUI properly. That is, if I do a Series Refresh (or Episode Rename), I get the spinning icon and an alert at the bottom of the screen that it has started, but the spinning wheel and alert remain even after it has completed. I see no errors in the log. The same holds true for when I select to download an item. A browser refresh clears the issue, so it's not in any way a critical issue.
  2. Sonarr doesn't appear to be communicating to SABnzbd for GUI updates. For example, the Calendar does not update for shows that are currently On Air or Downloading. They are simply Missing until they are not. The same holds true in the Series section. I can select to download an item, the search wheel will begin to spin, and it will not be updated to show that a download is in progress. In fact, it won't update at all until the download completes.
I'm not sure what the cause of the first issue is. I don't see anything in the logs aside from "starting" and then "finished." The jobs are completing properly and quickly, it just doesn't seem that the interface is getting the memo. I see this in both Chrome and Firefox.

For the second issue, I suspect that it is my configuration. This data may only be available when Sonarr and SAB are on the same jail. I looked into trying to set up one jail with all my software in it, but between my complete lack of Linux knowledge (I'm a Windows guy) and inability to find Packages for FreeBSD for some of these, I gave up.

I see in the configuration for Sonarr that there is a "Remote Path Mappings" section, and I've created one or two of these with no success. I don't know if that is even what the section is used for, or if I'm adding the right directories. I don't know what calls Sonarr makes to SAB, or what files it looks for, to update these items during download. I am successfully able to download items from Sonarr through SAB, so at least the basic configuration seems to be proper.

I did a search, but didn't seem to turn up anything on either of these issues. Apologies if I missed something obvious. I was just wondering if anyone has had any experience with anything like this, and how I might resolve them.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
FreeNAS Version: FreeNAS-9.3-STABLE-201502142001
I can provide hardware specs as needed, but I'm not sure they'll be relevant in this case.

I've just recently installed FreeNAS to a custom built server. I currently have a Windows server running Sonarr, and my FreeNAS plugin installation is behaving differently in the following ways:
  1. Tasks within Sonarr do not appear to be writing back to the GUI properly. That is, if I do a Series Refresh (or Episode Rename), I get the spinning icon and an alert at the bottom of the screen that it has started, but the spinning wheel and alert remain even after it has completed. I see no errors in the log. The same holds true for when I select to download an item. A browser refresh clears the issue, so it's not in any way a critical issue.
  2. Sonarr doesn't appear to be communicating to SABnzbd for GUI updates. For example, the Calendar does not update for shows that are currently On Air or Downloading. They are simply Missing until they are not. The same holds true in the Series section. I can select to download an item, the search wheel will begin to spin, and it will not be updated to show that a download is in progress. In fact, it won't update at all until the download completes.
I'm not sure what the cause of the first issue is. I don't see anything in the logs aside from "starting" and then "finished." The jobs are completing properly and quickly, it just doesn't seem that the interface is getting the memo. I see this in both Chrome and Firefox.

For the second issue, I suspect that it is my configuration. This data may only be available when Sonarr and SAB are on the same jail. I looked into trying to set up one jail with all my software in it, but between my complete lack of Linux knowledge (I'm a Windows guy) and inability to find Packages for FreeBSD for some of these, I gave up.

I see in the configuration for Sonarr that there is a "Remote Path Mappings" section, and I've created one or two of these with no success. I don't know if that is even what the section is used for, or if I'm adding the right directories. I don't know what calls Sonarr makes to SAB, or what files it looks for, to update these items during download. I am successfully able to download items from Sonarr through SAB, so at least the basic configuration seems to be proper.

I did a search, but didn't seem to turn up anything on either of these issues. Apologies if I missed something obvious. I was just wondering if anyone has had any experience with anything like this, and how I might resolve them.
These issues seem pretty program specific so it might be useful asking in the Sonarr forums. The FreeNAS plugin uses the mono version of Sonarr which may have different functionality then the one built for Windows.


You can install Sabnzbd and Sonarr to the same jail. Just download the PBI for Sonarr from http://download.freenas.org/plugins/9/x64/ and upload it to the Sabnzbd jail, or vise versa.
 

AdianIV

Dabbler
Joined
Feb 7, 2015
Messages
26
Thanks for the reply.

I'll reach out over on the Sonarr forums, then. I hadn't taken into consideration that the versions for different OSes would have different functionality, it makes a lot of sense now that you mention it.

Thanks for the help with the plugins. I see what I was doing wrong - I was trying to upload plugins to a manually created jail, rather than one that already had a plugin installed. That's why I wasn't getting the option.
 

AdianIV

Dabbler
Joined
Feb 7, 2015
Messages
26
I'm afraid I've run into a bit of a wall with this one.

I reached out on the Sonarr forums (https://forums.sonarr.tv/t/gui-update-issues/4195/3), but I haven't had a response in a bit. What I did learn is that Sonarr uses Signalr for this functionality, and in Chrome's debugger I receive a 500 error when app.js?v=2.0.0.2722 tries to reach out (and I'm assuming negotiate authorization).

Since a 500 is an internal server error, I am assuming that Signalr is writing that error to some log somewhere. I don't know how to find or even access that log to see if I can find the root cause. I was going to reach out on the FreeBSD forums, since this is more of a general "I don't know Linux" issue than something specific to FreeNAS, but they mention that since FreeNAS is a fork I need to seek help here first.

Does anyone know how I can track down the cause of this 500 error with Signalr? I found some logs in /var/log, but I don't see more than a couple lines when I try "tail <filename>" and what I do see doesn't appear to have anything to do with SignalR, even after I re-generate the error.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm afraid I've run into a bit of a wall with this one.

I reached out on the Sonarr forums (https://forums.sonarr.tv/t/gui-update-issues/4195/3), but I haven't had a response in a bit. What I did learn is that Sonarr uses Signalr for this functionality, and in Chrome's debugger I receive a 500 error when app.js?v=2.0.0.2722 tries to reach out (and I'm assuming negotiate authorization).

Since a 500 is an internal server error, I am assuming that Signalr is writing that error to some log somewhere. I don't know how to find or even access that log to see if I can find the root cause. I was going to reach out on the FreeBSD forums, since this is more of a general "I don't know Linux" issue than something specific to FreeNAS, but they mention that since FreeNAS is a fork I need to seek help here first.

Does anyone know how I can track down the cause of this 500 error with Signalr? I found some logs in /var/log, but I don't see more than a couple lines when I try "tail <filename>" and what I do see doesn't appear to have anything to do with SignalR, even after I re-generate the error.
I doubt FreeBSD forums would be much help because this is a FreeNAS plugin only, there's no official FreeBSD port.

can you look around in the jail's /var/db/sonarr folder? logs might exist in there.
 

AdianIV

Dabbler
Joined
Feb 7, 2015
Messages
26
I do see some logs on the /var/db/sonarr folder, but they appear to be the same ones that can be accessed/downloaded through the GUI. I turned Sonarr's logging up to Trace and reproduced the issue, but I don't see anything about it in these log files. There's a log.db in that folder, but that appears to actually be a database, not something that actually contains logs.

I'm just not sure where Signalr would write its errors to. It might be that Sonarr doesn't notice the error, since it is an outside process having the issue (I assume), and so doesn't log it. Everything I look up about 500 errors with Signalr though seem to be more developer or code related than something on the system itself. That's why I was hoping there would be something like a System Event Log or Application Log that might contain some more detailed information.

For what it's worth, I have tried this on two separate machines with Chrome and Firefox both, with the same result. I tore down and rebuilt my Sonarr plugin jail, and had the same issue. I then added the Sonarr plugin to a separate jail (to condense my downloaders) and see the same thing there too.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I do see some logs on the /var/db/sonarr folder, but they appear to be the same ones that can be accessed/downloaded through the GUI. I turned Sonarr's logging up to Trace and reproduced the issue, but I don't see anything about it in these log files. There's a log.db in that folder, but that appears to actually be a database, not something that actually contains logs.

I'm just not sure where Signalr would write its errors to. It might be that Sonarr doesn't notice the error, since it is an outside process having the issue (I assume), and so doesn't log it. Everything I look up about 500 errors with Signalr though seem to be more developer or code related than something on the system itself. That's why I was hoping there would be something like a System Event Log or Application Log that might contain some more detailed information.

For what it's worth, I have tried this on two separate machines with Chrome and Firefox both, with the same result. I tore down and rebuilt my Sonarr plugin jail, and had the same issue. I then added the Sonarr plugin to a separate jail (to condense my downloaders) and see the same thing there too.
Sorry, this is over my head...

sonarr runs using mono so the bug could be anywhere between those 2 layers and possibly running it from the commandline might help. you may be able to add something to increase debugging.
 

AdianIV

Dabbler
Joined
Feb 7, 2015
Messages
26
I'll take a look at Mono and see if I can find instruction on how to check the logs there.

Thanks a lot for all the help!
 

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
I'll take a look at Mono and see if I can find instruction on how to check the logs there.

Thanks a lot for all the help!

Looking forward to your findings. I have seen this same issue.
 

AdianIV

Dabbler
Joined
Feb 7, 2015
Messages
26
Unfortunately, I won't be finding a solution.

I've spent hours just trying to figure out how to set the log level and read a log for mono, and I haven't been able to. The environment variable that I set doesn't take effect and it doesn't persist through closing my session, much less a reboot. Even if it did, I have no idea where to go or how to read the "stdout" or "stdin" logs. They appear to be for developers, which I am not, and I suspect may only be available to code. I haven't even found where Mono is actually installed yet, though I have found what appears to be the executable in /usr/local/bin.

I never thought I'd miss Event Viewer. I'm just going to go with SickRage or something instead and hope it doesn't have issues.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Unfortunately, I won't be finding a solution.

I've spent hours just trying to figure out how to set the log level and read a log for mono, and I haven't been able to. The environment variable that I set doesn't take effect and it doesn't persist through closing my session, much less a reboot. Even if it did, I have no idea where to go or how to read the "stdout" or "stdin" logs. They appear to be for developers, which I am not, and I suspect may only be available to code. I haven't even found where Mono is actually installed yet, though I have found what appears to be the executable in /usr/local/bin.

I never thought I'd miss Event Viewer. I'm just going to go with SickRage or something instead and hope it doesn't have issues.
Thanks for trying. mono isn't super stables on FreeBSD and Sonarr isn't supported on mono so somewhere in that mess there are bound to be issues.
 

AdianIV

Dabbler
Joined
Feb 7, 2015
Messages
26
Apologies for that last one. I support Windows servers for a living, and spending so much time not being able to do something as simple as set and read logs got under my skin in a big way. I should know better than to post frustrated.

I'm going to stick with Sonarr. The core functionality works fine and the display issue can be worked around by refreshing the browser.

I don't know that I'll find root cause, but I am going to continue trying to troubleshoot. I think for now I'll try some of the previous versions to see if the issue happens there, or if it might be something introduced in the current version. Someone else is also posting on my topic in the Sonarr forums with the same issue and seems to be getting responses. Hopefully something will come out of that, too.

I'll update here if I find anything useful.
 

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
Apologies for that last one. I support Windows servers for a living, and spending so much time not being able to do something as simple as set and read logs got under my skin in a big way. I should know better than to post frustrated.

I'm going to stick with Sonarr. The core functionality works fine and the display issue can be worked around by refreshing the browser.

I don't know that I'll find root cause, but I am going to continue trying to troubleshoot. I think for now I'll try some of the previous versions to see if the issue happens there, or if it might be something introduced in the current version. Someone else is also posting on my topic in the Sonarr forums with the same issue and seems to be getting responses. Hopefully something will come out of that, too.

I'll update here if I find anything useful.

Thanks for looking into the problem. I really like Sonarr myself and the GUI issue is not a big deal because it still runs for the most part. It also seems that mono is not crashing as much for me, at least I get 3-4 days out of it before it might.
 

AdianIV

Dabbler
Joined
Feb 7, 2015
Messages
26
Oh, that's interesting. For me the update has failed 100% of the time for every jail I've configured on this server. Because of that I had been thinking it was a configuration or version issue, but if it sometimes work for you it could be something else. It could even be just the general instability of Mono on FreeBSD that Joshua mentioned.

I was able to install the Sonarr package for version 2.0.0.2663 (x64) with Mono 3.10, and experienced the same thing there.
 

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
Oh, that's interesting. For me the update has failed 100% of the time for every jail I've configured on this server. Because of that I had been thinking it was a configuration or version issue, but if it sometimes work for you it could be something else. It could even be just the general instability of Mono on FreeBSD that Joshua mentioned.

I was able to install the Sonarr package for version 2.0.0.2663 (x64) with Mono 3.10, and experienced the same thing there.

Yes the update function was working for me without issue, most of the time Freenas would see the plugin as off even though it was still running. Sometimes the plugin would not start back up, but Sonarr still updated successfully. So yeah, it seems to be general instability with mono is what I suspect. Most of the time it works well, so I do not mind the occasional hiccups, this way I also do not need to run Sonar in a VM like I previously was.

I am currently up to date with Sonarr 2.0.02850.
 

AdianIV

Dabbler
Joined
Feb 7, 2015
Messages
26
In the Sonarr forums the provided this command for me to run to enable some additional logging for mono:

mono --debug --trace=N:Microsoft.AspNet.SignalR,N:Owin NzbDrone.exe > mono_trace.log

It will create the mono_trace.log in the current directory. I'm not sure if it will be helpful for you, since you can go days between issues, and leaving this log writing data for that long may turn out to be problematic.

My problem appears to be permissions based. When I run the Sonarr executable (actually still named NzbDrone.exe) as the root user, my configurations are gone but the issue also disappears. I'm still trying to figure out how to run that command as the media account to see what permissions may be missing. When I try to su to media within the jail, it tells me that "that account is currently not available." I suspect that media may not allow logging in as that account.

Does anyone here know how I might find the service definition for Sonarr? I assume that somewhere there has to be a configuration to tell Linux what to run when you say "service sonarr start." I found the line that enables the service, but not the one that tells it which executable to run. If I can find that, I suspect I may be able to modify it to run with the additional mono parameters provided.

Or there could be a much easier way that I just haven't found yet.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
In the Sonarr forums the provided this command for me to run to enable some additional logging for mono:

mono --debug --trace=N:Microsoft.AspNet.SignalR,N:Owin NzbDrone.exe > mono_trace.log

It will create the mono_trace.log in the current directory. I'm not sure if it will be helpful for you, since you can go days between issues, and leaving this log writing data for that long may turn out to be problematic.

My problem appears to be permissions based. When I run the Sonarr executable (actually still named NzbDrone.exe) as the root user, my configurations are gone but the issue also disappears. I'm still trying to figure out how to run that command as the media account to see what permissions may be missing. When I try to su to media within the jail, it tells me that "that account is currently not available." I suspect that media may not allow logging in as that account.

Does anyone here know how I might find the service definition for Sonarr? I assume that somewhere there has to be a configuration to tell Linux what to run when you say "service sonarr start." I found the line that enables the service, but not the one that tells it which executable to run. If I can find that, I suspect I may be able to modify it to run with the additional mono parameters provided.

Or there could be a much easier way that I just haven't found yet.
edit /usr/local/etc/rc.d/sonarr

hopefully you can pinpoint the problem and I can either update the PBI or Sonarr can fix the code that's trying to do something that needs more permissions.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I think this should allow login to media
chsh -s /bin/csh media
 

AdianIV

Dabbler
Joined
Feb 7, 2015
Messages
26
Thanks for the location.

I'm not sure what I'm doing wrong. I was able to update the "media" account so that I could su to it, and while it writes the log with the command above, Sonarr doesn't start properly and I get nothing but errors.

I also modified the /usr/local/etc/rc.d/sonarr file to contain the following:
command_args="-f ${procname} --debug --trace=N:Microsoft.AspNet.SignalR,N:Owin /usr/pbi/sonarr-amd64/share/sonarr/NzbDrone/NzbDrone.exe --data=${sonarr_data_dir} --nobrowser > /media/mono_trace.log" (I had given media chown on /media because it didn't seem like it could write anywhere)

When I ran it that way, I was able to access Sonarr and generate the error, but the mono_trace.log that was generated was empty.

I've since reverted to a snapshot I took beforehand to clean up the mess I made, heh.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks for the location.

I'm not sure what I'm doing wrong. I was able to update the "media" account so that I could su to it, and while it writes the log with the command above, Sonarr doesn't start properly and I get nothing but errors.

I also modified the /usr/local/etc/rc.d/sonarr file to contain the following:
command_args="-f ${procname} --debug --trace=N:Microsoft.AspNet.SignalR,N:Owin /usr/pbi/sonarr-amd64/share/sonarr/NzbDrone/NzbDrone.exe --data=${sonarr_data_dir} --nobrowser > /media/mono_trace.log" (I had given media chown on /media because it didn't seem like it could write anywhere)

When I ran it that way, I was able to access Sonarr and generate the error, but the mono_trace.log that was generated was empty.

I've since reverted to a snapshot I took beforehand to clean up the mess I made, heh.
you got pretty far for a windows guy!

I found the issue, mono/Sonarr wants to create /.config/.mono/keypairs/some-long-filename.xml
I think this wants to be in the 'media' user's home directory, but 'media' doesn't have a real home.

I think our best bet is to find a way to specify a different folder to use for mono, hopefully with a command line parameter. A hotfix would be to create /.config with ownership to 'media'.
 
Status
Not open for further replies.
Top