PMS as a service

Thanks for this! Amazing that this isn't a feature of Plex already.

Tried cjmurph's workaround, srvany, now on to task scheduler/start pms method.  Everything I've tried fails. WS2012E on hardware, not vm.   Any guidance on how to get stable as a service will be immensely and humbly appreciated.

Symptoms:

  1. Reboot server, all methods to setup as a service work for a few minutes or until first launch of a movie
  2. Roku app no longer sees libraries; Mobile app no longer sees libraries, etc.
  3. Can't kill/restart process on server, sometimes 2 instances of PMS

Things I checked:

  1. I don't have PMS checked to start at login
  2. I don't have any entries in Startup run folder or registry
  3. AppData/Local/Plex Media Server has read rights using install account and one used for services
  4. Checked that install account was used each time service was setup (srvany, nssm, etc.)

Please help me get this stable on WS2012E, thanks...here's the logs.  Note that the DLNA log is from 1 prior reboot as I disabled DLNA on last run to isolate issues.  Thanks in advance.

I'm truly considering a lifetime plexpass, but can't until I get this stable on my server.

Can't kill/restart process on server, sometimes 2 instances of PMS

AppData/Local/Plex Media Server has read rights using install account and one used for services

Are you having different user for install from one you run PMS Service under?

If you are, then the auto start would be having in the install account leading to 2 instances.


See my post #4

The registry setting is for the user account and would be different depending on which session loads up regedit

See bullet 4 in things I checked in my original post.  I did ensure that same account was used to install PMS as well as launch the service(s).

Are you having different user for install from one you run PMS Service under?

If you are, then the auto start would be having in the install account leading to 2 instances.

See my post #4 https://forums.plex.tv/topic/93994-pms-as-a-service/?p=547864

The registry setting is for the user account and would be different depending on which session loads up regedit

See bullet 4 in things I checked in my original post.  I did ensure that same account was used to install PMS as well as launch the service(s).

there should be a cjmurph pmsSerevice log file as well. in c:\ProgramData

Tried cjmurph's workaround, srvany, now on to task scheduler/start pms method.  Everything I've tried fails. WS2012E on hardware, not vm.   Any guidance on how to get stable as a service will be immensely and humbly appreciated.

Symptoms:

  1. Reboot server, all methods to setup as a service work for a few minutes or until first launch of a movie
  2. Roku app no longer sees libraries; Mobile app no longer sees libraries, etc.
  3. Can't kill/restart process on server, sometimes 2 instances of PMS

Things I checked:

  1. I don't have PMS checked to start at login
  2. I don't have any entries in Startup run folder or registry
  3. AppData/Local/Plex Media Server has read rights using install account and one used for services
  4. Checked that install account was used each time service was setup (srvany, nssm, etc.)

Please help me get this stable on WS2012E, thanks...here's the logs.  Note that the DLNA log is from 1 prior reboot as I disabled DLNA on last run to isolate issues.  Thanks in advance.

I'm truly considering a lifetime plexpass, but can't until I get this stable on my server.

The logfile shows you are not using cjmurph's pmsservice package

Would be happy to help you troubleshoot if you use it. This thread is for that solution

I couldn't get it to work stable using cj's workaround, so went back to svrany standard approach, then most recently to task scheduler/auto login using same account as install.   I have tried all methods, with the same symptoms.

If you feel you can guide me instead of me flailing at the issues, I'll gladly reinstall cj's 1.0.1 solution and send the log over.

Let me know or if the existing logs tell you smart folks something.

OK, I will reinstall and post all logs again.

Let me know or if the existing logs tell you smart folks something.

Some slow access to the database - 1 second for 5 items. Previously this suggestion was given:

Some Plug-in timeouts - this normally fixes a lot of such issues : https://plexapp.zendesk.com/hc/en-us/articles/201119258-Resetting-System-and-Framework-bundles

Issue with scanning some media : may be setting verbose logging in PMS Settings / Advanced would give more info relating to the media file concerned

Could also try disabling automatic indexing initially in Library settings and bring it later

