LukeChannings / moviematch

MovieMatch for Plex
Other
405 stars 24 forks source link

Loading Movies #26

Closed dj-curls closed 3 years ago

dj-curls commented 3 years ago

Hi,

I'm running into an issue running this, I get "Loading movies" in the browser, and nothing happens.

Here's the logs:

oliver@XXX:~$ sudo docker run -it -e PLEX_URL=https://XXX:32400 -e PLEX_TOKEN=XXX -e LIBRARY_FILTER=Movies,Films -e LOG_LEVEL=DEBUG -p 8000:8000 lukechannings/moviematch
DEBUG Log level DEBUG
INFO Listening on port 8000
DEBUG serveFile(/app/public/index.html)
DEBUG serveFile(/app/public/style.css)
DEBUG serveFile(/app/public/js/main.js)
DEBUG serveFile(/app/public/assets/logo.svg)
DEBUG serveFile(/app/public/assets/background-grain.png)
DEBUG serveFile(/app/public/assets/background.svg)
DEBUG serveFile(/app/public/js/MovieMatchAPI.js)
DEBUG serveFile(/app/public/js/CardView.js)
DEBUG serveFile(/app/public/js/MatchesView.js)
DEBUG serveFile(/app/public/assets/icons/favicon-32x32.png)
INFO Got a login: {"name":"Oliver","roomCode":"BSBL"}
DEBUG New session created. Active session ids are: BSBL
DEBUG New user Oliver logged in
DEBUG Oliver asked for the next batch of movies
LukeChannings commented 3 years ago

Those logs look normal to me.

What browser are you using? Can you check if there are any errors in the JavaScript Console?

If Chrome, you can open it with Cmd+Alt+J in macOS or ctrl+shift+j on Windows.

lbarnett83 commented 3 years ago

I'm running into the same issue. Nothing in the JS console either..

dj-curls commented 3 years ago

Chrome on windows.

As the other commenter has said, nothing in the javascript console window. No pending network requests, and no messages sent over websockets asking for movies either.

LukeChannings commented 3 years ago

Can one of you send a screenshot of the WebSocket messages you have? It sounds like you never receive a batch message.

In normal circumstances the message should look like this:

Screenshot 2021-01-06 at 07 24 35
dj-curls commented 3 years ago

Yep looks like the batch message never arrives.

image

LukeChannings commented 3 years ago

Hey, just pushed v1.5.0 with some logging that might shed light on where it's falling over. Can you update and send me the logs?

lbarnett83 commented 3 years ago

I'm seeing the same behaviour. As far as my docker output, nothing new in the debug log, and nothing showing up in the console Screenshot_2021-01-06_20-30-00 Screenshot_2021-01-06_20-30-16

LukeChannings commented 3 years ago

Hey, I deleted your comment because you included your plex token. Can you re-upload with that blurred out?

lbarnett83 commented 3 years ago

that was dumb of me, and thanks for catching it coming right up

lbarnett83 commented 3 years ago

Screenshot_2021-01-06_20-30-26fixed

LukeChannings commented 3 years ago

Hmm, ok, so the reason the batch is never sent is that the request to your Plex server timed out. I think the default timeout is 300 seconds (5 minutes), which would explain why it appears that nothing is happening.

Can you confirm that the container can route to your Plex server?

lbarnett83 commented 3 years ago

A revers proxy shouldn't be causing that, right? But, a lack of hairpin NAT might. Gonna update the server from FQDN to IP in the container.

lbarnett83 commented 3 years ago

Got it. The router in front of my unraid server doesn't support NAT loopback. When I changed from my FQDN to the http://IP:PORT format instead, I got this: Screenshot_2021-01-06_20-52-56

LukeChannings commented 3 years ago

Yep - that looks like it's working!

lbarnett83 commented 3 years ago

Confirmed with the page actually working. Now I just have to find time to replace the crappy ISP router, with my Edgerouter. Ironically, I work for the ISP that supplies the "crappy" router :smile:

LukeChannings commented 3 years ago

@dj-curls, can you confirm that the issue was the same for you?

LukeChannings commented 3 years ago

I'm going to assume it is the same issue. Feel free to re-open if you think it's something unrelated.

dj-curls commented 3 years ago

It was the same thing for me, however my server is hosted "in the cloud"

I had to put this container in the same docker network as plex, and connect to the internal docker IP.

No combination of correct external IP / DNS names worked.

LukeChannings commented 3 years ago

It sounds like a networking issue specific to your stack - MovieMatch / Deno don't do anything special with DNS or routing, so if the external DNS isn't accessible to MovieMatch it won't be accessible to any containers in the same configuration.

dj-curls commented 3 years ago

Not 100% sure how to check accessibility from inside the container, but the host has access to itself

curl -I http://DNSNAME:32400/library/sections?X-Plex-Token=XXX
HTTP/1.1 200 OK
X-Plex-Protocol: 1.0
Content-Type: text/xml;charset=utf-8
Content-Length: 1808
Connection: Keep-Alive
Keep-Alive: timeout=20
Cache-Control: no-cache
Date: Sat, 09 Jan 2021 13:41:15 GMT

So safe to assume it's something in the container / container configuration?

LukeChannings commented 3 years ago

If you're running Docker, you could try:

