Join us on Discord! We now have an official Discord server for OpenFLIXR: https://discord.gg/PcCErTQ , these forums will continue to operate as normal.

[SOLVED] Couchpotato Broken

Hello all, I'm back with another oddity with Couchpotato:

So it shows it's running:
root@openflixr:/opt/openflixr# systemctl status couchpotato
● couchpotato.service - LSB: CouchPotato PVR for Usenet and torrents
   Loaded: loaded (/etc/init.d/couchpotato; bad; vendor preset: enabled)
   Active: active (running) since Wed 2018-09-26 09:44:33 CDT; 3min 15s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 572 ExecStop=/etc/init.d/couchpotato stop (code=exited, status=0/SUCCESS)
  Process: 1012 ExecStart=/etc/init.d/couchpotato start (code=exited, status=0/SUCCESS)
    Tasks: 1
   Memory: 776.1M
      CPU: 3min 34.787s
   CGroup: /system.slice/couchpotato.service
           └─1031 /usr/bin/python CouchPotato.py --daemon --quiet --pid_file=/home/openflixr/.couchpotato.pid --data_dir

Sep 26 09:44:33 openflixr systemd[1]: Starting LSB: CouchPotato PVR for Usenet and torrents...
Sep 26 09:44:33 openflixr couchpotato[1012]:  * Starting CouchPotato
Sep 26 09:44:33 openflixr couchpotato[1012]:    ...done.
Sep 26 09:44:33 openflixr systemd[1]: Started LSB: CouchPotato PVR for Usenet and torrents.

PS shows it's running as well:
root@openflixr:/opt/openflixr# ps -ef | grep -i couch
openfli+   1031      1 99 09:44 ?        00:04:34 /usr/bin/python CouchPotato.py --daemon --quiet --pid_file=/home/openflixr/.couchpotato.pid --data_dir=/opt/CouchPotato
root       4868 125140  0 09:48 pts/0    00:00:00 grep --color=auto -i couch

But getting bad gateway with nginx and it's not listening on port 5050. netstat -antp | grep :5050 shows nothing. There is nothing out of the ordinary in /var/log/syslog nor in /opt/CouchPotato/logs/CouchPotato.log

Comments

  • grep the netstat output for process 1031 and see what (if any) ports couch is using:
    netstat -antp | grep 1031

  • openflixr@openflixr:~$ sudo netstat -antp | grep 1031
    tcp        0      0 0.0.0.0:5050            0.0.0.0:*               LISTEN      1031/python     tcp       32      0 172.18.40.60:49878      5.9.136.14:443          CLOSE_WAIT  1031/python     tcp        1      0 127.0.0.1:49216         127.0.0.1:32400         CLOSE_WAIT  1031/python     tcp       32      0 172.18.40.60:59470      52.84.4.96:443          CLOSE_WAIT  1031/python     tcp        1      0 172.18.40.60:46844      84.22.106.189:443       CLOSE_WAIT  1031/python     tcp        1      0 127.0.0.1:42320         127.0.0.1:5075          CLOSE_WAIT  1031/python     tcp        1      0 127.0.0.1:47290         127.0.0.1:8080          CLOSE_WAIT  1031/python     tcp       32      0 172.18.40.60:59346      104.20.134.15:443       CLOSE_WAIT  1031/python     tcp       32      0 172.18.40.60:59908      104.16.60.155:443       CLOSE_WAIT  1031/python     tcp        0      0 172.18.40.60:56902      5.9.136.14:443          ESTABLISHED 1031/python     tcp       32      0 172.18.40.60:48868      50.16.246.113:443       CLOSE_WAIT  1031/python     tcp       32      0 172.18.40.60:37522      52.85.115.90:443        CLOSE_WAIT  1031/python     
  • And now it’s working...
  • I noticed that a bad gateway is related to high CPU, not necessarily  related to the scripts you are using. I see that in my case among others lidarr uses up to 80%, even if I am not using it. Disabling it does not help since monit launches it when "down". I have a lot of processes (that I don't use) that are eating CPU. 
  • Disable them in Monit, then disable them in Webmin.  Monit's is monitoring and will start/restart it.  Webmin's is whether to launch on bootup.  But sounds like you might be light on CPU.  What specs have you given the VM, and what spec is the hardware you're running on?
  • edited September 2018
    Hardware : AMD Phenom II X6 1090T 3.2 Ghz 8Gb RAM on Win7 x64

    VM : default image setup. Must be 3 Gb RAM, 2 CPU. Would love to see Openflixr running on my HP server N54L with ESXi 5.1 but am having serious issues with converting the VM.
  • Yeah you might be a bit light.  Openflixr runs no pagefile/swap so the 3G of RAM is all there is.
    I run with 10GB RAM and 4 vCPU cores, but I also do it on ESXi 5.5 so there's not rogue background processes stealing all my CPU.  I've also modded my VM so it has 4GB of swap in addition to the RAM, as I found it was entering low memory scenarios occassionally (although I had 6GB RAM then).

    Check your AV, make sure it's not doing something to the VHDX disk files.
    Kill off Docker in both Monit and Webmin.
    Set Webmin to not gather background statistics
    Consider disabling Netdata, although Netdata might show you what the bottleneck is and personally I think it's not heavy at all (others disagree).
  • Back again, same issue, it shows its running but not listening.
  • jeremywho said:
    Disable them in Monit, then disable them in Webmin.  Monit's is monitoring and will start/restart it.  Webmin's is whether to launch on bootup.  
    Can't disable in Monit. It gives an error "Forbidden Invalid CSRF Token". Did some research and it seems this is fixed in Monit 5.25.1-1. But how can I update my Monit in openflixr ?
  • You don't need to update it (although I did) - the fix is in the reverse proxy settings I believe.
    I'll write up something tonight and share it.
  • Testing Ubuntu 18.04 LTSR, everything works 99,99% so I'm planning to create an update script.

    This will also install the latest Monit and fixes CSRF problems.

Sign In or Register to comment.