1

Stack

I'm running the following:

  • Metal
    • Ubuntu 18.04
      • vagrant
        • dockerprovider
          • gitlab dk

Expectation

I'm trying to curl localhost:3000 to reach gitlab.

  • When I do that from the vagrant box, it works:

    vagrant@549f682a30a4:~/gdk$ curl localhost:3000
    <html><body>You are being <a href="http://localhost:3000/users/sign_in">redirected</a>.</body></html>vagrant@549f682a30a4:~/gdk$
    

    I also see the request in the gdk tail

  • When I do that from the ubuntu, it doesnt work:

    gdkuser@mymachine:~/gitlab-development-kit$ curl localhost:3000 -v --trace -
    Warning: --trace overrides an earlier trace/verbose option
    == Info: Rebuilt URL to: localhost:3000/
    == Info:   Trying 127.0.0.1...
    == Info: TCP_NODELAY set
    == Info: Connected to localhost (127.0.0.1) port 3000 (#0)
    => Send header, 78 bytes (0x4e)
    0000: 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a GET / HTTP/1.1..
    0010: 48 6f 73 74 3a 20 6c 6f 63 61 6c 68 6f 73 74 3a Host: localhost:
    0020: 33 30 30 30 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3000..User-Agent
    0030: 3a 20 63 75 72 6c 2f 37 2e 35 38 2e 30 0d 0a 41 : curl/7.58.0..A
    0040: 63 63 65 70 74 3a 20 2a 2f 2a 0d 0a 0d 0a       ccept: */*....
    == Info: Recv failure: Connection reset by peer
    == Info: stopped the pause stream!
    == Info: Closing connection 0
    curl: (56) Recv failure: Connection reset by peer
    

    I don't see anything in gdk tail

Analysis / Investigation

As I see the request received in gdk tail when it comes from inside vagrant and not, when it's from the host, I assume that it's stuck somewhere on the way. I'm not sure which route the request has to travel. I tried the following things to find out more:

  • Port Forwarding

    • Vagrantfile Network part at line 112
      config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true

    • Host (Ubuntu): netstat -tulpn | grep 3000
      tcp6 0 0 :::3000 :::* LISTEN 6508/docker-proxy

    • Vagrant: netstat -tulpn | grep 3000
      tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN 12387/gitlab-workho
      Again, as internal calls are, but external calls are not in gdk tail I assume the request from host never arrives in vagrant.

  • docker 0.0.0.0:3000->3000/tcp, thus the ports should be forwarded and requests should be seen in docker

    gdkuser@mymachine:~/gitlab-development-kit$ docker ps
    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                            NAMES
    549f682a30a4        cb5d370c7aaf        "/bin/sh -c 'supervi…"   About an hour ago   Up About an hour    0.0.0.0:3000->3000/tcp, 127.0.0.1:2222->22/tcp   gitlab-development-kit_default_1592131487
    

    When attaching to the docker and executing curl on either Vagrant or Ubuntu, I don't get any info in the running Info List in the docker container.

  • VirtualBox

    • I've read about troubles with virtualbox 5.2.xx, as I'm running virtualbox 6.1.10, I assume that doesn't apply here. Nevertheless I don't know how to verify, that virtualbox actually forwards the port.
      I'm also not quite sure, if VirtualBox forwards to Docker, or vice versa.

Do you have insights how to proceed figuring out, what's wrong? Thanks a lot!

1 Answer 1

0

Following this issue https://gitlab.com/gitlab-org/gitlab-development-kit/-/issues/545

Run this on the container:

sudo apt install net-tools redir
export EXTIF=`ifconfig eth0 | grep "inet " | awk -F'[: ]+' '{ print $3 }'`
redir $EXTIF:3000 127.0.0.1:3000
1
  • I don't have an eth0 interface, inside my Vagrant machine I have dozens of interfaces named randomly like br-24f95e211844
    – ajmeese7
    Commented May 13 at 2:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .