Jump to content

Server process hangs restart/shutdown


Happy2Play

Recommended Posts

Was there ever any resolution to this.  This thread is so old I figure I must have missed a solution since it is still happening for me.  I am referring to the long time to shutdown, NOT the BSOD.

 

G

 

Hi, do you have any plugins installed? Try removing all plugins and see if the issue persists with the core server. thanks.

Link to comment
Share on other sites

Hi, do you have any plugins installed? Try removing all plugins and see if the issue persists with the core server. thanks.

 

I had 3 plugins installed, rotten tomatos, trailers, and server backup.  I deleted them shut down (took forever).  Started Emby (now without plugins installed), saw that it was responding to dashboard web interface, went back to the server tray icon and did a restart test again after starting without plugins installed, and the problem did persist.  

 

Seems like I went through this plugin test before, this problem of taking forever to shutdown has been happening form me for a very long time.  I assumed it was a problem with the server that would be common and eventually fixed.  The biggest problem for me is that I cannot allow the server to restart itself after doing an update as the restart will fail due to "another instance running".

 

I will leave the plugins out for now in case you have any other debugging suggestions.  If you want me to send log clips or anything else let me know.

Link to comment
Share on other sites

Happy2Play

Unfortunately this is one of those issues that is almost impossible to find the cause.  My server process would hang for a minute or so after restart or shutdown, but the issue just went away over time.  The issue still pops-up every now and then.

 

As for updates you have two workaround. 

 

Manual update - When a update is available, allow it to download and instead of restarting, shutdown the server and go to %appdata%\Emby-Server you will rename the system folder to system.old and then go to the update folder and extract the new system folder to %appdata%\Emby-Server.

 

or

 

Save the setup file and when ever there is an update shutdown the server and  rerun the setup.exe this will pull the new release.

Link to comment
Share on other sites

  • 7 months later...

Same issue for me. I have installed it as service, when stopping the service in services.msc or with "net stop" service immediately says "not running" but mediabrowser process is hanging around ~1-2mins.

No Tasks are running nor any plugins installed.

 

Does logs help luke to find the issue?

Link to comment
Share on other sites

  • 2 months later...

I've had this issue for a long time, but I think it's related to the size of your database. Maybe Luke or a Dev can confirm. This happens to me on plex as well where all the items between emby and plex are the same.

 

My total DB size is ~80 TB, 70 TB of which is TV, which makes for a lot of items in the DB.

I can confirm that the shutdown time varies from as fast as 30 seconds to as long as 3 minutes for me. This definitely points to what Luke said about it waiting for a task to end before exiting.

It does NOT matter if it's run as a service or not.

 

 

I might create a VM to test this and slowly add content to see how it affects the shutdown time.

