psubsee2002 7 Posted October 29, 2017 Posted October 29, 2017 (edited) I have an existing Emby Server installation on a system running Windows Server 2012 R2. I have been running this as a window service so far without problem for several years. It was running last night without a problem, then this morning, neither my wife or I could connect to it remotely when we were at the gym. Looks like the service stopped this morning. When i returned home, I tried to start the service and Windows indicated it failed to start. I updated Emby to the newest version. After updating the application started as normal. I shut down the application and tried to restart the service as I normally do, but Windows said the service failed to start. So I tried to start the application exe directly, and had a popup that said there was an unhandled exception. Tried again with the same result. I ran the update exe again and the application started. I shut it down once more and tried to restart the service, which failed again, and when i tried to launch the exe directly, I got the same unhandled exception popup. However, I am able to connect to the server via http://localhost:8096/emby/web/dashboard.html and I tried connecting and playing back media via my external IP. So nothing appears to be running (no indication the application is running and Windows is telling me the service is stopped) but the server does appear to be working. I restarted the computer again and again Windows is showing the service as "Stopped", and the systray is not showing the application as running, but I am able to connect to it and administer the Server and play back media. So why the "service" not running according to windows? And why won't the app start? Prior to the issues starting this morning, nothing has changed at all. Last change was my previous Emby update about 3 weeks ago. So is this something on my end or is there an issue with emby? Any suggestions for where to look would be appreciated. I've attached server logs for this morning. Server Logs.zip EDIT: I did forget - but I did activate LiveTV and start using it heavily withing the last 2 weeks. When i came back to the Live TV section of my apps (both Android TV and Android Mobile), the Live TV guide data was missing completely, and my default "Home Screeen" settings had been reset to a prior state. Edited October 29, 2017 by psubsee2002
Solution Luke 42080 Posted October 29, 2017 Solution Posted October 29, 2017 Hi, if you want to run as a service we have a new process for that: https://emby.media/community/index.php?/topic/50992-how-to-run-emby-server-as-a-windows-service/ Let us know if this helps. Thanks. 1
awdspyder 11 Posted November 3, 2017 Posted November 3, 2017 (edited) Wait, why do this? I ran into this same issue on Server 2012 R2 and I see a couple of issues with this approach. 1) For those of us who have successfully run this as a service for years, you've now effectively orphaned a Windows service in the registry that will continue to repeatedly fail to start, generate event logs, flag Nagios alerts, etc. Not a big deal for someone like me, but for others this could be quite undesirable. 2) We now have to rely on a piece of third-party software that you do not support. I've worked with NSSM in the past (when the devs I worked with couldn't figure out how to call back properly to Windows SCM, as well as with Apache Solr), and I understand that it's a fairly simple application with little to go wrong, but I'm just fundamentally opposed to software that names itself "Non-Sucking Service Manager." You guys clearly know how to write a proper Windows service and report back to Win SCM, so why fix what wasn't broken? EDIT: One may also run into the issue of name collision when trying to create the NSSM service. If this happens, simply remove the orphaned Windows service with the following from a CLI: C:\>sc delete emby [sC] DeleteService SUCCESS Edited November 3, 2017 by awdspyder
Luke 42080 Posted November 3, 2017 Posted November 3, 2017 I agree that the name of the software is not ideal. It does the job in all other respects though.
Luke 42080 Posted November 3, 2017 Posted November 3, 2017 You guys clearly know how to write a proper Windows service and report back to Win SCM, so why fix what wasn't broken? Two reasons - windows 10 updates on more than one occasion have required service adjustments. Now we can let NSSM worry about that so that we can focus on media management. But the biggest reason is that we have moved to .net core, which helps us deploy Emby Server on lots of different platforms. In order to have an embedded windows service we would have to break out the windows build into it's own separate entity, and that separation is likely to lead to other bugs and inconsistencies. Let me put it this way - if later there turns out to be another reason why we need to perform this separation, then the embedded service could easily return. But if it's the only reason, then right now it's not a strong enough reason to force us to do that.
awdspyder 11 Posted November 3, 2017 Posted November 3, 2017 Understood regarding .net core - anything to streamline and stabilize development is a good thing. As I mentioned, I've been using NSSM for years in various functions, and it does seem to work fine. I ran it in a production web environment for a clustered Apache Solr deployment that averaged over 1k http requests per second and it never caused any issues. Ah well, I always bragged on you guys to my coworkers because they all run that other app that starts with "P" and ends with "x" and it always needed a service wrapper. Frankly, this is probably the push I need to rebuild on Linux anyway when I purchase Premier. And, as always, I'm impressed with Emby's responsiveness on the forums!
Elfman 1 Posted November 30, 2017 Posted November 30, 2017 Wait, why do this? I ran into this same issue on Server 2012 R2 and I see a couple of issues with this approach. 1) For those of us who have successfully run this as a service for years, you've now effectively orphaned a Windows service in the registry that will continue to repeatedly fail to start, generate event logs, flag Nagios alerts, etc. Not a big deal for someone like me, but for others this could be quite undesirable. 2) We now have to rely on a piece of third-party software that you do not support. I've worked with NSSM in the past (when the devs I worked with couldn't figure out how to call back properly to Windows SCM, as well as with Apache Solr), and I understand that it's a fairly simple application with little to go wrong, but I'm just fundamentally opposed to software that names itself "Non-Sucking Service Manager." You guys clearly know how to write a proper Windows service and report back to Win SCM, so why fix what wasn't broken? EDIT: One may also run into the issue of name collision when trying to create the NSSM service. If this happens, simply remove the orphaned Windows service with the following from a CLI: C:\>sc delete emby [sC] DeleteService SUCCESS So that is what is happening on my system too. Unfortunate about the additional step with nssm but I suppose it is understandable and fairly tolerable. Also, thanks for the additional step of deleting the old Service. Worked like a charm. Thanks for that info!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now