Connecting to gvmd inside a container giving [Errno 0] Error

Hi
I’m trying to connect to gvmd using gvm-cli.
The server is running inside a container, using docker-compose.
Inside the container I can connect to it:
$gvm-cli tls --hostname=172.26.0.5 --port 9390 --xml “<get_version/>”
<get_version_response status=“200” status_text=“OK”>9.0</get_version_response>

Outside the container, I get:
$ gvm-cli tls --hostname=172.26.0.5 --port 9390 --xml “<get_version/>”
[Errno 0] Error

I can see communication into the container:
gvm@gvmd:~$ sudo tcpdump -i any port 9390
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
12:53:12.470813 IP 172.26.0.1.44516 > gvmd.9390: Flags [S], seq 2288258102, win 29200, options [mss 1460,sackOK,TS val 2967329243 ecr 0,nop,wscale 7], length 0
12:53:12.470868 IP gvmd.9390 > 172.26.0.1.44516: Flags [S.], seq 3017390502, ack 2288258103, win 28960, options [mss 1460,sackOK,TS val 1339294563 ecr 2967329243,nop,wscale 7], length 0
12:53:12.470901 IP 172.26.0.1.44516 > gvmd.9390: Flags [.], ack 1, win 229, options [nop,nop,TS val 2967329243 ecr 1339294563], length 0
12:53:12.471022 IP 172.26.0.1.44516 > gvmd.9390: Flags [P.], seq 1:187, ack 1, win 229, options [nop,nop,TS val 2967329243 ecr 1339294563], length 186
12:53:12.471028 IP gvmd.9390 > 172.26.0.1.44516: Flags [.], ack 187, win 235, options [nop,nop,TS val 1339294563 ecr 2967329243], length 0
12:53:12.478260 IP gvmd.9390 > 172.26.0.1.44516: Flags [F.], seq 1, ack 187, win 235, options [nop,nop,TS val 1339294571 ecr 2967329243], length 0
12:53:12.478552 IP 172.26.0.1.44516 > gvmd.9390: Flags [.], ack 2, win 229, options [nop,nop,TS val 2967329251 ecr 1339294571], length 0
12:53:12.478564 IP 172.26.0.1.44516 > gvmd.9390: Flags [F.], seq 187, ack 2, win 229, options [nop,nop,TS val 2967329251 ecr 1339294571], length 0
12:53:12.683624 IP 172.26.0.1.44516 > gvmd.9390: Flags [F.], seq 187, ack 2, win 229, options [nop,nop,TS val 2967329456 ecr 1339294571], length 0
12:53:12.683683 IP gvmd.9390 > 172.26.0.1.44516: Flags [.], ack 188, win 235, options [nop,nop,TS val 1339294776 ecr 2967329456], length 0

What am I missing?

Thanks

Hi,

I use something like this to deploy containerized gvm using docker-compose through ansible:

...
network_mode: bridge
ports:
- "{{ ansible_var_for_container_host_ip }}:<MY-CHOSEN-PORT>:9390"
dns:
- <FIRST-DNS-SERVER>
- <SECOND-DNS-SERVER>
...

It will show up in the ps output like this /usr/bin/docker-proxy -proto tcp -host-ip <ansible_var_for_container_host_ip> -host-port <MY-CHOSEN-PORT> -container-ip <container_ip> -container-port 9390.

Maybe this works for you as well.

Cheers,
Carl

Thanks. I use something like that also… I can access the daemon inside the container, but somehow I get an error. Will try that on my next build

Maybe you need to renew the gvm certificates gvm-manage-certs -a -f
I sometimes also have trouble connecting due to redeployment leftovers :slight_smile:

Cheers,
Carl

Yep, I tried that. But no luck. Inside the container all works great.