Jump to content

Error starting Http Server Ubuntu


Rivest
Go to solution Solved by Q-Droid,

Recommended Posts

After changing the HTTP or HTTPS port and restarting the server will not start. I get the following error in the log. I am using Ubuntu 18.04.

 

2019-08-10 16:39:58.796 Info App: Requesting administrative access to authorize http server
2019-08-10 16:39:58.799 Info ServerConfigurationManager: Saving system configuration
2019-08-10 16:39:58.819 Info HttpServer: Adding HttpListener prefix http://+:8096/
2019-08-10 16:39:58.820 Info HttpServer: Adding HttpListener prefix https://+:443/
2019-08-10 16:39:58.956 Error App: Error starting Http Server
        *** Error Report ***
        Version: 4.2.1.0
        Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
        Operating system: Unix 4.15.0.55
        64-Bit OS: True
        64-Bit Process: True
        User Interactive: True
        Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
        Processor count: 8
        Program data path: /var/lib/emby
        Application directory: /opt/emby-server/system
        System.Net.HttpListenerException: System.Net.HttpListenerException (13): Permission denied
           at SocketHttpListener.Net.HttpEndPointManager.GetEPListener(ILogger logger, String host, Int32 port, HttpListener listener, Boolean secure)
           at SocketHttpListener.Net.HttpEndPointManager.AddPrefixInternal(ILogger logger, String p, HttpListener listener)
           at SocketHttpListener.Net.HttpEndPointManager.AddListener(ILogger logger, HttpListener listener)
           at SocketHttpListener.Net.HttpListener.Start()
           at Emby.Server.Implementations.ApplicationHost.StartServer()
        Source: SocketHttpListener
        TargetSite: SocketHttpListener.Net.HttpEndPointListener GetEPListener(MediaBrowser.Model.Logging.ILogger, System.String, Int32, SocketHttpListener.Net.HttpListener, Boolean)

 

embyserver-63701051998.txt

Edited by Rivest
Link to comment
Share on other sites

You configured a custom https port but the server is being denied permission to that. Please shutdown the server, go here:

/var/lib/emby/config/system.xml

And change the value back to the default 8920. Then you can look into why Emby Server is being denied permission to port 443. Please let us know if this helps. Thanks.

Link to comment
Share on other sites

Changing it back to 8920 allows the server to start but when I change it back to 443 or the http port to 80 then it stops working again. How do I get it to bind to those ports?

Link to comment
Share on other sites

Those are difficult ones to bind to and you may need to research what your distro requires in order to grant Emby Server permission to do that.

 

@@Jdiesel do you have any tips?

Link to comment
Share on other sites

FYI - this is a freshly installed OS with nothing else but emby on it.

All I could find online is people telling you to edit the source code(of other projects) to use sudo or root permissions to bind the ports. I am not a developer. Is there something I am missing to do for this? Is there a way to run emby as root?

Edited by Rivest
Link to comment
Share on other sites

  • Solution
Q-Droid

Ports below 1024 are privileged and therefore need root level access to bind. Running emby-server as root or elevating privs with setuid is bad practice because now you would have a running media application that can do ANYTHING on your server. It also increases the attack surface from the internet (assuming you are doing this for remote access). We don't know what vulnerabilities Emby has nor those of the underlying components that Emby uses. Besides, "tweaking" things to force them to work also means they can break on the next update.

 

Better to use a purpose built reverse proxy if you really need those ports to be 80 and 443, or router port forwarding or external redirects.

  • Like 1
Link to comment
Share on other sites

I was able to setup Nginx as a reverse proxy to forward the ports. However I feel like this is just a workaround not an actual fix. I would think that the built in feature to Emby should work as its described and not allow you to set it to something that breaks it. Less technical users may have more difficulties. From what I read online there should be methods you can program that allows emby to use those ports without requiring it to run as root. 

Link to comment
Share on other sites

I was able to setup Nginx as a reverse proxy to forward the ports. However I feel like this is just a workaround not an actual fix. I would think that the built in feature to Emby should work as its described and not allow you to set it to something that breaks it. Less technical users may have more difficulties. From what I read online there should be methods you can program that allows emby to use those ports without requiring it to run as root. 

 

It does automatically switch back to the default port for the http port, and at one time it did for the https port as well. I'll look at that and make sure it's working again.

  • Like 1
Link to comment
Share on other sites

mastrmind11

I was able to setup Nginx as a reverse proxy to forward the ports. However I feel like this is just a workaround not an actual fix. I would think that the built in feature to Emby should work as its described and not allow you to set it to something that breaks it. Less technical users may have more difficulties. From what I read online there should be methods you can program that allows emby to use those ports without requiring it to run as root. 

I fail to see the need to ever change Emby's default ports.  It will always be between a router and WAN.  You router and/or reverse proxy does the routing to Emby at the default ports.  443 -> 8920 is a completely viable solution.  Or with a rev proxy 443 -> 8096 is viable and even simpler.  No point complicating things.  Changing them to reserved ports doesn't even make sense.  IMO, Emby should disallow ports below 1024 in the first place. 

Link to comment
Share on other sites

@@Luke Thanks for your help. Having it set back at least stops it from crashing.

 

@@mastrmind11 I have to dissagree. It is very much useful and convienent to change the port in emby as apposed to seting up some other port mapping elseware. By setting it to 443 or 80 it does not require you to add the :port at the end of the host name which makes it easier and more relatable to other not technical users that may be using it also. Just go to http://emby in the internal network. In a typical home network not everyone has a fancy router that can handle dns porr mapping or one thats not locked down by the isp. And setting up another reverse proxy or network appliance is just a bunch of extra unessesary work where one quick setting change should suffice. Yes its between router and wan but the users are to. They connect locally to that pc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...