PlexConnect now requiring username/password. I can't figure out what's up

I just tried using my ATV3 today after about 2 weeks of not using it, and when I select trailers, I’m prompted with a username/password screen that looks like an Apple standard one, but with a weird template (screenshot attached).

I updated to plex 0.9.16.6 a few days ago. Not sure if that’s the culprit. The system was working a few weeks ago. I’ve tried restarting pms and plexconnect (which both run on the same machine, an Ubuntu box), as well as the ATV3, but no luck.

From looking at the PlexConnect log, it is definitely intercepting at least the DNS requests. I’ve pasted the log below as well.

Has anyone seen this before? I haven’t found anything on the web about this.

thanks

11:51:20 WebServer: http request header:
Host: trailers.apple.com
X-Real-IP: 192.168.1.65
X-Forwarded-For: 192.168.1.65
X-Forwarded-Proto: https
Connection: close
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en;q=0.9
Cookie: s_vi=[CS]v1|2A92267A05012BA3-400001310014FDC4[CE]
X-Apple-TV-Resolution: 1080
X-Apple-TV-Version: 7.2.1
User-Agent: AppleTV/7.2.1 iOS/8.4.1 AppleTV/7.2.1 model/AppleTV3,2 build/12H523 (3; dt:12)

11:51:20 WebServer: http request path:
/appletv/us/js/application.js
11:51:20 Localize: aTVLanguage: en
11:51:20 WebServer: pms address:

11:51:20 WebServer: cleaned path:
/appletv/us/js/application.js
11:51:20 WebServer: PlexConnect options:
{'aTVScreenResolution': '1080', 'aTVFirmwareVersion': '7.2.1', 'aTVLanguage': 'en', 'aTVAddress': '192.168.1.65'}
11:51:20 WebServer: additional arguments:

11:51:20 WebServer: serving /js/application.js
11:51:20 Settings: getsetting allow_gzip_atv=False

OK I’ve discovered some more details but still don’t know what’s going on.

  1. I tried removing the profile from my AppleTV, thinking it might be expired. When I tried to re-add it, I get “Unable to add profile”. “An error occurred while adding the profile [109].”
  2. If I configure my Mac to use PlexConnect as the DNS server and then try to fetch http://trailers.apple.com/trailers.cer, I get only “401 Unauthorized”, from both Safari and Chrome
  3. If I add the profile by visiting http://192.168.1.13/trailers.cer it adds correctly.
  4. After that, if I go to the Trailers app, I get the same weird login form.
  5. I am running both PMS and PlexConnect on an ubuntu64 machine at 192.168.1.13

I can confirm that when I select Trailers, I see log activity. The one weird thing I see is the log line item about “WebServer: pms address:” being blank. Could that be it?

Anyone have any ideas? Thanks.

Honestly, I have never seen this myself…

The WebServer/PMS Address being blank should not be an issue - in the beginning you won’t have a PMS selected to talk to. Lateron, once you access you media, you should see this line filled with meaningful data. But for now you seem to have other issues. :smiley:

Your screenshot really looks like sort of a template… has anybody else seen this?

Thanks Baa. Gotta say you seem to have all the answers, so I’m a bit sad. :slight_smile:

It seems to me this is what AppleTV does when it gets an auth request.

If you hit your plexconnect server with a browser by setting DNS of a computer to point to plexconnect, and then attempt to hit http://trailers.apple.com, do you get back valid data? I get back a fun 403 error page. I’d assume you must know what the client/server interchange should look like? I’m happy to experiment from the command line with telnet or curl to see if I can get a valid page served up by plexconnect to my Mac.

My error that I see with Safari when I point my DNS to plexconnect:

Error response

Error code 403. Message: Not Serving Client 192.168.1.13. Error code explanation: 403 = Request forbidden -- authorization will not help.

(edited to clarify that this is likely an auth request form).

OK I see one extra thing in my log:

20:30:28 WebServer: cleaned path:
/appletv/us/js/application.js
20:30:28 WebServer: PlexConnect options:
{'aTVScreenResolution': '1080', 'aTVFirmwareVersion': '7.2.1', 'aTVLanguage': 'en', 'aTVAddress': '192.168.1.65'}
20:30:28 WebServer: additional arguments:

20:30:28 WebServer: serving /js/application.js
20:30:28 Settings: getsetting allow_gzip_atv=False
20:30:29 DNSServer: DNS request received!
20:30:29 DNSServer: Source: ('192.168.1.65', 54651)
20:30:29 DNSServer: Domain: e5153.a.akamaiedge.net
20:30:29 DNSServer: ***forward request
20:30:29 DNSServer: -> DNS response from higher level

Note that the last 3 lines point to fetching something from Akamai. Maybe there’s a cached element, or something on the PlexConnect home page that’s requiring authentication? I tried clearing the ATV cache (apparently you hold “down” and “menu” buttons on the remote until the ATV starts blinking rapidly and then let go of one button and it’ll reset), but no joy.

Error response 403

That one is fine - PlexConnect only “talks to” an AppleTV. Or an device stating it is an AppleTV. It essentially checks for exactly that string/name in the user agent.

akamai

AFAIK that’s the data distribution service Apple is using to provide their content - iTunes, shows, movies. ATV is checking on those IPs quite often. From my point of view: nothing to worry - but also nothing that would help here.

Are you running the latest PlexConnect version? Could you double check that the files are (content wise) the same as on github? Did you try to restart your PlexConnect/host and/or the aTV? Not sure why this would help, though…

Thanks Baa. I can confirm I’m running the latest PlexConnect (cfd51deffb…), plexmediaserver 0.9.16.6.1993-5089475, I deleted the .pyc files just in case, and I just rebooted the host that runs them both. No change.

I’m going to try to find some points to add debug traces of the back-and-forth between ATV and PlexConnect in WebServer.py and see what I can see.

(deleted obsolete message)

UGH!! I figured out what’s wrong and have it now fixed.

In short, I changed part of my nginx config on that server since it also hosts Plex/web and one other service. I set plex + my other service to listen to address 192.168.1.13:80, and only had plexconnect set to listen to :80. All three servers had a “server_name” directive, but I guess nginx saw the more specific addresses and preferred to redirect to one of the other internal services (likely plex/web), which was serving up the 401 or similar form that caused ATV to fail.

I eventually figured this out by shutting off other services on my nginx and seeing that I was able to get it to work again.

Thanks Baa for your help!

Interesting explanation - though I still don’t understand why aTV displayed the shown mask…
Tststs.