Plex plugin works but won't start

Status
Not open for further replies.

Joakim Ollila

Dabbler
Joined
Jun 6, 2015
Messages
31
Hello,

My plexmediaserver plugin works like a dream. but the plugin won't start on the plugins page. I can't stop the plugin and I can't stop it. This doesn't work when I put PMS_Updater into a cron job. Because the cron job needs to stop and start the plugin.. The update becomes available when i restart the jail. And i tried to install a new plugin and it works until i change permissions with this guide https://forums.freenas.org/index.ph...plugins-write-permissions-to-your-data.27273/ and the second solution..

When i try to start the plugin in the plugins page it says "some error occurred"
When i ssh and do service plexmediaserver start it says " starting plexmediaserver"
and status shows that it is not running. But it works....
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
does plex show in the left plugins menu.

that guide wouldn't affect if the plugins page stops working, only if the plugin itself stops working, possibly. is the 'service' command works your issue is with the middleware layer communicating between the jail and freenas.
 

Joakim Ollila

Dabbler
Joined
Jun 6, 2015
Messages
31
It doesn't show up in the left plugins menu. No I understand that it shouldn't affect it. But when I today installed a new plexplugin between everything I did i checked when it could be turned off and turned on. and after i changed those settings it didn't turn on again.

And when I try plexmediserver onestop it says this:
root@plexmediaserver_2:/ # service plexmediaserver onestop
plexmediaserver not running? (check /var/run/plex/plex.pid).

It wouldn't make any difference but I can't use the PMS script or I can use it but still need to restart the jail so the update applies...
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
It doesn't show up in the left plugins menu. No I understand that it shouldn't affect it. But when I today installed a new plexplugin between everything I did i checked when it could be turned off and turned on. and after i changed those settings it didn't turn on again.

And when I try plexmediserver onestop it says this:
root@plexmediaserver_2:/ # service plexmediaserver onestop
plexmediaserver not running? (check /var/run/plex/plex.pid).

It wouldn't make any difference but I can't use the PMS script or I can use it but still need to restart the jail so the update applies...
not sure what you're asking then. where you trying to stop it or start it with the 'onestop' command?

can you ping your computer from the plex jail? if not the jail can't route in your network which causes the plugins page not to work.
 

Joakim Ollila

Dabbler
Joined
Jun 6, 2015
Messages
31
I tried to stop it.
Yes I can ping my computer from the plex jail. Plex works perfect the only thing is that I can't start or stop the plugin with the plugins page or with 'start' respectivley 'stop' commands.

And the PMS script needs to restart the plugin to let the updated plex version to be applied. But it can't restart the plugin so I need to restart the jail everytime so that the newest version takes effect.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I tried to stop it.
Yes I can ping my computer from the plex jail. Plex works perfect the only thing is that I can't start or stop the plugin with the plugins page or with 'start' respectivley 'stop' commands.

And the PMS script needs to restart the plugin to let the updated plex version to be applied. But it can't restart the plugin so I need to restart the jail everytime so that the newest version takes effect.
OK, I think I understand. so 'service plexmediaserver start' doesn't work? if not you may need to enable plex with 'sysrc plexmediaserver_enable=YES'
this is done automatically when using the plugins tab, but since that isn't working you could work around it.

since ping works, I'm not sure why communication with the jail isn't working. I know for my system I always have to disable VIMAGE for my jails and assign my jails to a network interface, but that's because of my network setup.
 

Joakim Ollila

Dabbler
Joined
Jun 6, 2015
Messages
31
I tried to do this 'sysrc plexmediaserver_enable=YES' in th plex jail but it don't change anything the plugin won't start. and the commands still output the same problems.

I tried to disable VIMAGE from the jails settings page but I can't uncheck it.. why?

I have in my firewall an ip/mac binding to the plexjail and to everything else in my network that I want to have a static IP. Then I have the jails set to DHCP. I also have to interfaces and have made a LAGG to these. And configured it in my VLAN switch too. But I have tested with just one interface and normal settings too but no luck there either.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I tried to do this 'sysrc plexmediaserver_enable=YES' in th plex jail but it don't change anything the plugin won't start. and the commands still output the same problems.

I tried to disable VIMAGE from the jails settings page but I can't uncheck it.. why?

I have in my firewall an ip/mac binding to the plexjail and to everything else in my network that I want to have a static IP. Then I have the jails set to DHCP. I also have to interfaces and have made a LAGG to these. And configured it in my VLAN switch too. But I have tested with just one interface and normal settings too but no luck there either.
can you show a screenshot of the 'service plexmediaserver start' command and output?

maybe you need to use static IPs to disable VIMAGE? not my expertise =\
 

Joakim Ollila

Dabbler
Joined
Jun 6, 2015
Messages
31
root@plexmediaserver_2:/ # service plexmediaserver start
Starting plexmediaserver.
root@plexmediaserver_2:/ # service plexmediaserver stop
plexmediaserver not running? (check /var/run/plex/plex.pid).

That's what it says..

I tried to let the jail pick a new IP from my DHCP ping works, the plugin showed up in the list on the left but the commands don't work and the plugin won't turn on.
Then I put the jail to have a static IP and tested again same results as above.
Then I tested tu have a static IP and turn off VIMAGE same results as above.

Between every change I restarted the jail..
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
root@plexmediaserver_2:/ # service plexmediaserver start
Starting plexmediaserver.
root@plexmediaserver_2:/ # service plexmediaserver stop
plexmediaserver not running? (check /var/run/plex/plex.pid).

That's what it says..

I tried to let the jail pick a new IP from my DHCP ping works, the plugin showed up in the list on the left but the commands don't work and the plugin won't turn on.
Then I put the jail to have a static IP and tested again same results as above.
Then I tested tu have a static IP and turn off VIMAGE same results as above.

Between every change I restarted the jail..
OK, looks like we got 2 issues here. the GUI part you solved when you got the icon showing in the left panel.
but we still gotta get the underlying plugin to start and something about my permission guide or you performing the steps is causing the issue.

I have a feeling the pidfile might be the issue. maybe try this, then the start command. 'rm -r /var/run/plex'
 

Joakim Ollila

Dabbler
Joined
Jun 6, 2015
Messages
31
Ok, This is what I got :

root@plexmediaserver_2:/ # rm -r /var/run/plex
root@plexmediaserver_2:/ # service plexmediaserver start
Starting plexmediaserver.
root@plexmediaserver_2:/ # service plexmediaserver status
plexmediaserver is not running.
root@plexmediaserver_2:/ #
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ok, This is what I got :

root@plexmediaserver_2:/ # rm -r /var/run/plex
root@plexmediaserver_2:/ # service plexmediaserver start
Starting plexmediaserver.
root@plexmediaserver_2:/ # service plexmediaserver status
plexmediaserver is not running.
root@plexmediaserver_2:/ #
OK, strike 1, lol.
you said you used solution 2, can you show the output of 'ls -l /var/db/plexdata' and make sure that matches what you set as the plexmediaserver_user.
 

Joakim Ollila

Dabbler
Joined
Jun 6, 2015
Messages
31
I put that:
plexmediaserver_user="media"

And the command shows this:
root@plexmediaserver_2:/ # ls -l /var/db/plexdata
total 10
drwxr-xr-x 11 media media 12 Oct 26 19:41 Plex Media Server
root@plexmediaserver_2:/ #
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I put that:
plexmediaserver_user="media"

And the command shows this:
root@plexmediaserver_2:/ # ls -l /var/db/plexdata
total 10
drwxr-xr-x 11 media media 12 Oct 26 19:41 Plex Media Server
root@plexmediaserver_2:/ #
I have no idea why it's not working then. looks like you did everything right. why do you need plex to have plex match the user of your media files? are you writing metadata directly to your video folders? if not, read access should be sufficient.
 

Joakim Ollila

Dabbler
Joined
Jun 6, 2015
Messages
31
Oh :/ So i can delete media files from plex.. But maybe I'll make a new install and don't change the permissions.. Just need to figure out which one is more important.. To delete files from plex or to hav it update automatically..

But thanks for trying..
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Oh :/ So i can delete media files from plex.. But maybe I'll make a new install and don't change the permissions.. Just need to figure out which one is more important.. To delete files from plex or to hav it update automatically..

But thanks for trying..
ahh, good point. no prob. I can test changing the user for plex and post if I can get it working.
 

Joakim Ollila

Dabbler
Joined
Jun 6, 2015
Messages
31
I noticed that I cant ping 8.8.8.8 from my plex jail when I have a static IP... but I can ping the server which runs freenas and can ping other computers in my LAN. I need to check my ethernet cables and check the LAGG settings when I get to the server.. Do you know if it would be better to have 2 interfaces and disable VIMAGE and divide the jails between the interfaces or should I just have them in a LAGG?

