Sonarr version (exact version): 2.0.0.4949 Mono version (if Sonarr is not running on Windows): 4.2.1 OS: Ubunut 16.04 ((Debug logs)):No entry in log files since starting NzbDrone as daemon (Make sure debug logging is enabled in settings and post the full log to hastebin/pastebin/dropbox/google drive or something similar, do not post them directly here) Description of issue:
When I start the app using the command line I can connect to it from a remote system with a browser. When I start with the systemd init file it doesn’t even setup a listen in the ports. - see below for more details. Here is my systemd config file:
[Unit]
Description=Sonarr Daemon
After=syslog.target network.target
I can start and run sonarr from the command line and connect to it from a remote computer using the following: sudo /usr/bin/mono /opt/NzbDrone/NzbDrone.exe
This ties up the command line interface and doesn’t start automatically on a reboot.
I implemented the above systemd config file following instructions
systemctl daemon-reload
systemctl enable sonarr.service
systemctl start sonarr.service
after checking status part of message indicates all is OK.
Active: active (running)
At this point there is no log in NzbDrone/logs folder
However, I cannot connect from a remote box - I am running on headless ubuntu server - no UI.
Also when I check for listening port 8989 with netstat it is not in the list but when I run the application from the command line I can see it in another instance of putty.
I suspect this is a permissions problem but I am not sure where to start. User? Group? maybe something else altogether. I did explicitly create the nzbdrone user but not the group. The group is showing up in the getent command.
Here is some more information when I used the command line:
/usr/bin/mono /opt/NzbDrone/NzbDrone.exe
That is with no sudo I got the same result as I have been seeing with the systemd config file - so it is a permissions problem.
I changed the owner of /opt/NzbDrone/* to nzbdrone:nzbdrone and verified the permissions to be read and execute for everyone and all permissions for user and r and x for group.
At this point I can start and run nzbdrone without the sudo and I can connect and it ran all night OK and I could connect to it from a remote browser on my LAN. However still can’t connect with systemd startup. There is more on that below.
Also when testing starting with systemd I check the status immediately after starting and status is Active.
After running for a few minutes I see the following: (code=exited)
Running the status request again I see: mono[6911]: at System.IO.DirectoryInfo.Create () <0x7f98c8158170 + 0x00013> in :0
There are several messages like this all indicating filename unknown.
apparently the service starts OK and then it repeatedly fails and restarts over and over.
However, even at the beginning there is no listen in netstat so it is failing before it opens the tcp port.
Also when starting with systemd - no entries are made into the sonarr.txt log file.
Does the ~/.config/NzbDrone folder exist (~ is the home directory of the user running Sonarr, not root).
Sounds like it’s failing to create a folder that Sonarr requires. You might get some more information by redirecting the standard output/error to a file or systemd log files (if it creates one per service).
Here’s what I see in the syslog for sonarr.
[Info] Bootstrap: Starting Sonarr - /opt/NzbDrone/NzbDrone.exe - Version 2.0.0.4949
Oct 30 17:23:55 MediaServer02 sonarr[11145]: [Fatal] ConsoleApp: EPIC FAIL!
Oct 30 17:23:55 MediaServer02 sonarr[11145]: [v2.0.0.4949] System.UnauthorizedAccessException: Access to the path “/home/nzbdrone” is denied.
After installing sonarr into /opt/NzbDrone it ran fine from the command line when I was logged in as me. Now that I want to run it as a service the system wants to store the output into the home/nzbdrone folder - which is the user indicated in the systemd init file.
I created that folder gave it all kinds of permissions and I am now up and running.
Thanks for the tip on redirecting output
I used syslog and sudo journalctl --unit=sonarr -e to dump out the tail of the syslog for the unit I setup in the systemd file.