Error 48 - Port 80

Hello everyone, I've been trying for 6 hours now to get PlexConnect working (Yes I've read the entire wiki, FAQ and Installation Guides) and my brain is now dribbling out of my ears. Dear God someone help me, or at least put me out of my misery. 

 

Everything seems to be set up fine:  (OSX 10.8.3 , ATV3 5.2.1, Airport)

 

DHCP reservation set in Airport for both Host of PMC & PlexConnect, and for ATV.

 

Plex library is stored on Airport (TimeCapsule) 10.0.1.1

 

ATV3 DNS is set to the PlexConnect host IP address of 10.0.1.2 (the ATV's DNS was initially set to 10.0.1.1 - same as the router address, anyone know if this is weird?)

 

Settings.py is pointed at 10.0.1.1 (from the ATV's automatically set DNS)

 

PMS is running on the PlexConnect host machine. 

 

But I can't get past this "Errno 48" thing. Every time i run the script, i get the same result:

 

Zeus:PlexConnect-XML_templates Tom$ sudo ./PlexConnect.py
Password:
PlexConnect : ***
PlexConnect : PlexConnect
PlexConnect : Press ENTER to shut down.
PlexConnect : ***
PlexConnect : IP_self: 10.0.1.2
PlexGDM : ***
PlexGDM : looking up Plex Media Server
PlexGDM : ***
PlexGDM : servers discovered: 1
DNSServer : ***
DNSServer : Starting up.
DNSServer : intercept trailers.apple.com: 10.0.1.2
DNSServer : forward other to higher level DNS: 10.0.1.1
DNSServer : ***
WebServer : Failed to connect to port 80 (http): [Errno 48] Address already in use
PlexConnect : WebServer not alive. Shutting down.
DNSServer : Shutting down.
 
Does anyone know how to fix this? I can't find any other reference to Error/Errno 48 in the forum or on github.
 
Thanks in advance. 

 

Looks like you have some sort of WebServer running already - InternetSharing active?

Entering "sudo lsof -i -P" (without the quotes) in the terminal will tell you what is using port 80 if you do not know.

Looks like you have some sort of WebServer running already - InternetSharing active?

In System Preferences - Network? I tried turning everything off to no avail

Entering "sudo lsof -i -P" (without the quotes) in the terminal will tell you what is using port 80 if you do not know.

I get "mDNSRespo   39 _mdnsresponder   80u  IPv4 0x4d3cfbd7ef1a10b      0t0    UDP *:53148" which doesn't really mean anything to me...

It is usually part of the OS that does the DNS lookups, it should not usually the port unless:

  • You have something running that needs to continually look up internet addresses
  • It needs to be restarted and there is an issue with it (you can try killing it using activity monitor)
  • You have malware on your machine that is sending out a stream of spam (you would likely see a lot of the same process though)

Have you tried rebooting your machine?

It is usually part of the OS that does the DNS lookups, it should not usually the port unless:

  • You have something running that needs to continually look up internet addresses
  • It needs to be restarted and there is an issue with it (you can try killing it using activity monitor)
  • You have malware on your machine that is sending out a stream of spam (you would likely see a lot of the same process though)

Have you tried rebooting your machine?

What would be something that continually looks up internet addresses? I'm not running anything out of the ordinary on my machine. 

Rebooted multiple times - the first thing I did 

Does this count at the same process multiple times?:

mDNSRespo 600 _mdnsresponder    8u  IPv4 0x50a7f3f083bf8229      0t0    UDP *:5353
mDNSRespo 600 _mdnsresponder    9u  IPv6 0x50a7f3f083bf4e19      0t0    UDP *:5353
mDNSRespo 600 _mdnsresponder   15u  IPv4 0x50a7f3f083bf4c91      0t0    UDP *:50626
mDNSRespo 600 _mdnsresponder   16u  IPv6 0x50a7f3f083bf8539      0t0    UDP *:50626
mDNSRespo 600 _mdnsresponder   17u  IPv4 0x50a7f3f085419e19      0t0    UDP *:61184
mDNSRespo 600 _mdnsresponder   18u  IPv6 0x50a7f3f083bf58d1      0t0    UDP *:61184
mDNSRespo 600 _mdnsresponder   19u  IPv4 0x50a7f3f083bf5749      0t0    UDP *:54277
mDNSRespo 600 _mdnsresponder   20u  IPv6 0x50a7f3f083bf55c1      0t0    UDP *:54277
mDNSRespo 600 _mdnsresponder   21u  IPv4 0x50a7f3f083bf5439      0t0    UDP *:55580
mDNSRespo 600 _mdnsresponder   22u  IPv6 0x50a7f3f08541b9a9      0t0    UDP *:55580
mDNSRespo 600 _mdnsresponder   23u  IPv4 0x50a7f3f08541b821      0t0    UDP *:58382
mDNSRespo 600 _mdnsresponder   24u  IPv6 0x50a7f3f08541b699      0t0    UDP *:58382
mDNSRespo 600 _mdnsresponder   25u  IPv4 0x50a7f3f08541b511      0t0    UDP *:64667
mDNSRespo 600 _mdnsresponder   26u  IPv6 0x50a7f3f08541b389      0t0    UDP *:64667
mDNSRespo 600 _mdnsresponder   27u  IPv4 0x50a7f3f08541b201      0t0    UDP *:55923
mDNSRespo 600 _mdnsresponder   28u  IPv6 0x50a7f3f08541b079      0t0    UDP *:55923
mDNSRespo 600 _mdnsresponder   29u  IPv4 0x50a7f3f08541aef1      0t0    UDP *:54038
mDNSRespo 600 _mdnsresponder   30u  IPv6 0x50a7f3f08541ad69      0t0    UDP *:54038
mDNSRespo 600 _mdnsresponder   31u  IPv4 0x50a7f3f08541abe1      0t0    UDP *:55803
mDNSRespo 600 _mdnsresponder   32u  IPv6 0x50a7f3f08541aa59      0t0    UDP *:55803
mDNSRespo 600 _mdnsresponder   33u  IPv4 0x50a7f3f08541a8d1      0t0    UDP *:56648
mDNSRespo 600 _mdnsresponder   34u  IPv6 0x50a7f3f08541a749      0t0    UDP *:56648
mDNSRespo 600 _mdnsresponder   35u  IPv4 0x50a7f3f08541a5c1      0t0    UDP *:52407
mDNSRespo 600 _mdnsresponder   36u  IPv6 0x50a7f3f08541a439      0t0    UDP *:52407
mDNSRespo 600 _mdnsresponder   37u  IPv4 0x50a7f3f08541a129      0t0    UDP *:55571
mDNSRespo 600 _mdnsresponder   38u  IPv6 0x50a7f3f085419fa1      0t0    UDP *:55571
mDNSRespo 600 _mdnsresponder   39u  IPv4 0x50a7f3f085419c91      0t0    UDP *:63451
mDNSRespo 600 _mdnsresponder   40u  IPv6 0x50a7f3f085419b09      0t0    UDP *:63451
mDNSRespo 600 _mdnsresponder   41u  IPv4 0x50a7f3f085419981      0t0    UDP *:49948
mDNSRespo 600 _mdnsresponder   42u  IPv6 0x50a7f3f0854197f9      0t0    UDP *:49948
mDNSRespo 600 _mdnsresponder   43u  IPv4 0x50a7f3f085419671      0t0    UDP *:62790
mDNSRespo 600 _mdnsresponder   44u  IPv6 0x50a7f3f0854194e9      0t0    UDP *:62790
mDNSRespo 600 _mdnsresponder   47u  IPv4 0x50a7f3f085419361      0t0    UDP all-systems.mcast.net:5350
mDNSRespo 600 _mdnsresponder   48u  IPv6 0x50a7f3f0854191d9      0t0    UDP *:*

Can you paste the whole output of the terminal when you run that command as i do not see port

80 there at all.

Can you paste the whole output of the terminal when you run that command as i do not see port

80 there at all.

Here you go

Zeus:~ Tom$ sudo lsof -i -P
COMMAND   PID           USER   FD   TYPE             DEVICE SIZE/OFF   NODE NAME
launchd     1           root   11u  IPv6 0x50a7f3f084050d91      0t0    TCP *:3209 (LISTEN)
launchd     1           root   12u  IPv4 0x50a7f3f084055d79      0t0    TCP *:3209 (LISTEN)
launchd     1           root   14u  IPv4 0x50a7f3f083bf8e69      0t0    UDP localhost:60762
launchd     1           root   24u  IPv4 0x50a7f3f083bf8ce1      0t0    UDP *:137
launchd     1           root   25u  IPv4 0x50a7f3f083bf8b59      0t0    UDP *:138
launchd     1           root   32u  IPv6 0x50a7f3f0840509b1      0t0    TCP localhost:631 (LISTEN)
launchd     1           root   33u  IPv4 0x50a7f3f084055641      0t0    TCP localhost:631 (LISTEN)
UserEvent  11           root   76u  IPv4 0x50a7f3f083bf6511      0t0    UDP *:*
configd    16           root   10u  IPv6 0x50a7f3f083bf89d1      0t0    UDP *:*
configd    16           root   15u  IPv4 0x50a7f3f083bf83b1      0t0    UDP *:*
configd    16           root   20u  IPv4 0x50a7f3f083bf7151      0t0    UDP *:*
configd    16           root   22u  IPv4 0x50a7f3f083bf6fc9      0t0    UDP *:*
configd    16           root   24u  IPv4 0x50a7f3f083bf6e41      0t0    UDP *:*
configd    16           root   27u  IPv6 0x50a7f3f0867b2e69      0t0 ICMPV6 *:*
syslogd    18           root   18u  IPv4 0x50a7f3f0882a9539      0t0    UDP *:54319
blued      39           root    4u  IPv4 0x50a7f3f08541a2b1      0t0    UDP *:*
ntpd       41           root   20u  IPv4 0x50a7f3f083bf47f9      0t0    UDP *:123
ntpd       41           root   21u  IPv6 0x50a7f3f083bf4671      0t0    UDP *:123
ntpd       41           root   22u  IPv6 0x50a7f3f083bf75e9      0t0    UDP localhost:123
ntpd       41           root   23u  IPv4 0x50a7f3f083bf7461      0t0    UDP localhost:123
ntpd       41           root   24u  IPv6 0x50a7f3f083bf80a1      0t0    UDP localhost:123
ntpd       41           root   25u  IPv6 0x50a7f3f083bf8849      0t0    UDP zeus.local:123
ntpd       41           root   26u  IPv4 0x50a7f3f083bf52b1      0t0    UDP 10.0.1.2:123
ntpd       41           root   27u  IPv4 0x50a7f3f083bf7d91      0t0    UDP 10.211.55.2:123
ntpd       41           root   28u  IPv4 0x50a7f3f083bf78f9      0t0    UDP 10.37.129.2:123
ntpd       41           root   30u  IPv6 0x50a7f3f083bf7f19      0t0    UDP [fe80:a::99f:948:1b0e:9fd8]:123
ntpd       41           root   31u  IPv6 0x50a7f3f083bf44e9      0t0    UDP [fd31:1928:18d1:f1f5:99f:948:1b0e:9fd8]:123
httpd      42           root    5u  IPv6 0x50a7f3f0840501f1      0t0    TCP *:80 (LISTEN)
httpd      42           root    6u  IPv4 0x50a7f3f0840547d1      0t0    TCP *:* (CLOSED)
awacsd     74           root   11u  IPv6 0x50a7f3f0840505d1      0t0    TCP [fd31:1928:18d1:f1f5:99f:948:1b0e:9fd8]:4488 (LISTEN)
apsd       76           root    9u  IPv4 0x50a7f3f084053961      0t0    TCP 10.0.1.2:49154->17.149.36.122:5223 (ESTABLISHED)
netbiosd   92       _netbios    3u  IPv4 0x50a7f3f083bf8b59      0t0    UDP *:138
netbiosd   92       _netbios    4u  IPv4 0x50a7f3f083bf8ce1      0t0    UDP *:137
httpd     169           _www    5u  IPv6 0x50a7f3f0840501f1      0t0    TCP *:80 (LISTEN)
httpd     169           _www    6u  IPv4 0x50a7f3f0840547d1      0t0    TCP *:* (CLOSED)
racoon    283           root    6u  IPv6 0x50a7f3f083bf5129      0t0    UDP [fe80:a::99f:948:1b0e:9fd8]:500
racoon    283           root    7u  IPv6 0x50a7f3f083bf4fa1      0t0    UDP [fe80:a::99f:948:1b0e:9fd8]:4500
racoon    283           root    8u  IPv4 0x50a7f3f08541cf19      0t0    UDP 10.37.129.2:500
racoon    283           root    9u  IPv4 0x50a7f3f08541cd91      0t0    UDP 10.37.129.2:4500
racoon    283           root   10u  IPv4 0x50a7f3f08541cc09      0t0    UDP 10.211.55.2:500
racoon    283           root   11u  IPv4 0x50a7f3f08541ca81      0t0    UDP 10.211.55.2:4500
racoon    283           root   12u  IPv4 0x50a7f3f08541c8f9      0t0    UDP 10.0.1.2:500
racoon    283           root   13u  IPv4 0x50a7f3f08541c771      0t0    UDP 10.0.1.2:4500
racoon    283           root   14u  IPv6 0x50a7f3f08541c5e9      0t0    UDP zeus.local:500
racoon    283           root   15u  IPv6 0x50a7f3f08541c461      0t0    UDP zeus.local:4500
racoon    283           root   16u  IPv6 0x50a7f3f08541c2d9      0t0    UDP localhost:500
racoon    283           root   17u  IPv6 0x50a7f3f08541c151      0t0    UDP localhost:4500
racoon    283           root   18u  IPv4 0x50a7f3f08541bfc9      0t0    UDP localhost:500
racoon    283           root   19u  IPv4 0x50a7f3f08541be41      0t0    UDP localhost:4500
racoon    283           root   20u  IPv6 0x50a7f3f08541bcb9      0t0    UDP localhost:500
racoon    283           root   21u  IPv6 0x50a7f3f08541bb31      0t0    UDP localhost:4500
racoon    283           root   24u  IPv6 0x50a7f3f083bf7c09      0t0    UDP [fd31:1928:18d1:f1f5:99f:948:1b0e:9fd8]:500
racoon    283           root   25u  IPv6 0x50a7f3f083bf7a81      0t0    UDP [fd31:1928:18d1:f1f5:99f:948:1b0e:9fd8]:4500
SystemUIS 303            Tom    6u  IPv4 0x50a7f3f08541d3b1      0t0    UDP *:*
PlexHelpe 331            Tom    1u  IPv4 0x50a7f3f083bf4981      0t0    UDP *:*
NetworkBr 358            Tom    5u  IPv4 0x50a7f3f083bf6201      0t0    UDP *:*
locationd 365     _locationd    6u  IPv4 0x50a7f3f083bf6079      0t0    UDP *:*
Google    471            Tom   77u  IPv4 0x50a7f3f086c573b9      0t0    TCP 10.0.1.2:49230->qa-in-f125.1e100.net:5222 (ESTABLISHED)
Google    471            Tom  112u  IPv4 0x50a7f3f08f2453b9      0t0    TCP 10.0.1.2:49311->stackoverflow.com:80 (ESTABLISHED)
Google    471            Tom  206u  IPv4 0x50a7f3f08f615f09      0t0    TCP 10.0.1.2:49293->yyz08s10-in-f4.1e100.net:443 (ESTABLISHED)
mDNSRespo 600 _mdnsresponder    8u  IPv4 0x50a7f3f083bf8229      0t0    UDP *:5353
mDNSRespo 600 _mdnsresponder    9u  IPv6 0x50a7f3f083bf4e19      0t0    UDP *:5353
mDNSRespo 600 _mdnsresponder   15u  IPv4 0x50a7f3f083bf4c91      0t0    UDP *:50626
mDNSRespo 600 _mdnsresponder   16u  IPv6 0x50a7f3f083bf8539      0t0    UDP *:50626
mDNSRespo 600 _mdnsresponder   17u  IPv4 0x50a7f3f085419e19      0t0    UDP *:61184
mDNSRespo 600 _mdnsresponder   18u  IPv6 0x50a7f3f083bf58d1      0t0    UDP *:61184
mDNSRespo 600 _mdnsresponder   19u  IPv4 0x50a7f3f083bf5749      0t0    UDP *:54277
mDNSRespo 600 _mdnsresponder   20u  IPv6 0x50a7f3f083bf55c1      0t0    UDP *:54277
mDNSRespo 600 _mdnsresponder   21u  IPv4 0x50a7f3f083bf5439      0t0    UDP *:55580
mDNSRespo 600 _mdnsresponder   22u  IPv6 0x50a7f3f08541b9a9      0t0    UDP *:55580
mDNSRespo 600 _mdnsresponder   23u  IPv4 0x50a7f3f08541b821      0t0    UDP *:58382
mDNSRespo 600 _mdnsresponder   24u  IPv6 0x50a7f3f08541b699      0t0    UDP *:58382
mDNSRespo 600 _mdnsresponder   25u  IPv4 0x50a7f3f08541b511      0t0    UDP *:64667
mDNSRespo 600 _mdnsresponder   26u  IPv6 0x50a7f3f08541b389      0t0    UDP *:64667
mDNSRespo 600 _mdnsresponder   27u  IPv4 0x50a7f3f08541b201      0t0    UDP *:55923
mDNSRespo 600 _mdnsresponder   28u  IPv6 0x50a7f3f08541b079      0t0    UDP *:55923
mDNSRespo 600 _mdnsresponder   29u  IPv4 0x50a7f3f08541aef1      0t0    UDP *:54038
mDNSRespo 600 _mdnsresponder   30u  IPv6 0x50a7f3f08541ad69      0t0    UDP *:54038
mDNSRespo 600 _mdnsresponder   31u  IPv4 0x50a7f3f08541abe1      0t0    UDP *:55803
mDNSRespo 600 _mdnsresponder   32u  IPv6 0x50a7f3f08541aa59      0t0    UDP *:55803
mDNSRespo 600 _mdnsresponder   33u  IPv4 0x50a7f3f08541a8d1      0t0    UDP *:56648
mDNSRespo 600 _mdnsresponder   34u  IPv6 0x50a7f3f08541a749      0t0    UDP *:56648
mDNSRespo 600 _mdnsresponder   35u  IPv4 0x50a7f3f08541a5c1      0t0    UDP *:52407
mDNSRespo 600 _mdnsresponder   36u  IPv6 0x50a7f3f08541a439      0t0    UDP *:52407
mDNSRespo 600 _mdnsresponder   37u  IPv4 0x50a7f3f08541a129      0t0    UDP *:55571
mDNSRespo 600 _mdnsresponder   38u  IPv6 0x50a7f3f085419fa1      0t0    UDP *:55571
mDNSRespo 600 _mdnsresponder   39u  IPv4 0x50a7f3f085419c91      0t0    UDP *:63451
mDNSRespo 600 _mdnsresponder   40u  IPv6 0x50a7f3f085419b09      0t0    UDP *:63451
mDNSRespo 600 _mdnsresponder   41u  IPv4 0x50a7f3f085419981      0t0    UDP *:49948
mDNSRespo 600 _mdnsresponder   42u  IPv6 0x50a7f3f0854197f9      0t0    UDP *:49948
mDNSRespo 600 _mdnsresponder   43u  IPv4 0x50a7f3f085419671      0t0    UDP *:62790
mDNSRespo 600 _mdnsresponder   44u  IPv6 0x50a7f3f0854194e9      0t0    UDP *:62790
mDNSRespo 600 _mdnsresponder   47u  IPv4 0x50a7f3f085419361      0t0    UDP all-systems.mcast.net:5350
mDNSRespo 600 _mdnsresponder   48u  IPv6 0x50a7f3f0854191d9      0t0    UDP *:*

You are running "httpd", which is a web server, on port 80 already.

Do you have internet sharing or something on in system prefs?

Turns out they removed the option in system prefs in Mountain Lion.

See this for how to disable if you are not using it:

http://reviews.cnet.com/8301-13727_7-57481978-263/how-to-enable-web-sharing-in-os-x-mountain-lion/

If you need it you can change the port to 8080.

You are running "httpd", which is a web server, on port 80 already.
 
Do you have internet sharing or something on in system prefs?

Nope, everything in sharing is disabled in the preference pane

See my edit

Turns out they removed the option in system prefs in Mountain Lion.

See this for how to disable if you are not using it:

http://reviews.cnet.com/8301-13727_7-57481978-263/how-to-enable-web-sharing-in-os-x-mountain-lion/

If you need it you can change the port to 8080.

Huh? I am on 10.8.3 as well. And I am pretty sure I never ever had to tinker with "httpd"... How would it get enabled in the first place?

See my edit

Didn't help, the article is about turning Web Sharing on, not off. Or do i misunderstand? Either way it didn't work

If you feel like stoping the httpd service completely you can issue the following command in terminal.

NOTE: This may have adverse effects on anything that relies on the httpd service. USE with caution.

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 

The -w makes it permanent, i.e. it wont be reloaded when you reboot.

If that works and you have no issues with other OS X services then you can leave it disabled.

If you wish to undo the above command you can issue the following to re-enable it.

sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Is it possible to change the port PlexConnect uses for http, rather than changing apache? I ask as I DO have a web server running on port 80, so obviously PC fails to launch.

Looking at WebServer.py, one of the lines is: 

server = HTTPServer(('',80), MyHandler)

Could one simply change it to

server = HTTPServer(('',8080), MyHandler)

then run things and get it to work?

I have made that change and the script does run. Have not had a chance to see if it's actually working from the AppleTV though, but will do so shortly.

Is it possible to change the port PlexConnect uses for http, rather than changing apache? I ask as I DO have a web server running on port 80, so obviously PC fails to launch.

Looking at WebServer.py, one of the lines is: 

server = HTTPServer(('',80), MyHandler)

Could one simply change it to

server = HTTPServer(('',8080), MyHandler)

then run things and get it to work?

I have made that change and the script does run. Have not had a chance to see if it's actually working from the AppleTV though, but will do so shortly.

That wont work, the atv looks for all traffic on port 80, just how it is sadly.

I run apache on the same machine as plexconnect and my solution was to change the apache port to 8080 and use my router to forward traffic from public 80 to private 8080.


Best of both worlds in my opinion. Outside world still sees my site and local network sees plexconnect.

That wont work, the atv looks for all traffic on port 80, just how it is sadly.

Ah, dumb moment on my part. I'll disable the web server and put it on another port :)