Have to restart aTV3 once a day(ish)

plexconnect

#1

If I dont restart my aTV once a day it seems to get stuck on "looking for trailers...." or the Plex servers show up but without any pictures...

When it hangs...

Nov 10 13:32:21 harbor docker[5352]: Nov 10,2017 12:32:20 PlexAPI: ***
Nov 10 13:32:21 harbor docker[5352]: Nov 10,2017 12:32:21 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://10-0-1-200.30f2d7156077499b824b147b15783545.plex.direct:32400
Nov 10 13:32:21 harbor docker[5352]: Nov 10,2017 12:32:21 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://172-17-0-1.30f2d7156077499b824b147b15783545.plex.direct:32400
Nov 10 13:32:21 harbor docker[5352]: Nov 10,2017 12:32:21 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://10-0-3-1.30f2d7156077499b824b147b15783545.plex.direct:32400
Nov 10 13:32:21 harbor docker[5352]: Nov 10,2017 12:32:21 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://84-213-72-68.30f2d7156077499b824b147b15783545.plex.direct:19292
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:21 PlexAPI: poke kids (8e7bff9e6cc920826266334814dce9da0dabff5d) at https://10-0-1-201.b160a91575124c0da87e4b2efe8b6fSource: ('10.0.1.40', 57461)
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:29:43 DNSServer: Domain: trailers.apple.com
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:29:43 DNSServer: ***intercept request
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:29:43 DNSServer: -> DNS response: 10.0.1.200
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:20 DNSServer: DNS request received!
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:20 DNSServer: Source: ('10.0.1.40', 52659)
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:20 DNSServer: Domain: trailers.apple.com
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:20 DNSServer: ***intercept request
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:20 DNSServer: -> DNS response: 10.0.1.200
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:43 DNSServer: DNS request received!
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:43 DNSServer: Source: ('10.0.1.40', 49415)
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:43 DNSServer: Domain: itunes.apple.com
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:43 DNSServer: ***forward request
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:43 DNSServer: -> DNS response from higher level
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:43 DNSServer: DNS request received!
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:43 DNSServer: Source: ('10.0.1.40', 53161)
Nov 10 20:11:57 harbor docker[5352]: Nov 10,2017 12:32:43 DNSServer: Domain: 10-0-1-201.b160a91575124c0da87e4b2efe8b6f13.plex.direct`enter code here

After I restart aTV

Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:14:55 DNSS13.plex.direct:32400
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 12:32:21 PlexAPI: poke kids (8e7bff9e6cc920826266334814dce9da0dabff5d) at https://84-213-72-68.b160a91575124c0da87e4b2efe8b6f13.plex.direct:26732
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 12:32:21 PlexAPI: response kids (8e7bff9e6cc920826266334814dce9da0dabff5d) at https://10-0-1-201.b160a91575124c0da87e4b2efe8b6f13.plex.direct:32400
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 12:32:21 PlexAPI: response Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://10-0-3-1.30f2d7156077499b824b147b15783545.plex.direct:32400
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 12:32:21 PlexAPI: Servers (local, plex.tv, MyPlex): 3
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 12:32:42 WebServer: serving .xml: /library/sections/2/recentlyAdded
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 WebServer: serving .xml: /
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: ***
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: poke plex.tv - request Plex Media Server list
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: ***
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://10-0-1-200.30f2d7156077499b824b147b15783545.plex.direct:32400
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://172-17-0-1.30f2d7156077499b824b147b15783545.plex.direct:32400
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://10-0-3-1.30f2d7156077499b824b147b15783545.plex.direct:32400
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://84-213-72-68.30f2d7156077499b824b147b15783545.plex.direct:19292
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: poke kids (8e7bff9e6cc920826266334814dce9da0dabff5d) at https://10-0-1-201.b160a91575124c0da87e4b2efe8b6f13.plex.direct:32400
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: poke kids (8e7bff9e6cc920826266334814dce9da0dabff5d) at https://84-213-72-68.b160a91575124c0da87e4b2efe8b6f13.plex.direct:26732
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: response Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://10-0-3-1.30f2d7156077499b824b147b15783545.plex.direct:32400
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: response kids (8e7bff9e6cc920826266334814dce9da0dabff5d) at https://84-213-72-68.b160a91575124c0da87e4b2efe8b6f13.plex.direct:26732
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 PlexAPI: Servers (local, plex.tv, MyPlex): 3
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:55 WebServer: serving .xml: /PlexConnect.xml
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:56 WebServer: serving /js/utils.js
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:56 WebServer: serving /js/handlePlexConnectNavbar.js
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:56 WebServer: serving .xml: /library/sections
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:56 WebServer: serving /js/utils.js
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:56 WebServer: serving /js/sectionHoldSelect.js
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:11:57 WebServer: serving .xml: /library/sections/1/recentlyAdded
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:12:00 WebServer: serving .xml: /library/sections/2/recentlyAdded
Nov 10 20:15:01 harbor docker[5352]: Nov 10,2017 19:15:00 WebServer: serving .xml: /

It seems my main plex (Harbor) does not aswer pokes, this is also my newest plex running in a Docker. Could the different versions on two different servers make a difference? Is it docker or does anyone have any experience with this.


#2

Try increase the timeout value in PlexAPI.py line 432 (where it reads response = urllib2.urlopen(request, timeout=20) increase 20 to 60)

In my short experience with your PlexConnect version I found it slower than running PlexConnect as a service, so perhaps you need to increase the timeout parameter.


#3

Maybe... I will give that a try and see if it helps. Its a shame it takes day(s) for the container to freeze. Or freeze is not the right word, it still serves DNS and netflix / other services work.

I am also thinking it might be missing something. Is there any other dependencies you know of other than python? Could be a service, a script, a library, anything really...

Seems to work fine now for days when running on ubuntu native.

Thanks for keeping the project alive, let me know if I can help.


#4

PlexConnect launches two separate services, DNSServer.py running DNS and WebServer.py running the application that interfaces with PMS and builds the dialogs seen in the ATV. When you play a media file it's all between a javascript loaded into the ATV and PMS directly (if you stop PlexConnect files being played do not stop).

PlexAPI.py is not used by DNSServer.py. In fact you can use any other DNS service to intercept trailers, you are not obliged to use PlexConnect for that (there is one PlexConnect user running 50+ ATV's that could not use PlexConnect's DNS service for performance reasons, so he's just using the WebServer part).


#5

Its been over 48 hours and it has not hanged since.

That being said, it hanged when I ran PlexConnect natively too.. Any chance you will implement the timeout increase? If not Ill have to fork the repo for the Docker Image.


#6

According to @baa (with whom I've discussed this matter some years ago) increasing the timeout value would also increase the time to discover Plex servers and this may be relevant to who has many "friends". It should not be difficult to create a new parameter in Settings.cfg so that different timeout values could be specified, but in principle I'm not welcoming the idea of increasing the timeout for all users. Furthermore wrong values could lead to unpredictable results.

In summary, for the time being forking the repo seems to be your best option.


#7

I understand.

I will try and use sed to change the value after the "pull" in the init script for the image. I think that is a better solution. After all, Its a workaround specifically for Docker.

But, 48 hours is not long enough, but it clearly seems stable.


#8

Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:02 PlexAPI: ***
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:02 PlexAPI: poke plex.tv - request Plex Media Server list
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:02 PlexAPI: ***
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Elena (5cc3319b7417d13524c7cfad35bf53ba3f9ae323) at https://10-0-1-202.7483c4af388f47c4af296a61ec7b8919.pl
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Elena (5cc3319b7417d13524c7cfad35bf53ba3f9ae323) at https://84-213-72-68.7483c4af388f47c4af296a61ec7b8919.
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://10-0-1-200.30f2d7156077499b824b147b15783545.p
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://172-17-0-1.30f2d7156077499b824b147b15783545.p
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://10-0-3-1.30f2d7156077499b824b147b15783545.ple
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://84-213-72-68.30f2d7156077499b824b147b15783545
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: response Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://172-17-0-1.30f2d7156077499b824b147b157835
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: response Elena (5cc3319b7417d13524c7cfad35bf53ba3f9ae323) at https://84-213-72-68.7483c4af388f47c4af296a61ec7b8
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: Servers (local, plex.tv, MyPlex): 3
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: No Response from Plex Media Server
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: We failed to reach a server. Reason: [Errno 111] Connection refused
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: Traceback:
Nov 17 20:43:11 harbor docker[8187]: Traceback (most recent call last):
Nov 17 20:43:11 harbor docker[8187]: File "/PlexConnect/PlexAPI.py", line 432, in getXMLFromPMS
Nov 17 20:43:11 harbor docker[8187]: response = urllib2.urlopen(request, timeout=60)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
Nov 17 20:43:11 harbor docker[8187]: return opener.open(url, data, timeout)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 429, in open
Nov 17 20:43:11 harbor docker[8187]: response = self._open(req, data)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 447, in _open
Nov 17 20:43:11 harbor docker[8187]: '_open', req)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
Nov 17 20:43:11 harbor docker[8187]: result = func(args)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 1241, in https_open
Nov 17 20:43:11 harbor docker[8187]: context=self._context)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
Nov 17 20:43:11 harbor docker[8187]: raise URLError(err)
Nov 17 20:43:11 harbor docker[8187]: URLError:
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:02 PlexAPI: *
*
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:02 PlexAPI: poke plex.tv - request Plex Media Server list
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:02 PlexAPI: ***
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Elena (5cc3319b7417d13524c7cfad35bf53ba3f9ae323) at https://10-0-1-202.7483c4af388f47c4af296a61ec7b8919.pl
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Elena (5cc3319b7417d13524c7cfad35bf53ba3f9ae323) at https://84-213-72-68.7483c4af388f47c4af296a61ec7b8919.
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://10-0-1-200.30f2d7156077499b824b147b15783545.p
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://172-17-0-1.30f2d7156077499b824b147b15783545.p
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://10-0-3-1.30f2d7156077499b824b147b15783545.ple
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: poke Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://84-213-72-68.30f2d7156077499b824b147b15783545
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: response Harbor (62413ee82c5807af0628354295d30b789e46e470) at https://172-17-0-1.30f2d7156077499b824b147b157835
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: response Elena (5cc3319b7417d13524c7cfad35bf53ba3f9ae323) at https://84-213-72-68.7483c4af388f47c4af296a61ec7b8
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: Servers (local, plex.tv, MyPlex): 3
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: No Response from Plex Media Server
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: We failed to reach a server. Reason: [Errno 111] Connection refused
Nov 17 20:43:11 harbor docker[8187]: Nov 17,2017 19:43:03 PlexAPI: Traceback:
Nov 17 20:43:11 harbor docker[8187]: Traceback (most recent call last):
Nov 17 20:43:11 harbor docker[8187]: File "/PlexConnect/PlexAPI.py", line 432, in getXMLFromPMS
Nov 17 20:43:11 harbor docker[8187]: response = urllib2.urlopen(request, timeout=60)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
Nov 17 20:43:11 harbor docker[8187]: return opener.open(url, data, timeout)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 429, in open
Nov 17 20:43:11 harbor docker[8187]: response = self._open(req, data)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 447, in _open
Nov 17 20:43:11 harbor docker[8187]: '_open', req)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
Nov 17 20:43:11 harbor docker[8187]: result = func(*args)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 1241, in https_open
Nov 17 20:43:11 harbor docker[8187]: context=self._context)
Nov 17 20:43:11 harbor docker[8187]: File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
Nov 17 20:43:11 harbor docker[8187]: raise URLError(err)
Nov 17 20:43:11 harbor docker[8187]: URLError:

I think you are on to something, but I still have the same issue...


#9

The issue was with my router.


#10

Can you share with us ?


#11

There was an issue in the firmware which paused/cut packet transfers when I had several IP's running on the same MAC (address), using macvlan.

My theory is a logfile that passed it's given size caused havoc with other components as it happened after a certain time....
As the Routers are mostly proprietary I have no way of getting in ;)

It was way above my skill level, so I just demonstrated and got my self a new (different) router from the same shop.

EDIT:
Resetting my router fixed it every time.
My router is also my switch, trying a pure Cisco (As it did not occur then) switch got me on to the problem. Then back to the router and a packetsniffer and so on.