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

(Self Hosted) Can't access to PWD home page #558

Open
oijkn opened this issue Oct 28, 2022 · 12 comments
Open

(Self Hosted) Can't access to PWD home page #558

oijkn opened this issue Oct 28, 2022 · 12 comments

Comments

@oijkn
Copy link

oijkn commented Oct 28, 2022

Below is the information of the VM :

  • Docker version 20.10.14, build a224086
  • docker-compose version 1.18.0, build 8dd22a9
  • go version go1.19.2 linux/amd64
  • CentOS 7
  • Network with two interfaces (net0 + net1), all services are in net1

The commands that I typed :

  • sudo modprobe xt_ipvs
  • docker swarm init --advertise-addr <net1_ip>
  • docker pull franela/dind
  • go mod vendor
  • docker-compose up -d

Here is a part of the logs :

docker logs pwd

2022/10/28 14:14:44 Updating playgrounds configuration
2022/10/28 14:14:44 EVENT: Playground New 4a24b940-e23f-54f5-8867-137433240dd7
2022/10/28 14:14:44 Updating playgrounds configuration
2022/10/28 14:14:44 Listening on port 3000
2022/10/28 14:19:44 Updating playgrounds configuration
[negroni] Started GET /
2022/10/28 14:20:13 Error retrieving playground 4bdda56c-e3c7-57e2-bc30-a7d92a675742. Got: NotFound
2022/10/28 14:20:13 Playground for domain <net1_ip> was not found!
[negroni] Completed 404 Not Found in 466.092µs

docker logs l2

2022/10/28 14:13:48 Proxying TLS connection to . Discover took 40.591µs
2022/10/28 14:13:48 Error directing request: Couldn't find host in string
2022/10/28 14:13:49 Proxying TLS connection to . Discover took 44.202µs
2022/10/28 14:13:49 Error directing request: Couldn't find host in string
2022/10/28 14:13:50 Proxying TLS connection to . Discover took 76.826µs
2022/10/28 14:13:50 Error directing request: Couldn't find host in string
2022/10/28 14:13:51 Proxying TLS connection to . Discover took 48.879µs
2022/10/28 14:13:51 Error directing request: Couldn't find host in string
2022/10/28 14:13:52 Proxying TLS connection to . Discover took 76.407µs
2022/10/28 14:13:52 Error directing request: Couldn't find host in string
2022/10/28 14:13:53 Proxying TLS connection to . Discover took 44.877µs
2022/10/28 14:13:53 Error directing request: Couldn't find host in string
2022/10/28 14:13:54 Proxying TLS connection to . Discover took 41.645µs
2022/10/28 14:13:54 Error directing request: Couldn't find host in string
2022/10/28 14:13:55 Proxying TLS connection to . Discover took 74.595µs
2022/10/28 14:13:55 Error directing request: Couldn't find host in string
2022/10/28 14:13:56 Proxying TLS connection to . Discover took 41.831µs
2022/10/28 14:13:56 Error directing request: Couldn't find host in string
2022/10/28 14:13:57 Proxying TLS connection to . Discover took 43.075µs
2022/10/28 14:13:57 Error directing request: Couldn't find host in string
2022/10/28 14:13:58 Proxying TLS connection to . Discover took 41.699µs
2022/10/28 14:13:58 Error directing request: Couldn't find host in string
[...]

docker logs haproxy

[NOTICE]   (1) : haproxy version is 2.6.6-274d1a4
[NOTICE]   (1) : path to executable is /usr/local/sbin/haproxy
[WARNING]  (1) : config : missing timeouts for frontend 'http-in'.
   | While not properly invalid, you will certainly encounter various problems
   | with such a configuration. To fix this, please ensure that all following
   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
[WARNING]  (1) : config : missing timeouts for backend 'pwd'.
   | While not properly invalid, you will certainly encounter various problems
   | with such a configuration. To fix this, please ensure that all following
   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
[WARNING]  (1) : config : missing timeouts for backend 'l2'.
   | While not properly invalid, you will certainly encounter various problems
   | with such a configuration. To fix this, please ensure that all following
   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