I wish there was a simple debug log on exit we could look at to see what the process is waiting on. Would it be impossible to bake this into current Emby logging? (Kodi's log does a sort of unloading on exit where you see each individual item exiting, though I have no idea of the possibility of this in emby)

 

I should also note the following in case the platform is the problem for one reason or another.

 

 

Host OS: Windows Server 2012 R2

Processor: E5-2670 x2

RAM: 64 GB

Integrated GPU:  Matrox G200eW

Hypervisor: Hyper-V

 

VM OS (emby install): Windows Server 2012 R2

Virtual Processors: 32

Memory: 16,384 MB

Edited by Quiks
Link to comment
Share on other sites

Happy2Play

I don't believe total amount of media makes a difference as my Stable server with 38TB with a library.db size of 742MB, and it updated without any issues.  But Beta server is half the amount of data and a library.db of 378MB is hit and miss on hanging updates.

 

Both servers are on WHS2011.

 

I have a test dev server on Windows 10 with relatively no or just test data that doesn't have an issue updating but my portable test server fail 90% of the time updating on same machine.

 

Kodi's log does a sort of unloading on exit where you see each individual item exiting, though I have no idea of the possibility of this in emby

Log at the bottom of the log after telling Emby to Shutdown or Restart, if shows that information.  Not sure if that is part of having debug logging or not though.

Edited by Happy2Play
Link to comment
Share on other sites

Very interesting points Happy. Since this same problem happens to me with plex, I thought it was just something that happens with larger collections, but it appears that's not the case. I wonder what the common problem is between these 2 applications.

 

Have you done a full re-setup yet on a device to see if the issue comes back (mirrored settings and content, but from scratch)?

 

I'm on Version 3.1.2.0, which I believe is the stable build.

 

here is what I see when exiting in my log. (to clarify, I'm ending the emby service in windows services.msc)

 

It took 1m1s for the process to completely close. There appeared to be no information during that time as the log did not change during that 1 minute.

2016-12-30 23:33:05.2511 Info Main: Shutting down
2016-12-30 23:33:05.2667 Info Main: Disposing app host
2016-12-30 23:33:05.2667 Info App: Disposing WindowsAppHost
2016-12-30 23:33:05.2667 Info App: Disposing TaskManager
2016-12-30 23:33:05.2667 Info App: Disposing HttpClientManager
2016-12-30 23:33:05.2667 Info App: Disposing IsoManager
2016-12-30 23:33:05.2667 Info App: Disposing InstallationManager
2016-12-30 23:33:05.2667 Info App: Disposing SqliteUserRepository
2016-12-30 23:33:05.2823 Info App: Disposing SqliteDisplayPreferencesRepository
2016-12-30 23:33:05.2823 Info App: Disposing SqliteItemRepository
2016-12-30 23:33:05.2823 Info App: Disposing SqliteFileOrganizationRepository
2016-12-30 23:33:05.2823 Info App: Disposing AuthenticationRepository
2016-12-30 23:33:05.2823 Info App: Disposing SyncRepository
2016-12-30 23:33:05.2823 Info App: Disposing LibraryMonitor
2016-12-30 23:33:05.5479 Info App: Disposing ProviderManager
2016-12-30 23:33:05.5479 Info App: Disposing ServerManager
2016-12-30 23:33:05.5479 Info HttpServer: Stopping HttpListener...
2016-12-30 23:33:05.5636 Info HttpServer: HttpListener stopped
2016-12-30 23:33:05.5636 Info App: Disposing ImageProcessor
2016-12-30 23:33:05.5792 Info App: Disposing MediaSourceManager
2016-12-30 23:33:05.5792 Info App: Disposing LiveTvManager
2016-12-30 23:33:05.5792 Info App: Disposing ContentDirectory
2016-12-30 23:33:05.5792 Info App: Disposing MediaReceiverRegistrar
2016-12-30 23:33:05.5792 Info App: Disposing DeviceDiscovery
2016-12-30 23:33:05.5792 Info App: Disposing MediaEncoder
2016-12-30 23:33:05.5792 Info App: Disposing SharingRepository
2016-12-30 23:33:05.5792 Info App: Disposing ActivityRepository
2016-12-30 23:33:05.5792 Info App: Disposing SqliteNotificationsRepository
2016-12-30 23:33:05.5792 Info App: Disposing MovieDbProvider
2016-12-30 23:33:05.5792 Info App: Disposing EmbyTV
2016-12-30 23:33:05.5792 Info App: Disposing OpenSubtitleDownloader
2016-12-30 23:33:05.5792 Info App: Disposing ServerEntryPoint
2016-12-30 23:33:05.5792 Info App: Disposing UserSyncNotification
2016-12-30 23:33:07.5948 Info App: Disposing LibrarySyncNotification
2016-12-30 23:33:09.6104 Info App: Disposing ServerEntryPoint
2016-12-30 23:33:09.6104 Info App: Disposing EntryPoint
2016-12-30 23:33:09.6104 Info App: Disposing ServerMediator
2016-12-30 23:33:09.6104 Info App: Disposing ApiEntryPoint
2016-12-30 23:33:09.6104 Info App: Disposing ServerEntryPoint
2016-12-30 23:33:09.6104 Info App: Disposing CleanMissingEpisodesEntryPoint
2016-12-30 23:33:09.6104 Info App: Disposing SyncNotificationEntryPoint
2016-12-30 23:33:09.6104 Info App: Disposing Notifications
2016-12-30 23:33:09.6261 Info App: Disposing WebSocketNotifier
2016-12-30 23:33:09.6261 Info App: Disposing NewsEntryPoint
2016-12-30 23:33:09.6261 Info App: Disposing HdHomerunDiscovery
2016-12-30 23:33:09.6261 Info App: Disposing EntryPoint
2016-12-30 23:33:09.6261 Info App: Disposing FileOrganizationNotifier
2016-12-30 23:33:09.6261 Info App: Disposing AutomaticRestartEntryPoint
2016-12-30 23:33:09.6261 Info App: Disposing KeepServerAwake
2016-12-30 23:33:09.6261 Info App: Disposing LibraryChangedNotifier
2016-12-30 23:33:09.6261 Info App: Disposing LoadRegistrations
2016-12-30 23:33:09.6261 Info App: Disposing RecordingNotifier
2016-12-30 23:33:09.6261 Info App: Disposing RefreshUsersMetadata
2016-12-30 23:33:09.6261 Info App: Disposing ServerEventNotifier
2016-12-30 23:33:09.6417 Info App: Disposing StartupWizard
2016-12-30 23:33:09.6417 Info App: Disposing SystemEvents
2016-12-30 23:33:09.6417 Info App: Disposing UdpServerEntryPoint
2016-12-30 23:33:09.6417 Info App: Disposing UsageEntryPoint
2016-12-30 23:33:09.6417 Info App: Disposing UserDataChangeNotifier
2016-12-30 23:33:09.6417 Info App: Disposing ConnectEntryPoint
2016-12-30 23:33:09.6417 Info App: Disposing ActivityLogEntryPoint
2016-12-30 23:33:09.6573 Info App: Disposing LibraryMonitorStartup
2016-12-30 23:33:09.6573 Info App: Disposing ExternalPortForwarding
2016-12-30 23:33:09.6573 Info App: Disposing DlnaProfileEntryPoint
2016-12-30 23:33:09.6573 Info App: Disposing DlnaEntryPoint
Edited by Quiks
Link to comment
Share on other sites

  • 4 weeks later...

Is there anything I can provide that would help this issue along? 

 

I can't restart the emby service with a single right click, restart. It fails to restart because of the process being stuck. I'm forced to stop the process and wait up to 3 minutes or so, for the process to end, before I can start the service manually. I can't even manually end the process, which may be a limitation of the OS.

 

I understand this is a smaller issue, but it does prove to be annoying for maintenance. I will provide whatever I can go get this pinpointed.

Edited by Quiks
Link to comment
Share on other sites

Is there anything I can provide that would help this issue along? 

 

I can't restart the emby service with a single right click, restart. It fails to restart because of the process being stuck. I'm forced to stop the process and wait up to 3 minutes or so before I can start the service manually. 

 

I understand this is a smaller issue, but it does prove to be annoying for maintenance. I will provide whatever I can go get this pinpointed.

 

Try removing all plugins and see if the issue persists. if you don't have any plugins, then please try again with the next release of emby server. thanks.

Link to comment
Share on other sites

Try removing all plugins and see if the issue persists. if you don't have any plugins, then please try again with the next release of emby server. thanks.

Is there an easy way for me to backup my plugin settings before doing so? Can I just remove the plugins directory temporarily? Will that effectively remove the plugins while backing up their settings?

I guess I could just backup my emby appdata directory and restore it after.

Edited by Quiks
Link to comment
Share on other sites

I uninstalled all plugins and shut down my emby service. It took ~1.5 minutes for the process to finally exit.

I started the service back up and let it stay up for about 8 minutes.

I shut down the service and monitored the process

MediaBrowser.ServerApplication.exe hung for ~30 seconds before ending.

I started the service again

I let it stay up for 2 minutes

it took 3:15 for the process to finally close.

 

Is there anything else I can test?

Link to comment
Share on other sites

I disabled the network adapter on the VM, 

I stopped the service.

The process took 1 minute to exit

 

I repeated the test and it took 1:30 to exit.

Edited by Quiks
Link to comment
Share on other sites

Is there anything else I can try or provide? Thanks :)

 

I can reproduce this with every shutdown, so I can be a good guinea pig.

 

The one thing I haven't done, is do a complete reinstall to see if it happens on a fresh DB.

Edited by Quiks
Link to comment
Share on other sites

I disabled all the DLNA options and stopped the service.

 

it took  3 minutes for the process to finally end.

 

I should note that the process was at 2.5 GB of usage after being on the past few days. I assume this is normal, but will note it nonetheless as it doesn't use near this much at startup.

 

I started the service and stopped it 2 minutes later just in case the DLNA disable needed a restart to take effect.

 

The process was at 260 MB of memory usage when I shut down the service.

 

The process took 1:30 to close.

 

Edit: After leaving it running for the last 20 minutes or so, it's up to 2.2 GB of usage

Edited by Quiks
Link to comment
Share on other sites

Happy2Play

It is one of those issues that it happens to you or it doesn't.

Link to comment
Share on other sites

happpyg

Watching this thread as I have this issue too, 1-2 minutes to shut down but don't have to do it too often so haven't worried too much yet.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...