EDIT: I don't really know what I did but now it works. I changed the jail to DHCP again and no mac bindin in my firewall and it works the plugin starts and stops like it should. So ofcourse it took an IP from my DHCP range.. Now when I try to bind the mac address which I find from the firewall and then restart the jail. Then the jail has the same IP from my DHCP range as before and has a new macaddress????

In the jail settings there isn't a mac address. When I put the mac address from the firewall in to the jail it takes the IP which I bind in the firewall. 192.168.1.5.. Then it stops working again. But I can ping 8.8.8.8 from the jail. Then I change the IP to 192.168.1.8 in the firewall restart the jail and voila plugin shows up in the left menu and starts and stops with commands..

So the IP 192.168.1.5 is broken apparently..
 
Last edited:

delfrogo

Cadet
Joined
Jul 17, 2015
Messages
5
I had a very similar issue where my plex server was running perfectly, but i couldn't stop the service. I would also get "plexmediaserver not running? (check /var/run/plex/plex.pid)." It also showed in the freenas GUI as being turned off even though everything was working fine.

I remember messing with permissions a few days ago by making plex run as media:media. I forgot that might mess things up. So to fix the problem, I just needed to change the permissions on the plex directory: "chown -R media:media /var/run/plex". I also changed the owner of the fcgi file too. Once i did that, I stopped the jail and turned it back on and now everything is working normally. My freenas GUI says its turned on and now I can stop and start the service via putty.

I hope it helps someone who is google searching.

in: /var/run/
old:
drwxr-xr-x 2 plex wheel 2 Dec 10 09:14 plex
-rw-rw-rw- 1 root wheel 5 Dec 10 09:14 plexmediaserver_fcgi_server.pid

new:
drwxr-xr-x 2 media media 2 Dec 10 09:14 plex
-rw-rw-rw- 1 media media 5 Dec 10 09:14 plexmediaserver_fcgi_server.pid
 
Last edited:

Joakim Ollila

Dabbler
Joined
Jun 6, 2015
Messages
31
I had a very similar issue where my plex server was running perfectly, but i couldn't stop the service. I would also get "plexmediaserver not running? (check /var/run/plex/plex.pid)." It also showed in the freenas GUI as being turned off even though everything was working fine.

I remember messing with permissions a few days ago by making plex run as media:media. I forgot that might mess things up. So to fix the problem, I just needed to change the permissions on the plex directory: "chown -R media:media /var/run/plex". I also changed the owner of the fcgi file too. Once i did that, I stopped the jail and turned it back on and now everything is working normally. My freenas GUI says its turned on and now I can stop and start the service via putty.

I hope it helps someone who is google searching.

in: /var/run/
old:
drwxr-xr-x 2 plex wheel 2 Dec 10 09:14 plex
-rw-rw-rw- 1 root wheel 5 Dec 10 09:14 plexmediaserver_fcgi_server.pid

new:
drwxr-xr-x 2 media media 2 Dec 10 09:14 plex
-rw-rw-rw- 1 media media 5 Dec 10 09:14 plexmediaserver_fcgi_server.pid
Thanks. This works :D
 
Joined
Dec 12, 2015
Messages
3
I had a very similar issue where my plex server was running perfectly, but i couldn't stop the service. I would also get "plexmediaserver not running? (check /var/run/plex/plex.pid)." It also showed in the freenas GUI as being turned off even though everything was working fine.

I remember messing with permissions a few days ago by making plex run as media:media. I forgot that might mess things up. So to fix the problem, I just needed to change the permissions on the plex directory: "chown -R media:media /var/run/plex". I also changed the owner of the fcgi file too. Once i did that, I stopped the jail and turned it back on and now everything is working normally. My freenas GUI says its turned on and now I can stop and start the service via putty.

I hope it helps someone who is google searching.

in: /var/run/
old:
drwxr-xr-x 2 plex wheel 2 Dec 10 09:14 plex
-rw-rw-rw- 1 root wheel 5 Dec 10 09:14 plexmediaserver_fcgi_server.pid

new:
drwxr-xr-x 2 media media 2 Dec 10 09:14 plex
-rw-rw-rw- 1 media media 5 Dec 10 09:14 plexmediaserver_fcgi_server.pid


Thanks this worked.

Just for others who are not quick like me!

Replace media with the username that you used for the permissions. But it works woopie :D!
 
Status
Not open for further replies.
Top