Feb 26, 2014 10:30:47:104 [7600] INFO - Matched video stream: FFmpeg index 0 (id 0) -> MediaInfo stream index 0 (id 1)
Feb 26, 2014 10:30:47:104 [7600] INFO -  * MediaInfo: format=AVC, bitrate=4778850
Feb 26, 2014 10:30:47:104 [7600] INFO -  * FFmpeg: codec=h264, bitrate=0
Feb 26, 2014 10:30:47:104 [7600] INFO - Matched audio stream: FFmpeg index 1 (id 0) -> MediaInfo stream index 0 (id 2)
Feb 26, 2014 10:30:47:104 [7600] INFO -  * MediaInfo: format=AC-3, language=eng, bitrate=384000, channels=6
Feb 26, 2014 10:30:47:104 [7600] INFO -  * FFmpeg: codec=ac3, language=eng, bitrate=384000, channels=6
Feb 26, 2014 10:30:47:104 [7600] INFO - Matched subtitle stream: FFmpeg index 2 (id 0) -> MediaInfo stream index 0 (id 3)
Feb 26, 2014 10:30:47:104 [7600] INFO -  * MediaInfo: format=srt, encoding=UTF-8, language=eng
Feb 26, 2014 10:30:47:791 [7600] WARN - Held transaction for too long (Library\MediaItem.cpp:1015): 0.655000 seconds
Feb 26, 2014 10:30:48:305 [7600] INFO - [FFMPEG] - Unknown entry 0xF0
Feb 26, 2014 10:30:48:305 [7600] INFO - [FFMPEG] - Unknown entry 0xF0
Feb 26, 2014 10:30:48:305 [7600] INFO - [FFMPEG] - Unknown entry 0xF0
Feb 26, 2014 10:30:48:305 [7600] INFO - [FFMPEG] - Unknown entry 0xB2
Feb 26, 2014 10:30:48:305 [7600] INFO - [FFMPEG] - Unknown entry 0xF0
Feb 26, 2014 10:30:48:305 [7600] INFO - [FFMPEG] - Unknown entry 0xF0
goes on and on

Can i use this with Windows 8.1? I log in with my Microsoft account. 

Well, installed 1.0.1   Removed task on startup, ensured no traces of services existed before installing.  Below are the new logs.  I did the following to limit variables and test:

  1. Unchecked auto scan for library changes
  2. Unchecked DLNA 
  3. Opened on multiple clients and played movie/tv (Android 4.3 SGS4, Web-Chrome, PHT Fat Client-Win7)  all appeared stable this time
  4. Attached are logs.  Please advise if anything is still wonky.  
  5. @sa2000, I will look into those threads you mentioned on the slow response times and plugin timeouts (I have no additional plug ins installed ?!?!)

Well, installed 1.0.1   Removed task on startup, ensured no traces of services existed before installing.  Below are the new logs.  I did the following to limit variables and test:

  1. Unchecked auto scan for library changes
  2. Unchecked DLNA 
  3. Opened on multiple clients and played movie/tv (Android 4.3 SGS4, Web-Chrome, PHT Fat Client-Win7)  all appeared stable this time
  4. Attached are logs.  Please advise if anything is still wonky.  
  5. @sa2000, I will look into those threads you mentioned on the slow response times and plugin timeouts (I have no additional plug ins installed ?!?!)

You had an issue at 11:23:31 but fixed at 11:27:13.

You need to establish why the PMS Service indicated Plex Media Server was already running at 11:23

2/24/2014 10:38:38 PM: Killing Plex.
2/24/2014 10:38:38 PM: PlexDlnaServer Stopped.
2/24/2014 10:38:38 PM: PlexMediaServerService Stopped
 
2/26/2014 11:23:30 AM: PlexMediaServerService Started
2/26/2014 11:23:31 AM: Plex executable found at C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe
2/26/2014 11:23:31 AM: Attempting to start Plex
2/26/2014 11:23:31 AM: Plex Media Server already running in session 0.
 
2/26/2014 11:27:08 AM: PlexMediaServerService Started
2/26/2014 11:27:11 AM: Plex executable found at C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe
2/26/2014 11:27:13 AM: Attempting to start Plex
2/26/2014 11:27:18 AM: Plex Media Server version is 0.9.8.18. Can use startup argument.
2/26/2014 11:27:20 AM: Plex Media Server Started.
 

The log file shows loads of errors, so may be there are still multiple processes. Look at Task Manager and click show Processes for All Users and see what processes are running with names starting with Plex....

One error of concurrent processes (could be a bug or multiple instances running) - 

 
Feb 26, 2014 11:42:06:405 [10632] ERROR - Failed to delete file, future transcodes may be affected (boost::filesystem::remove: The process cannot access the file because it is being used by another process: "C:\Users\RICH-A~1\AppData\Local\Temp\plex-transcode-1GN39W017839-72cfcc69-378a-424b-b5c9-171de42fb7c8\media-04084.ts", C:\Users\RICH-A~1\AppData\Local\Temp\plex-transcode-1GN39W017839-72cfcc69-378a-424b-b5c9-171de42fb7c8\media-04084.ts)
 
Feb 26, 2014 11:42:06:452 [10632] ERROR - Failed to delete directory, future transcodes may be affected (boost::filesystem::remove: The process cannot access the file because it is being used by another process: "C:\Users\RICH-A~1\AppData\Local\Temp\plex-transcode-1GN39W017839-72cfcc69-378a-424b-b5c9-171de42fb7c8\media-04084.ts", C:\Users\RICH-A~1\AppData\Local\Temp\plex-transcode-1GN39W017839-72cfcc69-378a-424b-b5c9-171de42fb7c8\media-04084.ts)
 
These errors appear for several files in the log
 
I do not know if this has something to do with it
C:\ProgramData\boost_interprocess
But it has caused issues before when PMS was run in different user accounts. Remedy was to shut down Plex Media Server, Delete the contents of the directory to get rid of old entries and restart Plex Media Server
 
Also check permissions all ok for the user
 
The log file shows a very unhealthy environment. Is it new installation? One moved from other location?
 
Feb 26, 2014 11:52:02:706 [10560] ERROR - Caught exception trying to stream file: V:\ServerFolders\Videos\_Movies\_XXXXXX\XXXXXXXXXXXXXX\XXXXXXXXXXXXXXXXXX.mp4
 
Set Verbose Debug Logging in General Settings
 
You also have the plugin timeouts - try repairing the system and framework bundles
 
You could also look at netstat -a -b output to see in case other app is also using port 32400
 
I would follow these issues outside this thread, Plex Media Server Service has got Plex Media Server running in the user 'Rich-Admin' and it has done its job

My plex drops from the network suddenly, no rhyme or reason to it. If I close it I have to reboot to get it to restart. I am running server essentials 2012

My plex drops from the network suddenly, no rhyme or reason to it. If I close it I have to reboot to get it to restart. I am running server essentials 2012

I do not expect this to have anything to do with the fact that it is running as a Service.

could be network issue or the tcp ip / sockets issue with windows 2012 and windows 8 fixed in Windows 2012 R2 and windows 8.1

If you are not on R2 you could browse the forums / search for posts relating to windows server 2012 and you will come across the long threads on this

My plex drops from the network suddenly, no rhyme or reason to it. If I close it I have to reboot to get it to restart. I am running server essentials 2012

Zukdj,

All I can tell you is that I went through a variety of methods including installing this at one point on WS2012E.  It was unstable.  I've most recently installed it again and has been running fine for a week.  I made sure to remove all remnants of the prior service installs (srvany approach) sc delete, uninstalled PMS, cleaned registry of all PMS and PMS service references.  Rebooted.  Re-installed PMS, ran PMS, unchecked startup automatically, exited PMS, installed PMS service from this thread.  Seemed to be running stable since.  Beware of potentially losing pms user data/prefs. following this approach.  Please don't blame me if something goes awry with your current install.

What version of PMS are you running?

Great little app to turn PLEX into a service for Windows.  I am running Windows Server 2008 R2 on VMware ESX 5.

Your instructions were very simple to follow and I had no issues at all.

I will continue to test and update as needed.

Thanks for this.

Brad

FYI, I am running 0.9.9.5.411-da1d892, Server Essentials 2012 fully patched, unchecked startup automatically, exited PMS, installed PMS service from this thread. Strange that it just drops at no specific time. If it does drop I have to reboot to reconnect.

FYI, I am running 0.9.9.5.411-da1d892, Server Essentials 2012 fully patched, unchecked startup automatically, exited PMS, installed PMS service from this thread. Strange that it just drops at no specific time. If it does drop I have to reboot to reconnect.

This was the problem relating to tcp/winsock that I was thinking of

https://forums.plex.tv/topic/75484-windows-server-essentials-pms-freezing-fix/

https://forums.plex.tv/topic/52700-pms-crash-on-windows-server-2012/?p=425764

Confirmation here later in that thread that Windows Server Essentials 2012 R2 fixed the problem

https://forums.plex.tv/topic/52700-pms-crash-on-windows-server-2012/?p=464185

There were also confirmations elsewhere that disabling the Windows Server 2012 built-in vpn 'Anywhere Access' fixed the problem

It might not be your problem - but could be

Big thanks to cjmurph for this. I finally bit the bullet and implimented this on my 2012 PMH. Yes, PMH- as in HOST. I dont see the validity of calling it a "Server" until it can run headless without 3rd party apps.

Maybe one day the dev's will make this a true Server... but don't hold your breath on that...

Would have been better if Plex run as service natively but BIG THANKS to cjmurph for this. Though I've noticed that Plex Service won't run if the Windows User Account does not have a password. Is there a workaround for this?