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) Black screen on terminal #591

Open
xandermann opened this issue Jul 24, 2023 · 1 comment
Open

(Self hosted) Black screen on terminal #591

xandermann opened this issue Jul 24, 2023 · 1 comment

Comments

@xandermann
Copy link

Hi !

I would like to create a self-hosted "Play with Docker" instance on my VPS. Currently, when I try to open a new instance, I only get a black screen and I am unable to interact with it. I expect the instance to show the terminal, similar to what I see on the https://labs.play-with-docker.com/ website.

Expected Behavior

I should be able to see the instance terminal, as shown in the screenshot (like on the https://labs.play-with-docker.com website).

image

Current Behavior

Instead, the current instance looks like the following screenshot. (black terminal)

image

Steps to Reproduce

  1. Typed the following commands:
sudo modprobe xt_ipvs
docker swarm init --advertise-addr <ip>
docker pull franela/dind
go mod vendor
  1. Edited the file config/config.go and replaced localhost with the VPS domain in the line:
flag.StringVar(&PlaygroundDomain, "playground-domain", "localhost", "Domain to use for the playground")
  1. Executed docker-compose up.

Logs

haproxy    | [NOTICE]   (1) : haproxy version is 2.8.1-a90123a
haproxy    | [NOTICE]   (1) : path to executable is /usr/local/sbin/haproxy
haproxy    | [WARNING]  (1) : config : missing timeouts for frontend 'http-in'.
haproxy    |    | While not properly invalid, you will certainly encounter various problems
haproxy    |    | with such a configuration. To fix this, please ensure that all following
haproxy    |    | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
haproxy    | [WARNING]  (1) : config : missing timeouts for backend 'pwd'.
haproxy    |    | While not properly invalid, you will certainly encounter various problems
haproxy    |    | with such a configuration. To fix this, please ensure that all following
haproxy    |    | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
haproxy    | [WARNING]  (1) : config : missing timeouts for backend 'l2'.
haproxy    |    | While not properly invalid, you will certainly encounter various problems
haproxy    |    | with such a configuration. To fix this, please ensure that all following
haproxy    |    | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
haproxy    | [NOTICE]   (1) : New worker (8) forked
haproxy    | [NOTICE]   (1) : Loading success.
haproxy    | [WARNING]  (8) : l2/node2 changed its IP from (none) to 192.168.48.3 by docker_resolver/dns.
haproxy    | [WARNING]  (8) : Server l2/node2 ('l2') is UP/READY (resolves again).
haproxy    | [WARNING]  (8) : Server l2/node2 administratively READY thanks to valid DNS answer.
haproxy    | [WARNING]  (8) : pwd/node1 changed its IP from (none) to 192.168.48.4 by docker_resolver/dns.
haproxy    | [WARNING]  (8) : Server pwd/node1 ('pwd') is UP/READY (resolves again).
haproxy    | [WARNING]  (8) : Server pwd/node1 administratively READY thanks to valid DNS answer.
haproxy    | [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.
haproxy    | [ALERT]    (8) : backend 'l2' has no server available!
haproxy    | [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.
haproxy    | [ALERT]    (8) : backend 'pwd' has no server available!
haproxy    | [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.
pwd        | 2023/07/24 20:37:57 Updating playgrounds configuration
pwd        | 2023/07/24 20:37:57 Listening on port 3000
pwd        | 2023/07/24 20:37:57 EVENT: Playground New 74a9ba4a-980d-5d41-b8e8-8c3d2926d1f6
pwd        | 2023/07/24 20:37:57 Updating playgrounds configuration
haproxy    | [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.
pwd        | [negroni] Started GET /
pwd        | [negroni] Completed 200 OK in 471.606µs

Other

  1. I attempted to use the "ssh" link, but I encountered a "Permission denied (publickey)" error. I have already generated an SSH key using keygen.
  2. I set the environment variable GOPATH to "/home/alex/go/", but the issue still persists. (export GOPATH="/home/alex/go/")
  3. Additionally, I tried cloning the application into the /home/alex/go/src/github.com/play-with-docker/play-with-docker directory, but that did not resolve the problem either.
@jorluisperales
Copy link

jorluisperales commented Aug 13, 2023

Hello @xandermann

I was actually having the exact same issue,

I had another server with a hosted PWD that was working as expected. (I deployed it a year ago)

I decided to use the same golang docker image (golang:1.20.4) (which was the latest at the time) I was using for that working server and it worked on my new server

docker-compose.yml

version: '3.2'
services:
    haproxy:
        container_name: haproxy
        image: haproxy
        ports:
            - "80:8080"
        volumes:
            - ./haproxy:/usr/local/etc/haproxy

    pwd:
        # pwd daemon container always needs to be named this way
        container_name: pwd
        # use the latest golang image
        image: golang:1.20.4
        # go to the right place and starts the app
        command: /bin/sh -c 'ssh-keygen -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key >/dev/null; cd /go/src/; if [ -e /runbin/pwd ]; then /runbin/pwd  -save /pwd/sessions -name l2; else go run api.go -save /pwd/sessions -name l2; fi'
        volumes:
            # since this app creates networks and launches containers, we need to talk to docker daemon
            - /var/run/docker.sock:/var/run/docker.sock
            # mount the box mounted shared folder to the container
            - $PWD:/go/src
            - sessions:/pwd
    l2:
        container_name: l2
        # use the latest golang image
        image: golang:1.20.4
        # go to the right place and starts the app
        command: /bin/sh -c 'ssh-keygen -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key >/dev/null; cd /go/src/router/l2; if [ -e /runbin/l2 ]; then /runbin/l2 -ssh_key_path /etc/ssh/ssh_host_rsa_key -name l2 -save /pwd/networks; else go run l2.go -ssh_key_path /etc/ssh/ssh_host_rsa_key -name l2 -save /pwd/networks; fi'
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - $PWD:/go/src
            - `networks:/pwd`
        ports:
            - "8022:22"
            - "8053:53"
            - "443:443"
volumes:
    sessions:
    networks:

I don't know if with the latest golang image has worked for other people, but at least for me, it has not.

Cheers and I hope this also solves yours

Jorluis

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

2 participants