Jump to content

cannot shutdown server as service


Recommended Posts

revengineer
Posted (edited)

Sometimes I cannot shutdown emby server running as windows service. My version is 3.0.5724.5. After pushing shutdown on web interface, the web site becomes unresponsive. However, the task itself is still alive. Typically is takes 2 minutes to shut down the service. However, sometimes the task never shuts down. even taskkill /f cannot kill the process. It gives access denied error. Are there other means to shut down the process?

server-63578811011.txt

unhandled_7ea039b6-bc8d-4ded-b2f8-6bc731f2c8f0.txt

Edited by revengineer
Posted

i'll fix this particular error for the next release, thanks.

  • 1 year later...
revengineer
Posted

It has been almost a year and this issue still is not resolved. On almost every activity that requires restarting emby (emby server update, plugin update), I have to reboot my server. This is extremely disruptive and time consuming. In 30 years of using windows, this is the first and only program that I cannot kill as admin with task manager. I wish we could get this finally fixed!!!!!


 

Sorry for the double posting, I think these issues are related.

Posted

Does this happen if you run using the tray icon?

Happy2Play
Posted (edited)

My stable server doesn't currently have this issue but my beta machine has had this issue for awhile and dev machine is hit and miss.  Stable machine runs majority of the time as service except for around update time, beta and dev run as application.

 

Stable and beta are on WHS2011

Dev on Windows 10 Pro

Edited by Happy2Play
revengineer
Posted

Mostly I run as service, but during the update process I have started as user and the tray icon shows. I tried to shut down tonight via tray icon -> exit without success. After 5 min I gave up and I rebooted the server. As Happy2Play states it is hit or miss, but I would say that in >80% of shutdown attempts, the shutdown via web interface or through windows does not work.

  • Like 1
Posted

Were any scheduled tasks running? What plugins are installed?

FrostByte
Posted

I've updating Emby running as a service using a PS script to do everything with no issues for awhile now.  Just too much a pita to do it manually I think.

revengineer
Posted

Were any scheduled tasks running? What plugins are installed?

The whole range of default tasks will have run after several days of operation. However, only tasks scheduled by default on application startup ran during the update process when emby initially starts as a program after the update, and I need to the application down before I restart as a service.

 

The plugins installed are coverart, email notifications, folder sync, rotten tomatoes reviews, server configuration backup, and trailers. I wish there was a way to disable one or more plugins rather than uninstalling them, because the uninstall/reinstall/reconfig is a big hassle.

revengineer
Posted

I've updating Emby running as a service using a PS script to do everything with no issues for awhile now.  Just too much a pita to do it manually I think.

The problem is that I cannot shutdown the emby application, not even when killed from the task manager. A script will not help with this, unless it includes rebooting the entire hardware twice during the process.

FrostByte
Posted (edited)

Hmm, it forces both the "Emby" service and the "MediaBrowser" process to stop for me every time.  Never had an issue.  Hopefully you'll find the problem

Edited by FrostByte
revengineer
Posted

Hmm, it forces both the "Emby" service and the "MediaBrowser" process to stop for me every time.  Never had an issue.  Hopefully you'll find the problem

Could you post your script and/or the command used to shutdown the emby server application?

revengineer
Posted

Here are the final log entries. Note the timing. The app was shut down via the web interface at 10:57, and all but the last log entry followed in quick succession. The last entry was added some 10 minutes later when the server was rebooted. Maybe this gives a hint as to where the problem occurs in the code. 

 

 

