Docker Community Forums

Share and learn in the Docker community.

Child containers fail to relink when using network_mode: service


(Rrspyder) #1

Hello,

I am experiencing an issue where I have a parent container which houses an Openvpn image. I then have child containers that have their network_mode set to use the vpn service. Everything works great until the vpn service fails and restarts. It seems after the restart that the child containers no longer link back up to the vpn containers networking? Should this be the case or is there something I am missing? I have set the various depends_on selections in docker_compose.Here is my docker-compose file. https://github.com/kkniffin/usb-mediaserver/blob/master/docker-compose.yml

I am running the latest version of Debian Jessie and have tried various versions of docker up to the latest experimental rc4 that I am on now:

Distributor ID: Debian
Description: Debian GNU/Linux 8.5 (jessie)
Release: 8.5
Codename: jessie

Client:
Version: 1.12.0-rc4
API version: 1.24
Go version: go1.6.2
Git commit: e4a0dbc
Built: Wed Jul 13 03:37:36 2016
OS/Arch: linux/amd64
Experimental: true

Server:
Version: 1.12.0-rc4
API version: 1.24
Go version: go1.6.2
Git commit: e4a0dbc
Built: Wed Jul 13 03:37:36 2016
OS/Arch: linux/amd64
Experimental: true

If I try to connect to any of the child containers after the restart, I receive:

rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:1215: running lstat on namespace path “/proc/1225/ns/net” caused “lstat /proc/1225/ns/net: no such file or directory”

Appreciate any guidance or help in troubleshooting.


(Marcelo Waisman) #2

Hi
Anyone found a solution for this?


(Dockerops123) #3

I have run into this, also. Any clue?


(Mickdekkers) #4

Hi,

I’m having the same issue on Windows 10 with docker-compose. I’ve set up a container running the dperson/openvpn-client image and I’ve got another container set to use the vpn connection with network_mode: service:vpn.

It worked fine the first time I ran it using docker-compose up, but after tearing it down with docker-compose down I keep getting this error:

$ docker-compose up
Creating network "vpn_test_default" with the default driver
Creating vpn ... done
Creating test_container ... error

ERROR: for test_container  Cannot start service test_container: OCI runtime create failed: container_linux.go:341: creating new parent process caused "container_linux.go:1713: running lstat on namespace path \"/proc/47281/ns/net\" caused \"lstat /proc/47281/ns/net: no such file or directory\"": unknown

ERROR: for test_container  Cannot start service test_container: OCI runtime create failed: container_linux.go:341: creating new parent process caused "container_linux.go:1713: running lstat on namespace path \"/proc/47281/ns/net\" caused \"lstat /proc/47281/ns/net: no such file or directory\"": unknown
ERROR: Encountered errors while bringing up the project.

Has anyone managed to solve this issue?


(Mickdekkers) #5

I’m not sure why, but in my case the culprit turned out to be the --dns flag. I forgot I’d added it while tweaking various things before running docker-compose up. I had set it to use Google’s DNS (--dns 8.8.4.4), but adding that flag seems to have broken something, leading to the error I posted. Removing the flag fixed the error for me.