PhAzE-Variance / unRAID

unRAID Files
GNU General Public License v3.0
7 stars 3 forks source link

Sonarr gets started up twice, causing it to quit #9

Closed bbaldino closed 4 years ago

bbaldino commented 8 years ago

I just started seeing this recently, didn't see other references to it so maybe something is wrong on my end, but I can repro it with a completely (?) clean install, so maybe not. Basically when I install the sonarr plugin and start it up, it gets started twice. I see the following in the sonarr logs:

16-9-5 10:23:38.2|Info|Bootstrap|Starting Sonarr - /mnt/cache/.plugins/sonarr/NzbDrone.exe - Version 2.0.0.4230 16-9-5 10:23:40.5|Info|Bootstrap|Starting Sonarr - /mnt/cache/.plugins/sonarr/NzbDrone.exe - Version 2.0.0.4230 16-9-5 10:23:41.1|Info|SingleInstancePolicy|1 instance(s) of Sonarr are running 16-9-5 10:23:41.1|Warn|SingleInstancePolicy|Another instance of Sonarr is already running. 16-9-5 10:23:41.1|Info|Bootstrap|Application is being terminated. Reason : Another instance is already running 16-9-5 10:23:42.8|Info|MigrationLogger|* Migrating data source=/.config/NzbDrone/nzbdrone.db;cache size=-10485760;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 * 16-9-5 10:23:43.6|Info|MigrationLogger|* Migrating data source=/.config/NzbDrone/logs.db;cache size=-10485760;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 * 16-9-5 10:23:43.7|Info|Router|Application mode: Help 16-9-5 10:23:43.9|Info|ConsoleApp|Exiting main.

I tried adding some debug logs and I don't see the script invoking it twice or anything, so I don't know what's causing it. What's also weird is that if I run the start command manually (sudo -H -u nobody /bin/bash -c '. ...), then things start up fine. Any ideas?

PhAzE-Variance commented 8 years ago

This is likely caused from the plugin settings page refreshing.

Essentially, when the settings page refreshes, it checks the current installed version on Sonarr by running: Nzbdrone.exe /?

That prints the version information and some other information then exits. It appears though that if the plugin is starting up Sonarr, and checks the version at the same time, they detect each other. If this is something new you see, it's possible that the 'SingleInstancePolicy' is something the Sonarr author recently implemented. Perhaps the Sonarr dev can make it so when the /? is called it bypasses the single instance policy.

bbaldino commented 8 years ago

Sounds like a good theory...also might explain why it seemed to go away all of a sudden...I think I may have restarted the array and doing it from there, where sonarr would start up on the disks mounted trigger as opposed to the settings page which does the auto refresh for status.