sergiotapia / magnetissimo

Web application that indexes all popular torrent sites, and saves it to the local database.
MIT License
2.98k stars 187 forks source link

We can't find the internet error #149

Closed jpcapone closed 1 year ago

jpcapone commented 1 year ago

Fresh docker deployment and I am able to connect to the app but I get this error image

any suggestions?

sergiotapia commented 1 year ago

I know what this is @jpcapone - There's another environment variable that you can sometimes set called PHX_HOST so the websocket can connect.

This is so that when you deploy any Phoenix app to prod, you can only connect to your backend from mydomain.com.

In this case you're just hitting localhost:4000 right? I just pushed a change that may fix this - could you pull it down and give it a try? Thanks for helping me figure this out.

You just need to pull and re-run, no need to set the PHX_HOST variable.

jpcapone commented 1 year ago

Thanks for getting back to me. I killed the container and deleted the image and forced a redownload and the issue remains. I am sure you already know what the log looks like but below i have added a snipped

`03:34:49.210 [error] Could not check origin for Phoenix.Socket transport.
Origin of the request: http://255.255.255.252:4000
This happens when you are attempting a socket connection to
a different host than the one configured in your config/
files. For example, in development the host is configured
to "localhost" but you may be trying to access it from
"127.0.0.1". To fix this issue, you may either:
  1. update [url: [host: ...]] to your actual host in the
     config file for your current environment (recommended)
  2. pass the :check_origin option when configuring your
     endpoint or when configuring the transport in your
     UserSocket module, explicitly outlining which origins
     are allowed:
        check_origin: ["https://example.com",
                       "//another.com:888", "//other.com"]`
askiiart commented 1 year ago

How do I allow connections to any address? I tried - PHX_HOST=0.0.0.0, but that didn't work.

sergiotapia commented 1 year ago

Asking for some help in the ElixirForums here - https://elixirforum.com/t/could-not-check-origin-for-phoenix-socket-transport-in-prod-running-on-docker/55269

I don't know how to fix this

afarazit commented 1 year ago

@askiiart try - PHX_HOST=magnetissimo.domain.tld, replace magnetissimo.domain.tld with your domain

jpcapone commented 1 year ago

@askiiart try - PHX_HOST=magnetissimo.domain.tld, replace magnetissimo.domain.tld with your domain

would this work for my issue as well? I assume i should have a dns record that resolves the domain name?

afarazit commented 1 year ago

@jpcapone you can give it a try, also if you are using Nginx Proxy Manager be sure to enable Websockets support

jpcapone commented 1 year ago

magnetissimo

I am not using any proxying within my home network
added this line to the docker compose file PHX_HOST=magnetissimo.blahblah.bla still getting image

I created and confirmed resolution to the PHX_HOST entry. Any other suggestions.

askiiart commented 1 year ago

@jpcapone

Use PHX_HOST=<IP_ADDRESS_HERE>, for example PHX_HOST=192.168.1.23

jpcapone commented 1 year ago

That did it for me. I am in!

sergiotapia commented 1 year ago

Fantastic!

Ethergy commented 1 year ago

@jpcapone

Use PHX_HOST=<IP_ADDRESS_HERE>, for example PHX_HOST=192.168.1.23

I have done this but am still experiencing the issue

askiiart commented 1 year ago

@Ethergy Could you please provide logs?

Ethergy commented 1 year ago

@Ethergy Could you please provide logs? _magnetissimo_logs.txt Looks like it's whatever is going on in #161 actually