λ docker run -it --rm hayd/alpine-deno:1.6.2 -- /bin/sh
/ # apk update && apk add curl
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
v3.12.3-47-g3428e040de [http://dl-cdn.alpinelinux.org/alpine/v3.12/main]
v3.12.3-48-gea3fd89439 [http://dl-cdn.alpinelinux.org/alpine/v3.12/community]
OK: 12756 distinct packages available
(1/4) Installing ca-certificates (20191127-r4)
(2/4) Installing nghttp2-libs (1.41.0-r0)
(3/4) Installing libcurl (7.69.1-r3)
(4/4) Installing curl (7.69.1-r3)
Executing busybox-1.31.1-r16.trigger
Executing ca-certificates-20191127-r4.trigger
Executing glibc-bin-2.32-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

OK: 19 MiB in 21 packages
/ # curl -I http://DNSNAME:32400/library/sections?X-Plex-Token=XXX

Update curl -vv -I http://DNSNAME:32400/library/sections?X-Plex-Token=XXX to be your URI. If that resolves in might be something to do with MovieMatch, otherwise probably a Docker issue.

dj-curls commented 3 years ago

So that alpine container doesn't contain curl.

I ran this:

sudo docker run -it --rm curlimages/curl -L -v http://DNSNAME:32400/library/sections?X-Plex-Token=XXX
* Trying XXX:32400...
* connect to XXX port 32400 failed: Operation timed out
* Failed to connect to XXX port 32400: Operation timed out
* Closing connection 0
curl: (28) Failed to connect to direct.aande.uk port 32400: Operation timed out

Proves that docker containers don't like loopback on dns name or external ip. I copied and pasted the docker config from the readme. Does yours work or do you provide the internal ip of the docker container?

dj-curls commented 3 years ago

Oh I missed your commands on the next line down to add curl, doh!

lbarnett83 commented 3 years ago

Dj, I'm assuming you are running your domain via a reverse proxy?

dj-curls commented 3 years ago

Yep with traefik.

I did try with IP external address too with the same results

lbarnett83 commented 3 years ago

Wait, when you run the movie match docker, pointing towards Plex with with WAN IP:PORT instead of domain, it STILL doesn't work, but LAN IP:PORT does work?

dj-curls commented 3 years ago

Yep, that's exactly what's happening, with LAN being a docker internal network, and WAN IP being the IP of the NIC connected to the wider network.

clarklab commented 3 years ago

I've got the "Loading movies..." screen and not sure what else to try. To be honest, I'm surprised I even got it installed and running. I took a peek through the rest of this thread, but most of it was over my head. Is there a "for dummies" summary that might help me?

I've got it running via docker compose on a QNAP NAS that's running the Plex server itself. And I'm bad at this.

lbarnett83 commented 3 years ago

What does the compose file look like? Blur out the token and any outside IP addresses.

On Mon., Jan. 18, 2021, 19:53 Clark Wimberly, notifications@github.com wrote:

I've got the "Loading movies..." screen and not sure what else to try. To be honest, I'm surprised I even got it installed and running. I took a peek through the rest of this thread, but most of it was over my head. Is there a "for dummies" summary that might help me?

I've got it running via docker compose on a QNAP NAS that's running the Plex server itself. And I'm bad at this.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LukeChannings/moviematch/issues/26#issuecomment-762567784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEK355AGQH3IYXRN55QAALS2TX2VANCNFSM4VWOHVKQ .

clarklab commented 3 years ago
Pasted_Image_1_18_21__9_02_PM
clarklab commented 3 years ago

for the PLEX_URL, should I be using the IP version or the plex.tv version?

when I view the terminal for the container, I see rooms being made, and no errors:

INFO Got a login: {"name":"Clark","roomCode":"XXXX"}

lbarnett83 commented 3 years ago

Ideally, use the IP of the machine hosting the Plex server, plus the port. So if your QNAP is on 192.168.1.200, then the url should look like http://192.168.1.290:32400

clarklab commented 3 years ago

ok, correct, got that

the IP in my Plex URL and the IP that MovieMatch are running on are the same

lbarnett83 commented 3 years ago

And it's still not working?

clarklab commented 3 years ago

Still not working. Stuck on 'Loading movies..."

I do have close to 2,000 movies. Think it could be a library size thing?

lbarnett83 commented 3 years ago

Unlikely. My library is ~1600 and loads almost instantly. This feels like somehow the movie match container isn't seeing the Plex container.

clarklab commented 3 years ago

That's what I'm thinking, I just don't know enough how to troubleshoot what the issue might be.

clarklab commented 3 years ago

Watching the Network tab, the websocket stays "pending" and never seems to resolve

image

LukeChannings commented 3 years ago

The container itself looks fine, if it was a Plex <-> MovieMatch communication issue the container would crash after 5 minutes.

Are you going via a reverse proxy? Make sure the reverse proxy can do the WebSoxket upgrade.

There is documentation for a few different HTTP servers here that might help.

LukeChannings commented 3 years ago

This could also be relevant - https://github.com/LukeChannings/moviematch/issues/16#issuecomment-742894185

2fst4u commented 3 years ago

I'm having this issue using only my Plex server's internal IP address. No reverse proxy (yet).

My moviematch and Plex are on different lan segments, but I've confirmed my firewall isn't blocking anything.

It just sits there on "loading movies".

Edit: nah don't mind me, I'm an absolute idiot. I actually work in networking but the good old fat-finger got the better of me. My IP address of the Plex server was "192.158.x.x" instead of 192.168.

I'll leave this here for posterity in case anyone else has this issue and the logs don't make it clear why it's not working for them.

LukeChannings commented 3 years ago

@2fst4u these things happen 😄. Logging is much more verbose in 2.0 if a provider is unavailable.