[NOTICE]   (1) : New worker (8) forked
[NOTICE]   (1) : Loading success.
[WARNING]  (8) : pwd/node1 changed its IP from (none) to 172.27.0.4 by docker_resolver/dns.
[WARNING]  (8) : Server pwd/node1 ('pwd') is UP/READY (resolves again).
[WARNING]  (8) : Server pwd/node1 administratively READY thanks to valid DNS answer.
[WARNING]  (8) : l2/node2 changed its IP from (none) to 172.27.0.3 by docker_resolver/dns.
[WARNING]  (8) : Server l2/node2 ('l2') is UP/READY (resolves again).
[WARNING]  (8) : Server l2/node2 administratively READY thanks to valid DNS answer.
[WARNING]  (8) : Server l2/node2 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT]    (8) : backend 'l2' has no server available!
[WARNING]  (8) : Server pwd/node1 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT]    (8) : backend 'pwd' has no server available!
[WARNING]  (8) : Server l2/node2 is UP, reason: Layer4 check passed, check duration: 0ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
[WARNING]  (8) : Server pwd/node1 is UP, reason: Layer4 check passed, check duration: 0ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.

Do you have any idea why it doesn't work, please ?

@marcosnils
Copy link
Contributor

Looks like haproxy is complaining that it can't reach the pwd and l2 backends. Seems like the error is coming from there.

@oijkn
Copy link
Author

oijkn commented Oct 28, 2022

@marcosnils these two lines indicate that the haproxy sees l2 and pwd, right?

[WARNING]  (8) : Server l2/node2 is UP, reason: Layer4 check passed, check duration: 0ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
[WARNING]  (8) : Server pwd/node1 is UP, reason: Layer4 check passed, check duration: 0ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.

@marcosnils
Copy link
Contributor

yes, that seems to be correct. What happens when you try to open localhost?

@oijkn
Copy link
Author

oijkn commented Oct 28, 2022

If I do a curl localhost:80 from inside the VM that respond good but not with curl <net1_ip:80>

@marcosnils
Copy link
Contributor

where and how are you running your VM?

@oijkn
Copy link
Author

oijkn commented Oct 28, 2022

The CentOS VM is running from an ESXi server, I have other docker applications that work perfectly on other VMs on the same hypervisor.

@marcosnils
Copy link
Contributor

ok, since you're not running this in your local machine, you first need to modify the playground domain here https://github.com/play-with-docker/play-with-docker/blob/master/config/config.go#L68 so you can connect to http://<my_vm_hostname> from your browser.

@oijkn
Copy link
Author

oijkn commented Oct 28, 2022

Good call 👍🏻 effectively if I set the <net1_ip> instead of localhost in "playground-domain", then I can access to the app from my web browser at http://<net1_ip>. But I do not have Start button.

image

Usually we use a reverse proxy for the urls, I configured it to point to <net1_ip> (as we usually do) but impossible to reach PWD from https://<my_custom_url>.domain.com

Is there still a subtlety to modify in the code ?

@marcosnils
Copy link
Contributor

Yes, you also need to add the domain to the CORS exceptions here:

corsHandler := gh.CORS(gh.AllowCredentials(), gh.AllowedHeaders([]string{"x-requested-with", "content-type"}), gh.AllowedMethods([]string{"GET", "POST", "HEAD", "DELETE"}), gh.AllowedOriginValidator(func(origin string) bool {
if strings.Contains(origin, "localhost") ||
strings.HasSuffix(origin, "play-with-docker.com") ||
strings.HasSuffix(origin, "play-with-kubernetes.com") ||
strings.HasSuffix(origin, "docker.com") ||
strings.HasSuffix(origin, "play-with-go.dev") {

@oijkn
Copy link
Author

oijkn commented Oct 28, 2022

@marcosnils thank you for the support, now I can start new instance !
I tried to set http_proxy under the new instance but it can't pull any docker image.

Do you know how to manage it, please ?

@oijkn
Copy link
Author

oijkn commented Oct 29, 2022

@marcosnils I followed the Docker doc to configure the proxy so that the containers can access it but with PWD it doesn't work. I also added the http_proxy entries in the environment key of the docker-compose.yml but without success.

@Shashwat-05
Copy link

Shashwat-05 commented May 28, 2023

Below is the information of the VM :

  • Docker version 20.10.14, build a224086
  • docker-compose version 1.18.0, build 8dd22a9
  • go version go1.19.2 linux/amd64
  • CentOS 7
  • Network with two interfaces (net0 + net1), all services are in net1

The commands that I typed :

  • sudo modprobe xt_ipvs
  • docker swarm init --advertise-addr <net1_ip>
  • docker pull franela/dind
  • go mod vendor
  • docker-compose up -d

Here is a part of the logs :

docker logs pwd

2022/10/28 14:14:44 Updating playgrounds configuration
2022/10/28 14:14:44 EVENT: Playground New 4a24b940-e23f-54f5-8867-137433240dd7
2022/10/28 14:14:44 Updating playgrounds configuration
2022/10/28 14:14:44 Listening on port 3000
2022/10/28 14:19:44 Updating playgrounds configuration
[negroni] Started GET /
2022/10/28 14:20:13 Error retrieving playground 4bdda56c-e3c7-57e2-bc30-a7d92a675742. Got: NotFound
2022/10/28 14:20:13 Playground for domain <net1_ip> was not found!
[negroni] Completed 404 Not Found in 466.092µs

docker logs l2

2022/10/28 14:13:48 Proxying TLS connection to . Discover took 40.591µs
2022/10/28 14:13:48 Error directing request: Couldn't find host in string
2022/10/28 14:13:49 Proxying TLS connection to . Discover took 44.202µs
2022/10/28 14:13:49 Error directing request: Couldn't find host in string
2022/10/28 14:13:50 Proxying TLS connection to . Discover took 76.826µs
2022/10/28 14:13:50 Error directing request: Couldn't find host in string
2022/10/28 14:13:51 Proxying TLS connection to . Discover took 48.879µs
2022/10/28 14:13:51 Error directing request: Couldn't find host in string
2022/10/28 14:13:52 Proxying TLS connection to . Discover took 76.407µs
2022/10/28 14:13:52 Error directing request: Couldn't find host in string
2022/10/28 14:13:53 Proxying TLS connection to . Discover took 44.877µs
2022/10/28 14:13:53 Error directing request: Couldn't find host in string
2022/10/28 14:13:54 Proxying TLS connection to . Discover took 41.645µs
2022/10/28 14:13:54 Error directing request: Couldn't find host in string
2022/10/28 14:13:55 Proxying TLS connection to . Discover took 74.595µs
2022/10/28 14:13:55 Error directing request: Couldn't find host in string
2022/10/28 14:13:56 Proxying TLS connection to . Discover took 41.831µs
2022/10/28 14:13:56 Error directing request: Couldn't find host in string
2022/10/28 14:13:57 Proxying TLS connection to . Discover took 43.075µs
2022/10/28 14:13:57 Error directing request: Couldn't find host in string
2022/10/28 14:13:58 Proxying TLS connection to . Discover took 41.699µs
2022/10/28 14:13:58 Error directing request: Couldn't find host in string
[...]

docker logs haproxy

[NOTICE]   (1) : haproxy version is 2.6.6-274d1a4
[NOTICE]   (1) : path to executable is /usr/local/sbin/haproxy
[WARNING]  (1) : config : missing timeouts for frontend 'http-in'.
   | While not properly invalid, you will certainly encounter various problems
   | with such a configuration. To fix this, please ensure that all following
   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
[WARNING]  (1) : config : missing timeouts for backend 'pwd'.
   | While not properly invalid, you will certainly encounter various problems
   | with such a configuration. To fix this, please ensure that all following
   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
[WARNING]  (1) : config : missing timeouts for backend 'l2'.
   | While not properly invalid, you will certainly encounter various problems
   | with such a configuration. To fix this, please ensure that all following
   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
[NOTICE]   (1) : New worker (8) forked
[NOTICE]   (1) : Loading success.
[WARNING]  (8) : pwd/node1 changed its IP from (none) to 172.27.0.4 by docker_resolver/dns.
[WARNING]  (8) : Server pwd/node1 ('pwd') is UP/READY (resolves again).
[WARNING]  (8) : Server pwd/node1 administratively READY thanks to valid DNS answer.
[WARNING]  (8) : l2/node2 changed its IP from (none) to 172.27.0.3 by docker_resolver/dns.
[WARNING]  (8) : Server l2/node2 ('l2') is UP/READY (resolves again).
[WARNING]  (8) : Server l2/node2 administratively READY thanks to valid DNS answer.
[WARNING]  (8) : Server l2/node2 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT]    (8) : backend 'l2' has no server available!
[WARNING]  (8) : Server pwd/node1 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT]    (8) : backend 'pwd' has no server available!
[WARNING]  (8) : Server l2/node2 is UP, reason: Layer4 check passed, check duration: 0ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
[WARNING]  (8) : Server pwd/node1 is UP, reason: Layer4 check passed, check duration: 0ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.

Do you have any idea why it doesn't work, please ?

@oijkn I did the same thing. but still got the same error. any insights?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants