HTTP Errors - plex.tv Not Resolving

Please! That’d be awesome – I was just looking at the Docker Compose stuff in the GitHub Repo like :face_with_monocle:

This is my script which creates the container if it doesn’t exist.
Otherwise, it removes the container & image (the data is external)
and pulls the new image and gens the updated container.

Options at the bottom to set autostart and start.

[chuck@lizum ~/docker.502]$ cat dockerplex
sudo docker stop plex
sudo docker rm plex

# Remove old image if exists
Image="$(sudo docker images | grep -i plex | awk '{print $3}')"

if [ "$Image" != "" ]; then

  sudo docker stop plex
  sudo docker stop plex
  sudo docker rm plex
  sudo docker rmi -f $Image
fi


sudo docker run \
-d \
--name plex \
--network=host \
-e PLEX_CLAIM="claim-qrrDP584AkBPeCQtsiyR" \
-e TZ="EST" \
-e LANG="en_US.UTF-8" \
-e PLEX_UID=1001 \
-e PLEX_GID=1001 \
-e PUID=1001 \
-e PGID=1001 \
-h dockerplex \
-v /dockerplex:/config \
-v /dockerplex/tmp:/tmp \
-v /dockerplex/transcode:/transcode \
-v /nas:/data \
--device=/dev/dri:/dev/dri \
plexinc/pms-docker:plexpass

#docker start plex
#docker update --restart=unless-stopped plex
[chuck@lizum ~/docker.503]$ 

Thanks for this! So based on your script, looking at the log files at /dockerplex/Library/Application Support/Plex Media Server/Logs I observe the same records in the Log that I have on the local host:

enusbaum@xxxxxx:/dockerplex/Library/Application Support/Plex Media Server/Logs$ cat 'Plex Media Server.1.log'

May 26, 2021 19:25:50.924 [0x7fdef714db38] WARN - HTTP error requesting GET https://plex.tv/api/v2/release_channels?X-Plex-Token=xxxxxxxxxxxxxxxxxxxxe host name) (Could not resolve host: plex.tv)
...
May 26, 2021 19:25:55.934 [0x7fdef714db38] WARN - HTTP error requesting GET https://plex.tv/api/v2/features?X-Plex-Token=xxxxxxxxxxxxxxxxxxxxe host name) (Could not resolve host: plex.tv)
...
May 26, 2021 19:26:00.941 [0x7fdef714db38] WARN - HTTP error requesting POST https://plex.tv/devices/7d18bf6cccabc1a02e414da666ff8c5d9b92beab/unclaimed?Connection[][uri]=http://192.168.7.91:32400 (6, Couldn't resolve host name) (Could not resolve host: plex.tv)

BINGO!!

Now you can do docker exec -it plex /bin./sh (think that’s right)
to give you a command line for using curl

enusbaum@xxxx:~$ sudo docker exec -it plex bash
root@dockerplex:/# curl plex.tv
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
root@dockerplex:/

curl from cli within the docker container appears to work fine.

that’s ok…

now execute the curl options to set libcurl

start PMS and see what happens.

You should be able to break it too :smiling_imp:

now execute the curl options to set libcurl

I’m sorry, I’m not entirely sure what you mean by this. Aren’t libcurl options set in the codebase at compile time?

There’s a way to do this to set the resolver options … which will then last until the container terminates.

That’s what the CURL should do.

Doing it in the process space – valid until the process terminates.

same concept

https://everything.curl.dev/cmdline/configfile

curl --ipv6 and curl --ipv4 are examples.

If you get errors with V6 but it’s ok with v4 (expected) then we are onto it

root@dockerplex:/# curl --ipv4 https://plex.tv
<html><body>You are being <a href="https://www.plex.tv/">redirected</a>.</body></html>

root@dockerplex:/# curl --ipv6 https://plex.tv
curl: (6) Could not resolve host: plex.tv

root@dockerplex:/#

The error here tells me that libcurl in Plex is, somehow, for some reason, trying to resolve the ipv6 address for plex.tv.

That’s my take on it too. it seems to be trying V6, not getting resolution (AAAA) and then failing to fall back to V4

I think libcurl is just bombing after the AAAA resolution fails.

I would expect it to revert to the ipv4 address, but in this case it’s not and erroring out with resolution exceptions. Perhaps a regression?

Setting curl_easy_setopt to only resolve ipv4 for libcurl could fix this :man_shrugging:

The libcurl in use now is the new one with the new toolchain.
The resolution behavior is different than traditional glibc-libcurl.

Gotcha!

So as far as getting my Plex server back up and operational – do I need to wait for a patch or can I “downgrade” to a previous release?

Back down the code. You’ll be OK. 1.22.3 will do just fine and not hurt anything

Can confirm, downgraded from 1.23.2.4584-bdefd2026 to 1.22.3.4392-d7c624def and everything is working as intended.

For anyone else that needs it:
https://downloads.plex.tv/plex-media-server-new/1.22.3.4392-d7c624def/debian/plexmediaserver_1.22.3.4392-d7c624def_amd64.deb

Guess I’ll wait for a fix until updating! Appreciate all the help!

I don’t know if dig is part of the container, but I believe the command bellow can help you guys to find where the problem is when it occurs:

dig +trace plex.tv

We found it ! :slight_smile:

dig plex.tv AAAA

If you get NOERROR , you are not impacted.
If you get SERVFAIL, bingo.

Seems to be isolated to eero devices.

Can confirm, I’m using Eero Mesh at home! :+1:

Please report to eero.

They should not return SERVFAIL in a ‘not found’ situation for AAAA records.

1 Like

Well – this might be because I have IPv6 turned off on the Eero devices. So technically the response isn’t incorrect, the Gateway doesn’t support IPv6.

Console curl and wget don’t seem to have this issue, I feel like it’s something that could be addressed in the new libcurl implementation in Plex.

Otherwise a requirement to run Plex now should be “Network must support IPv6”?