Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error trying to connect: tcp connect error: Connection refused (os error 111) [Bug] #51

Closed
TiboGabriels opened this issue Feb 22, 2021 · 20 comments
Labels
bug Something isn't working

Comments

@TiboGabriels
Copy link

TiboGabriels commented Feb 22, 2021

Describe the bug
Container stops with exit code 1, gives this log:

INFO Listening on port 8080

error: Uncaught (in promise) TypeError: error sending request for url (https://:32400/library/sections?X-Plex-Token=): error trying to connect: tcp connect error: Connection refused (os error 111)

at processResponse (deno:core/core.js:223:11)
at Object.jsonOpAsync (deno:core/core.js:240:12)
at async fetch (deno:op_crates/fetch/26_fetch.js:1278:29)
at async getSections (plex.ts:33:15)
at async plex.ts:77:20

To Reproduce
Steps to reproduce the behavior:

  1. deploy container using docker-compose
  2. view logs

Expected behavior
The container starts

Server:

  • OS: Open-Media-Vault 5.6.0
  • Docker: OMV-extras
@TiboGabriels TiboGabriels added the bug Something isn't working label Feb 22, 2021
@TiboGabriels TiboGabriels changed the title [Bug] error trying to connect: tcp connect error: Connection refused (os error 111) [Bug] Feb 22, 2021
@LukeChannings
Copy link
Owner

Hey @TiboGabriels

This looks like a networking issue with your server. The error means that the Plex server isn't accessible from MovieMatch.
Can you try finding an IP address route to the Plex server and using that instead? e.g. http://192.168.1.10:32400

Is Plex accessible from other containers using the same name?

@LukeChannings
Copy link
Owner

Closing due to inactivity. Comment back with more info to re-open

@TiboGabriels
Copy link
Author

I had tried that before, but when using the internal IP, I get this error:
error trying to connect: invalid dnsname

When using the external IP with the internal port, I get the same TCP error, when using the external port Plex uses I get the DNS error again

@TiboGabriels
Copy link
Author

At the moment I don't have any other containers that need to reach plex

@LukeChannings
Copy link
Owner

If you can SSH into the server, you could try following the debugging steps I've posted in #52?

@LukeChannings LukeChannings reopened this Feb 23, 2021
@TiboGabriels
Copy link
Author

I just tried using the external port with the domain name and got this error:
error trying to connect: invalid certificate: CertNotValidForName

I'll have a look at the instructions you linked

@TiboGabriels
Copy link
Author

In the instructions you want me to exec into the container, the thing is that I've never seen the container running, it's always on stopped and when looking in the lights I get the aforementioned errors. I'm using portainer for the bulk of it btw

@LukeChannings
Copy link
Owner

error trying to connect: invalid certificate: CertNotValidForName

Are you using a valid TLS certificate for your Plex domain?

In the instructions you want me to exec into the container, the thing is that I've never seen the container running, it's always on stopped and when looking in the lights I get the aforementioned errors. I'm using portainer for the bulk of it btw

Can you run docker run --rm -u 0 -it --entrypoint="/bin/bash" lukechannings/moviematch and follow the instructions for installing curl from #52?

@TiboGabriels
Copy link
Author

Are you using a valid TLS certificate for your Plex domain?

I have a self signed SSL certificate if thats good enough

Can you run docker run --rm -u 0 -it --entrypoint="/bin/bash" lukechannings/moviematch and follow the instructions for installing curl from #52?

I'll try it now but bear with me, I'm on mobile :p

@TiboGabriels
Copy link
Author

Screenshot_20210223-212035
I managed to get into the Interactive shell and executed the command as you specified, here's the output, or atleas the last bit of it. I apologise for the medium, as I said I'm on mobile

@LukeChannings
Copy link
Owner

Can you try running curl <plex url>/sections/all?x-plex-token=<plex token>?

If that fails, try running it with curl -k <plex url>/sections/all?x-plex-token=<plex token> (disables TLS cert check)

@TiboGabriels
Copy link
Author

I will

@TiboGabriels
Copy link
Author

This is the result, i assume that means the token would be wrong? I'll see if the token changed

<html><head><title>Unauthorized</title></head><body><h1>401 Unauthorized</h1></body></html>root@5da344229635:/app#

@TiboGabriels
Copy link
Author

just pulled the token from the xml but got the same result: 401
Am i supposed to get the token elsewhere?

@TiboGabriels
Copy link
Author

after in plex, setting secure connection to dissabled instead of preferred, i got this as output:
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to omv-server-gabriels.duckdns.org:21415

@LukeChannings
Copy link
Owner

This is the result, i assume that means the token would be wrong? I'll see if the token changed

<html><head><title>Unauthorized</title></head><body><h1>401 Unauthorized</h1></body></html>root@5da344229635:/app#

Yep, that's an invalid (or missing) token. You can follow these instructions to find your token.

after in plex, setting secure connection to dissabled instead of preferred, i got this as output:
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to omv-server-gabriels.duckdns.org:21415

You should set "secure connection" to preferred, this way you can use http:// or https://.
You might need to use http:// for MovieMatch if you're using a self-signed certificate.

@TiboGabriels
Copy link
Author

TiboGabriels commented Feb 24, 2021

I'm using self signed so i'll use http then, let's see

@TiboGabriels
Copy link
Author

TiboGabriels commented Feb 24, 2021

It worked! now i just need to figure out how to deploy the stack without it instantly stopping

error: Uncaught (in promise) DenoStdInternalError: "Films, Series" did not match any available library names: Documentaires, Films, Series, Muziek, Photos, Comedy, Home-Videos

throw new DenoStdInternalError(msg);

      ^

at assert (assert.ts:13:11)

at getSelectedLibraryTitles (plex.ts:66:3)

at plex.ts:79:33

@TiboGabriels
Copy link
Author

i fixed it, it was because i used quotes, thank you!

@LukeChannings
Copy link
Owner

Sweet! I'm glad you got it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants