kadrim/proxy4plex

Not starting on Debian 10 after 0.3.1.0 (@reboot cron job)

Closed this issue · 11 comments

Hi,
As I stated in the title I'm running a vbox debian 10 and I'm using 0.3.1.0 since it was released. I have a scheduled @reboot job in root's crontab like this:
@reboot /root/proxy4plex-0.3.1-0-g20c63b3-linux-amd64
and it's starting and working pretty nice.

Today I decided to grab the latest release but neither 0.5 nor 0.4 seems to be starting after debian restart.
root@debian10:~# ps -ef | grep plex
root 685 677 0 15:27 pts/0 00:00:00 grep plex

With 0.3.1 it was running ok:
root@debian10:~# ps -ef | grep plex
root 367 336 0 15:28 ? 00:00:00 /bin/sh -c /root/proxy4plex-0.3.1-0-g20c63b3-linux-amd64
root 371 367 0 15:28 ? 00:00:00 /root/proxy4plex-0.3.1-0-g20c63b3-linux-amd64
root 799 679 0 15:40 pts/0 00:00:00 grep plex

Can you check what might be the issue?
Thanks!

P.S.: proxy4plex-0.5.0-0-g04b8a10-linux-amd64

What does your cron.log show? Can you run the file manually? Or did you by chance forget to add the executable flag via

chmod +x proxy4plex-0.5.0-0-g04b8a10-linux-amd64

?

Mask is OK.
-rwxr-xr-x 1 root root 5427200 Feb 18 2021 proxy4plex-0.2.0-0-g206e9dc-linux-amd64
-rwxr-xr-x 1 root root 5980160 Dec 13 14:53 proxy4plex-0.3.0-0-g53b9345-linux-amd64
-rwxr-xr-x 1 root root 5980160 Dec 22 18:36 proxy4plex-0.3.1-0-g20c63b3-linux-amd64
-rwxr-xr-x 1 root root 5128192 Jan 6 15:20 proxy4plex-0.4.0-0-g4766977-linux-amd64
-rwxr-xr-x 1 root root 5128192 Jan 6 15:01 proxy4plex-0.5.0-0-g04b8a10-linux-amd64

Cron log:
root@debian10:/var/log# tail cron.log
Jan 6 19:56:38 debian10 CRON[368]: (root) CMD (/root/proxy4plex-0.3.1-0-g20c63b3-linux-amd64)
Jan 6 19:57:06 debian10 crontab[684]: (root) BEGIN EDIT (root)
Jan 6 19:57:10 debian10 crontab[684]: (root) END EDIT (root)
Jan 6 19:57:15 debian10 crontab[696]: (root) BEGIN EDIT (root)
Jan 6 19:57:28 debian10 crontab[696]: (root) REPLACE (root)
Jan 6 19:57:28 debian10 crontab[696]: (root) END EDIT (root)
Jan 6 19:57:46 debian10 cron[342]: (CRON) INFO (pidfile fd = 3)
Jan 6 19:57:46 debian10 cron[342]: (CRON) INFO (Running @reboot jobs)
Jan 6 19:57:46 debian10 CRON[365]: (root) CMD (/root/proxy4plex-0.5.0-0-g04b8a10-linux-amd64)
Jan 6 19:57:46 debian10 CRON[357]: (CRON) info (No MTA installed, discarding output)
root@debian10:/var/log# ps -ef | grep plex
root 729 676 0 19:59 pts/0 00:00:00 grep plex
root@debian10:/var/log#

Run manually:
root@debian10:~# ./proxy4plex-0.5.0-0-g04b8a10-linux-amd64
2022/01/06 20:01:05 The Proxy will be listening on these IP-Addresses:
2022/01/06 20:01:05 #1: 192.168.1.108
2022/01/06 20:01:05 The most likely IP-Address to use for Plex should be: 192.168.1.108
2022/01/06 20:01:05 Server starting on Port 3000 ...
2022/01/06 20:01:05 Trying to start app-deployer on port 80 ...

so no problem with the proxy, something else might be fishy on the VM. Your cronlog states, that there are some messages, but you have no MTA (i.e. postfix) so you really don't know what is going on. Could be the usual console-log, or an error log.

adjust your crontab to:

@reboot /root/proxy4plex-0.5.0-0-g04b8a10-linux-amd64 &> /tmp/proxy4plex.log

and reboot your system. after that post the output of the file /tmp/proxy4plex.log

adjust the path as needed

Nothing in the log...

root@debian10:~# cd /tmp
root@debian10:/tmp# ll
total 20
drwxrwxrwt 2 root root 4096 Jan 6 22:06 .font-unix
drwxrwxrwt 2 root root 4096 Jan 6 22:06 .ICE-unix
-rw-r--r-- 1 root root 0 Jan 6 22:06 proxy4plex.log
drwxrwxrwt 2 root root 4096 Jan 6 22:06 .Test-unix
drwxrwxrwt 2 root root 4096 Jan 6 22:06 .X11-unix
drwxrwxrwt 2 root root 4096 Jan 6 22:06 .XIM-unix

root@debian10:/tmp# tail proxy4plex.log
root@debian10:/tmp# ps -ef | grep plex
root 688 677 0 22:07 pts/0 00:00:00 grep plex

then, sadly i am out of ideas here. the proxy does perform the way it should since you can run it manually. maybe something on your system changed. Also i cannot give advice for problems that are related to OS and not the program.

as a last resort you could also try not using cron to start this process but rather via /etc/rc.local, because via cron your profile is not exactly the same as when logged in.

i suggest you start the program there but also fork it (using &)

or maybe the problem occurs because your cron @reboot runs too early before network is up, either way i would suggest the /etc/rc.local way, which is cleaner.

or, what would be best is to create a systemd unit file. that is, if you are running systemd which i suppose. there are many tutorials out there, how to do it.

runs too early before network is up

i really do think, that is the case on your end. i can make it so, that missing network is not a fatal error anymore and the startup will continue as usual

please try it again with version 0.5.1
i think, this will solve your problem.

Yep, I also think missing network shouldn't be fatal error.
Working now with 0.5.1.
Thanks! :)

Glad to hear :-)