We failed to reach a server. Reason: [Errno 111] Connection refused

Exception happened during processing of request from ('192.168.0.9', 56888)

Traceback (most recent call last):

  File "/volume1/@appstore/python/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock

    self.process_request(request, client_address)

  File "/volume1/@appstore/python/lib/python2.7/SocketServer.py", line 321, in process_request

    self.finish_request(request, client_address)

  File "/volume1/@appstore/python/lib/python2.7/SocketServer.py", line 334, in finish_request

    self.RequestHandlerClass(request, client_address, self)

  File "/volume1/@appstore/python/lib/python2.7/SocketServer.py", line 649, in __init__

    self.handle()

  File "/volume1/@appstore/python/lib/python2.7/BaseHTTPServer.py", line 340, in handle

    self.handle_one_request()

  File "/volume1/@appstore/python/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request

    method()

  File "/volume1/@appstore/plexconnect/share/PlexConnect/WebServer.py", line 182, in do_GET

    XML = XMLConverter.XML_PMS2aTV(PMSaddress, self.path + args, options)

  File "/volume1/@appstore/plexconnect/share/PlexConnect/XMLConverter.py", line 346, in XML_PMS2aTV

    PMS = PlexAPI.getXMLFromPMS(PMS_baseURL, path, options, authtoken=auth_token)

  File "/volume1/@appstore/plexconnect/share/PlexConnect/PlexAPI.py", line 318, in getXMLFromPMS

    response = urllib2.urlopen(request, timeout=10)

  File "/volume1/@appstore/python/lib/python2.7/urllib2.py", line 127, in urlopen

    return _opener.open(url, data, timeout)

  File "/volume1/@appstore/python/lib/python2.7/urllib2.py", line 396, in open

    protocol = req.get_type()

  File "/volume1/@appstore/python/lib/python2.7/urllib2.py", line 258, in get_type

    raise ValueError, "unknown url type: %s" % self.__original

ValueError: unknown url type: /webdefault/sample.php?status=404&from=user

----------------------------------------

 

[PlexConnect]

logpath = ../../var

loglevel = High 

enable_dnsserver = False 

ip_webserver = 0.0.0.0

prevent_atv_update = True

enable_plexconnect_autodetect = True

port_pms = 32400

port_webserver = 81

ip_plexconnect = 0.0.0.0

certfile = ../../etc/certificates/trailers.pem

ip_dnsmaster = 8.8.8.8

loglevel = Normal

ip_pms = 0.0.0.0

enable_plexgdm = True

port_ssl = 443

enable_webserver_ssl = True

port_dnsserver = 53

 

worked just fine in the past....

Could you give a couple more lines of the log - it should note which URL actually was triggered?

What Python version are you using? The timeout=10 is new in urllib2.open( ) call - added to python in 2.6.

Edit: Related?

http://forums.plexapp.com/index.php/topic/85747-working-plexconnect-broke-with-one-of-the-newer-commits/


20:33:05 PlexAPI: GDM: Servers discovered: 2
20:33:06 PlexAPI: Servers (local+MyPlex): 2
20:33:06 WebServer: serving .xml: /PlexConnect.xml
20:33:06 WebServer: serving /js/utils.js
20:33:06 WebServer: serving .xml: /webdefault/sample.php

Exception happened during processing of request from (‘192.168.0.9’, 57977)
Traceback (most recent call last):
File “/volume1/@appstore/python/lib/python2.7/SocketServer.py”, line 295, in _handle_request_noblock
self.process_request(request, client_address)
File “/volume1/@appstore/python/lib/python2.7/SocketServer.py”, line 321, in process_request
self.finish_request(request, client_address)
File “/volume1/@appstore/python/lib/python2.7/SocketServer.py”, line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File “/volume1/@appstore/python/lib/python2.7/SocketServer.py”, line 649, in init
self.handle()
File “/volume1/@appstore/python/lib/python2.7/BaseHTTPServer.py”, line 340, in handle
self.handle_one_request()
File “/volume1/@appstore/python/lib/python2.7/BaseHTTPServer.py”, line 328, in handle_one_request
method()
File “/volume1/@appstore/plexconnect/share/PlexConnect-new/WebServer.py”, line 182, in do_GET
XML = XMLConverter.XML_PMS2aTV(PMSaddress, self.path + args, options)
File “/volume1/@appstore/plexconnect/share/PlexConnect-new/XMLConverter.py”, line 346, in XML_PMS2aTV
PMS = PlexAPI.getXMLFromPMS(PMS_baseURL, path, options, authtoken=auth_token)
File “/volume1/@appstore/plexconnect/share/PlexConnect-new/PlexAPI.py”, line 318, in getXMLFromPMS
response = urllib2.urlopen(request, timeout=10)
File “/volume1/@appstore/python/lib/python2.7/urllib2.py”, line 127, in urlopen
return _opener.open(url, data, timeout)
File “/volume1/@appstore/python/lib/python2.7/urllib2.py”, line 396, in open
protocol = req.get_type()
File “/volume1/@appstore/python/lib/python2.7/urllib2.py”, line 258, in get_type
raise ValueError, “unknown url type: %s” % self.__original
ValueError: unknown url type: /webdefault/sample.php?status=404&from=user

Python is 2.7.5 on Synology

could be very well releated, this is since a few days and I also use ghost via apache, now I'm back at a working version of around half october. and channels and settings indeed load just fine...

--- deleted---

yep

   AllowEncodedSlashes NoDecode
   ProxyPass / http://xxxxx  nocanon

 
does solve it. Is this something I should add the the Synology installer? Or will you work around it?

Don't know... what would recommend? I kind of like the "//" as an indication of a server family following - but won't argue if anybody gives another better identifier to begin with.

I thought about the "@" as well... it is at least somewhat supported (for EMail addresses), though I don't know if it fits into an URL. Would need some research to find out.

I would prefer someting that is compatible across systems? Why not a kind of ReST api
http://www.restapitutorial.com


It is created to accss resources in a well defined manner, and a plex server is a resource isn’t it?

>>and a plex server is a resource isn't it?

Sure it is... this "issue" is only between aTV and PlexConnect. PMS would never get this address.

>>ReST api / link

A lot to read, man. :-)

Make a proposal... might be quicker that way.

Uh. Wait. That issue is caused by an earlier change already...

Originally we only had the added to the "path" - like /PMS(192.168.x.x:32400)/library/section.

With the CloudSync feature we happened to add the scheme as well - you now would see /PMS(http://192.168.x.x:32400)/... which already shows the two '//' in an urlencoded fashion.

Additionally we now have added /PMS(//local)/... to get the route to every local PMS as well as /PMS(//myplex)/... for the remote ones.

I guess I still can rewrite it to only ship the in first case, and add another identifier for the second case. I just have to remember, that it needs modification on other areas as well...

Could you please check on your side, if things would work as before when adapting PlexConnect.xml? Just change the '//' in //local as well as // myplex to their encoded value (two times '%2F'?)...

Thanks!

I'll try to have a look at it this evening. 

I do not use CloudSync?

For the testing, we only need to know how your NAS works with the encoded //...

Edit:

Hm. Doublechecked:

In the XML delivered to aTV the '//' is already encoded/quoted:

http://atv.plexconnect/PMS(%2F%2Flocal)/library/sections

Why does a NAS/Apache fall over that?

Nope encoded as %2F does not work. I have to add  

   AllowEncodedSlashes NoDecode
   ProxyPass / http://xxxxx  nocanon

 
to the vhost to make it work. I just add it to the Synology Installer and case closed?

Yeah... we can do that.

The same issue on Apache - I don't recall - do you know if we have a workaround there as well?

Yeah... we can do that.
The same issue on Apache - I don't recall - do you know if we have a workaround there as well?


This is an apache fix, the nas is running apache. I have this fix from the thread you pointed me to innitialy

Ah, I see. To much new tech... :-)

Thanks!

One last note. When this happen shouldn’t the atv show an error i.s.o. Just keeping the spinner alive?

A dedicated error message would be great. Unfortunately this "request and get response" is all handled within iOS - there is not much we can do about it, I guess.

My Centos 6 box is running Apache 2.2.15. I only have the option of AllowEncodedSlashes On|Off since NoDecode was added in 2.2.18. I believe you will be leaving anyone with a RHEL variant out if you use this fix. I would prefer not to leave it ‘On’ after reading the security warning at apache.org, even though I don’t think it possible for this virtual host to ever be accessed outside of my LAN. However, it may not be related, but plexconnect will get past ‘Accessing Trailers’ but shows no Libraries or Channels and will only detect one of my LAN servers with “AllowEncodedSlashes On” set.