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] HTPC port busy

edited February 24 in I'm new to OpenFLIXR
Hi, first of all hats off to the creators of this openflixr project. Motivates me to learn more linux :)

The problem I'm having now, after doing the setup and having everything to work. I wanted to make more memory and cpus available so I had to reboot the VM in Esxi. After this boot I can't get Htpc manager to work anymore. In Monit it shows that it can't get connection with HTPC and when trying to restart service there it gives me the CSRF error. So I tried to start it manually:

root@openflixr:/home/openflixr# python /opt/HTPCManager/Htpc.py

2019-02-11 00:11:31 :: root :: INFO :: Welcome to Hellowlol's HTPC Manager fork

2019-02-11 00:11:31 :: root :: INFO :: Loglevel set to info

2019-02-11 00:11:31 :: htpc.updater :: INFO :: Using GitUpdater engine

2019-02-11 00:11:31 :: apscheduler.scheduler :: INFO :: Added job "Updater.update_needed" to job store "default"

2019-02-11 00:11:31 :: modules.kodi :: WARNING :: No configured kodi-Servers.

2019-02-11 00:11:31 :: htpc.server :: INFO :: Starting up webserver

*******************************************************************

Starting HTPC Manager on port 8085.

Start your browser and go to http://localhost:8085/htpc

*******************************************************************

2019-02-11 00:11:31 :: cherrypy.error :: INFO :: [11/Feb/2019:00:11:31] ENGINE Listening for SIGHUP.

2019-02-11 00:11:31 :: cherrypy.error :: INFO :: [11/Feb/2019:00:11:31] ENGINE Listening for SIGTERM.

2019-02-11 00:11:31 :: cherrypy.error :: INFO :: [11/Feb/2019:00:11:31] ENGINE Listening for SIGUSR1.

2019-02-11 00:11:31 :: cherrypy.error :: INFO :: [11/Feb/2019:00:11:31] ENGINE Bus STARTING

2019-02-11 00:11:36 :: cherrypy.error :: ERROR :: [11/Feb/2019:00:11:36] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x7f4466f80910>>

Traceback (most recent call last):

  File "/opt/HTPCManager/libs/cherrypy/process/wspbus.py", line 205, in publish

    output.append(listener(*args, **kwargs))

  File "/opt/HTPCManager/libs/cherrypy/_cpserver.py", line 168, in start

    ServerAdapter.start(self)

  File "/opt/HTPCManager/libs/cherrypy/process/servers.py", line 170, in start

    wait_for_free_port(*self.bind_addr)

  File "/opt/HTPCManager/libs/cherrypy/process/servers.py", line 439, in wait_for_free_port

    raise IOError("Port %r not free on %r" % (port, host))

IOError: Port 8085 not free on 'server'


2019-02-11 00:11:36 :: cherrypy.error :: ERROR :: [11/Feb/2019:00:11:36] ENGINE Shutting down due to error in start listener:

Traceback (most recent call last):

  File "/opt/HTPCManager/libs/cherrypy/process/wspbus.py", line 243, in start

    self.publish('start')

  File "/opt/HTPCManager/libs/cherrypy/process/wspbus.py", line 223, in publish

    raise exc

ChannelFailures: IOError("Port 8085 not free on 'server'",)


2019-02-11 00:11:36 :: cherrypy.error :: INFO :: [11/Feb/2019:00:11:36] ENGINE Bus STOPPING

2019-02-11 00:11:36 :: apscheduler.scheduler :: INFO :: Scheduler has been shut down

2019-02-11 00:11:36 :: cherrypy.error :: INFO :: [11/Feb/2019:00:11:36] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('server', 8085)) already shut down

2019-02-11 00:11:36 :: cherrypy.error :: INFO :: [11/Feb/2019:00:11:36] ENGINE Bus STOPPED

2019-02-11 00:11:36 :: cherrypy.error :: INFO :: [11/Feb/2019:00:11:36] ENGINE Bus EXITING

2019-02-11 00:11:36 :: cherrypy.error :: INFO :: [11/Feb/2019:00:11:36] ENGINE Bus EXITED


But if the port is used, I tried to start it on 8096 it gives me no errors

/opt/HTPCManager/Htpc.py --port 8086

However if I then browse to server:8086/htpc it redirects me here:
http://127.0.0.1:8086/htpc/auth/login

Any thoughts where to look?

Comments

  • edited February 11
    Ok I found this: 
    What may be happening is that your process had a TCP port open when it crashed or otherwise exited without explicitly closing it. Normally the OS cleans up these sorts of things, but only when the process record goes away. While the process may not appear to be running any more, there is at least one thing that can keep a record of it around, in order to prevent reuse of its PID. This is the existence of a child process that is not detached from the parent.

    I killed the PID, then ran htpc.py again and it's up. Yet still not working :(

    About the csrf token error I found this:
    https://bitbucket.org/tildeslash/monit/issues/535/invalid-csrf-token

    I'm reinstalling Openflixr, I think I broke it with a cold reboot
  • Ok, just an update: got it working now. Awesome stuff, I learned a lot. The only thing I don't get is how to connect Ombi in HPTC manager
  • I can help with Ombi if this is still an issue?
  • Ombi is working perfect, but still no interface to HTPC manager.

    My settings:
    IP host: 127.0.0.1
    port: 3579
    user & pass filled in
    reverse proxy: /request

    Thanks for thinking along
  • Sounds right. Is it the Test button that's failing, or does the Ombi page not work (regardless of the what the Test button says)?
    For reference, here is my HTPC settings for Ombi


  • Is there any chance you're using port 5000 for Ombi? That's their new default port.
  • Hi Jeremy, I feel stupid again. I think I didn't fill in the correct username, now that I see your login <span>:blush:</span>

    Test button was failing & page didn't work

    I will let you know
  • Note that it is an Ombi user that you use, but as per the the little (i) icon beside the field it I suggest you add a specific user to Ombi with the right permissions.

    It was me that coded the Ombi module so I believe the Test button should be a fair representation, but I've seen at least one bug with HTPC itself that would mean that you may need to restart HTPC after an unsuccessful attempt, as it caches the incorrect setting and will always say Fail. After a restart, the correct settings should then work.
  • Well the testing made that I can't even log in normally anymore in ombi, weird. Login and password don't work anymore and I can't reset using mail since it was not set up :(

    I keep searching :)

  • Just an update, I could login anymore, deleted the ombi.db and reran the wizard. Now it works (port 3579). Also in HTPC

    Thanks for the help jeremywho

Sign In or Register to comment.