2016-12-22 10:57:56.6319 Info HttpServer: HTTP Response 204 to 192.168.1.10. Time: 3ms. http://192.168.1.50:8096/emby/System/Shutdown
2016-12-22 10:57:56.7460 Info Main: Disposing app host
2016-12-22 10:57:56.7460 Info App: Disposing WindowsAppHost
2016-12-22 10:57:56.7460 Info App: Disposing TaskManager
2016-12-22 10:57:56.7460 Info App: Disposing HttpClientManager
2016-12-22 10:57:56.7460 Info App: Disposing IsoManager
2016-12-22 10:57:56.7460 Info App: Disposing InstallationManager
2016-12-22 10:57:56.7460 Info App: Disposing SqliteUserRepository
2016-12-22 10:57:56.7520 Info App: Disposing SqliteDisplayPreferencesRepository
2016-12-22 10:57:56.7520 Info App: Disposing SqliteItemRepository
2016-12-22 10:57:56.7520 Info App: Disposing SqliteFileOrganizationRepository
2016-12-22 10:57:56.7520 Info App: Disposing AuthenticationRepository
2016-12-22 10:57:56.7520 Info App: Disposing SyncRepository
2016-12-22 10:57:56.7520 Info App: Disposing LibraryMonitor
2016-12-22 10:57:56.7520 Info App: Disposing ProviderManager
2016-12-22 10:57:56.7520 Info App: Disposing ServerManager
2016-12-22 10:57:56.8080 Info App: Disposing ImageProcessor
2016-12-22 10:57:56.8080 Info App: Disposing MediaSourceManager
2016-12-22 10:57:56.8080 Info App: Disposing LiveTvManager
2016-12-22 10:57:56.8080 Info App: Disposing ContentDirectory
2016-12-22 10:57:56.8080 Info App: Disposing MediaReceiverRegistrar
2016-12-22 10:57:56.8080 Info App: Disposing DeviceDiscovery
2016-12-22 10:57:56.8080 Info App: Disposing MediaEncoder
2016-12-22 10:57:56.8080 Info App: Disposing SharingRepository
2016-12-22 10:57:56.8080 Info App: Disposing ActivityRepository
2016-12-22 10:57:56.8080 Info App: Disposing SqliteNotificationsRepository
2016-12-22 10:57:56.8080 Info App: Disposing MovieDbProvider
2016-12-22 10:57:56.8080 Info App: Disposing EmbyTV
2016-12-22 10:57:56.8080 Info App: Disposing OpenSubtitleDownloader
2016-12-22 10:57:56.8080 Info App: Disposing ServerEntryPoint
2016-12-22 10:57:56.8080 Info App: Disposing ServerEntryPoint
2016-12-22 10:57:56.8080 Info App: Disposing EntryPoint
2016-12-22 10:57:56.8080 Info App: Disposing ApiEntryPoint
2016-12-22 10:57:56.8150 Info App: Disposing ServerEntryPoint
2016-12-22 10:57:56.8150 Info App: Disposing CleanMissingEpisodesEntryPoint
2016-12-22 10:57:56.8150 Info App: Disposing SyncNotificationEntryPoint
2016-12-22 10:57:56.8150 Info App: Disposing Notifications
2016-12-22 10:57:56.8150 Info App: Disposing WebSocketNotifier
2016-12-22 10:57:56.8150 Info App: Disposing NewsEntryPoint
2016-12-22 10:57:56.8150 Info App: Disposing HdHomerunDiscovery
2016-12-22 10:57:56.8150 Info App: Disposing EntryPoint
2016-12-22 10:57:56.8150 Info App: Disposing FileOrganizationNotifier
2016-12-22 10:57:56.8150 Info App: Disposing AutomaticRestartEntryPoint
2016-12-22 10:57:56.8150 Info App: Disposing KeepServerAwake
2016-12-22 10:57:56.8150 Info App: Disposing LibraryChangedNotifier
2016-12-22 10:57:56.8150 Info App: Disposing LoadRegistrations
2016-12-22 10:57:56.8150 Info App: Disposing RecordingNotifier
2016-12-22 10:57:56.8150 Info App: Disposing RefreshUsersMetadata
2016-12-22 10:57:56.8150 Info App: Disposing ServerEventNotifier
2016-12-22 10:57:56.8320 Info App: Disposing StartupWizard
2016-12-22 10:57:56.8320 Info App: Disposing SystemEvents
2016-12-22 10:57:56.8320 Info App: Disposing UdpServerEntryPoint
2016-12-22 10:57:56.8320 Info App: Disposing UsageEntryPoint
2016-12-22 10:57:56.8320 Error App: Error receiving udp message
*** Error Report ***
Version: 3.1.1.0
Command line: C:\Users\admin\AppData\Roaming\Emby-Server\System\MediaBrowser.ServerApplication.exe
Operating system: Microsoft Windows NT 6.2.9200.0
64-Bit OS: True
64-Bit Process: True
Processor count: 4
Program data path: C:\Users\admin\AppData\Roaming\Emby-Server
Application directory: C:\Users\admin\AppData\Roaming\Emby-Server\System
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Emby.Server.Implementations.Udp.UdpServer.d__13.MoveNext()
System.Threading.Tasks.TaskCanceledException
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Emby.Server.Implementations.Udp.UdpServer.d__13.MoveNext()

2016-12-22 10:57:56.8320 Info App: Disposing UserDataChangeNotifier
2016-12-22 10:57:56.8320 Info App: Disposing ConnectEntryPoint
2016-12-22 10:57:56.8320 Info App: Disposing ActivityLogEntryPoint
2016-12-22 10:57:56.8320 Info App: Disposing LibraryMonitorStartup
2016-12-22 10:57:56.8320 Info App: Disposing ExternalPortForwarding
2016-12-22 10:57:56.8320 Info App: Disposing DlnaProfileEntryPoint
2016-12-22 10:57:56.8320 Info App: Disposing DlnaEntryPoint
2016-12-22 11:08:29.3525 Info Main: Calling Environment.Exit

 

revengineer
Posted

The problem with shutdown is repeatable even when run as application with task icon. I started the server app, then waited one hour without watching any movies, then shut down via web interface. The app did not shutdown and I had to reboot the machine.

 

One last piece of information. I tried an application called Process Hacker, which some people had success terminating applications that could not be shut down by other means. Process Hacker is not successful either and reports the error "An attempt was made to access an exiting process." Not sure whether or not this helps.

  • Like 1
  • 2 weeks later...
Posted

Just checking: You do know that the normal way of stopping/starting/restarting of windows services has always been either a) mmc-services plugin from "administrative tools" (or "computer management->services), or an Admin command prompt using "net stop [service name]" and "net start [service name]"?

 

Killing from task manager should be the last resort. I know several applications that don't die (even with admin rights) from task manager. Similarly for Unix/Linux "kill -9" is the last resort and sending the "HUP" signal is the normal way.

 

I'm not denying that there is a possible problem with Emby. Just that I have not encountered it myself.

BR,

Andy777

revengineer
Posted

I tried all the graceful ways you mentioned to terminate the emby server process; they do not work 90% of times I tried. When these means do not work, not even kill via taskmanager will shut down the process. Reboot is required then.

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...