Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

"msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', error(2, 'No such file or directory'))" #925

Open
nibzy26 opened this issue May 8, 2018 · 5 comments

Comments

@nibzy26
Copy link

nibzy26 commented May 8, 2018

ISSUE TYPE
  • Bug Report
container.yml
version: "2"
settings:

  conductor:
    # The Conductor container does the heavy lifting, and provides a portable
    # Python runtime for building your target containers. It should be derived
    # from the same distribution as you're building your target containers with.
    base: ubuntu:16.04
    # roles_path:   # Specify a local path containing Ansible roles
    #volumes: mydb:/home/otp/db      # Provide a list of volumes to mount
    # environment:  # List or mapping of environment variables

  # Set the name of the project. Defaults to basename of the project directory.
  # For built services, concatenated with service name to form the built image name.
  project_name: node5may

  # The deployment_output_path is mounted to the Conductor container, and the
  # `run` and `deployment` commands then write generated Ansible playbooks to it.
  # deployment_output_path: ./ansible-deployment

  # When using the k8s or openshift engines, use the following to authorize with the API.
  # Values set here will be passed to the Ansible modules. Any file paths will be mounted
  # to the conductor container, allowing the `run` command to access the API.

services:
  # Add your containers here, specifying the base image you want to build from.
  # To use this example, uncomment it and delete the curly braces after services key.
  # You may need to run `docker pull ubuntu:trusty` for this to work.

   ocs5may_service:
     from: "ubuntu:16.04"
     roles:
        - base
     ports:
        - "8080:8080"
        - "1812:1812/udp"
        - "1813:1813/udp"
        - "3868:3868"
     expose:
        - "1812/udp"
        - "1813/udp"
        - "3868/tcp"
        - "8080/tcp"
     volumes:
        - mydb:/home/otp/db/
     user: root
     working_dir: /home/otp
     #environment:
       #ROOTDIR: /usr/lib/erlang
       #RELDIR: /usr/lib/erlang/releases
       #OTPHOME: /usr/lib/erlang
     entrypoint: ["/bin/sh", "-c", "tail -f /var/log/dmesg"]
     #entrypoint: ["/bin/start.sh"]
volumes:
  mydb:
    docker: {}
registries: {}
  # Add optional registries used for deployment. For example:
  #  google:
  #    url: https://gcr.io
  #    namespace: my-cool-project-xxxxxx
OS / ENVIRONMENT
root@nabeel-pc:/home/nabeel/Desktop/node5may# ansible-container --debug version
Ansible Container, version 0.9.3rc0
Linux, nabeel-pc, 4.13.0-39-generic, #44~16.04.1-Ubuntu SMP Thu Apr 5 16:43:10 UTC 2018, x86_64
3.6.5 (default, Mar 29 2018, 03:28:50) 
[GCC 5.4.0 20160609] /usr/bin/python3.6
{
  "ID": "PCBZ:OXBP:B6MH:H2MD:WBPS:OXXJ:5SKT:73WM:IZE7:UYQU:LXLM:B3JN",
  "Containers": 1,
  "ContainersRunning": 1,
  "ContainersPaused": 0,
  "ContainersStopped": 0,
  "Images": 16,
  "Driver": "overlay2",
  "DriverStatus": [
    [
      "Backing Filesystem",
      "extfs"
    ],
    [
      "Supports d_type",
      "true"
    ],
    [
      "Native Overlay Diff",
      "true"
    ]
  ],
  "SystemStatus": null,
  "Plugins": {
    "Volume": [
      "local"
    ],
    "Network": [
      "bridge",
      "host",
      "ipvlan",
      "macvlan",
      "null",
      "overlay"
    ],
    "Authorization": null,
    "Log": [
      "awslogs",
      "fluentd",
      "gcplogs",
      "gelf",
      "journald",
      "json-file",
      "logentries",
      "splunk",
      "syslog"
    ]
  },
  "MemoryLimit": true,
  "SwapLimit": false,
  "KernelMemory": true,
  "CpuCfsPeriod": true,
  "CpuCfsQuota": true,
  "CPUShares": true,
  "CPUSet": true,
  "IPv4Forwarding": true,
  "BridgeNfIptables": true,
  "BridgeNfIp6tables": true,
  "Debug": false,
  "NFd": 28,
  "OomKillDisable": true,
  "NGoroutines": 40,
  "SystemTime": "2018-05-08T12:11:44.211365911+05:00",
  "LoggingDriver": "json-file",
  "CgroupDriver": "cgroupfs",
  "NEventsListener": 0,
  "KernelVersion": "4.13.0-39-generic",
  "OperatingSystem": "Ubuntu 16.04.3 LTS",
  "OSType": "linux",
  "Architecture": "x86_64",
  "IndexServerAddress": "https://index.docker.io/v1/",
  "RegistryConfig": {
    "AllowNondistributableArtifactsCIDRs": [],
    "AllowNondistributableArtifactsHostnames": [],
    "InsecureRegistryCIDRs": [
      "127.0.0.0/8"
    ],
    "IndexConfigs": {
      "docker.io": {
        "Name": "docker.io",
        "Mirrors": [],
        "Secure": true,
        "Official": true
      }
    },
    "Mirrors": []
  },
  "NCPU": 4,
  "MemTotal": 8081829888,
  "GenericResources": null,
  "DockerRootDir": "/var/lib/docker",
  "HttpProxy": "",
  "HttpsProxy": "",
  "NoProxy": "",
  "Name": "nabeel-pc",
  "Labels": [],
  "ExperimentalBuild": true,
  "ServerVersion": "18.03.1-ce",
  "ClusterStore": "",
  "ClusterAdvertise": "",
  "Runtimes": {
    "runc": {
      "path": "docker-runc"
    }
  },
  "DefaultRuntime": "runc",
  "Swarm": {
    "NodeID": "",
    "NodeAddr": "",
    "LocalNodeState": "inactive",
    "ControlAvailable": false,
    "Error": "",
    "RemoteManagers": null
  },
  "LiveRestoreEnabled": false,
  "Isolation": "",
  "InitBinary": "docker-init",
  "ContainerdCommit": {
    "ID": "773c489c9c1b21a6d78b5c538cd395416ec50f88",
    "Expected": "773c489c9c1b21a6d78b5c538cd395416ec50f88"
  },
  "RuncCommit": {
    "ID": "4fc53a81fb7c994640722ac585fa9ca548971871",
    "Expected": "4fc53a81fb7c994640722ac585fa9ca548971871"
  },
  "InitCommit": {
    "ID": "949e6fa",
    "Expected": "949e6fa"
  },
  "SecurityOptions": [
    "name=apparmor",
    "name=seccomp,profile=default"
  ]
}
{
  "Platform": {
    "Name": ""
  },
  "Components": [
    {
      "Name": "Engine",
      "Version": "18.03.1-ce",
      "Details": {
        "ApiVersion": "1.37",
        "Arch": "amd64",
        "BuildTime": "2018-04-26T07:15:30.000000000+00:00",
        "Experimental": "true",
        "GitCommit": "9ee9f40",
        "GoVersion": "go1.9.5",
        "KernelVersion": "4.13.0-39-generic",
        "MinAPIVersion": "1.12",
        "Os": "linux"
      }
    }
  ],
  "Version": "18.03.1-ce",
  "ApiVersion": "1.37",
  "MinAPIVersion": "1.12",
  "GitCommit": "9ee9f40",
  "GoVersion": "go1.9.5",
  "Os": "linux",
  "Arch": "amd64",
  "KernelVersion": "4.13.0-39-generic",
  "Experimental": true,
  "BuildTime": "2018-04-26T07:15:30.000000000+00:00"
}

SUMMARY

GOAL: I just want to start a container to be in macvlan network which i have already configured on my host.
I tried setting up DOCKER_HOST to some suggested values online but didnt work.
I AM RUNNING EVERYTHING LOCALLY
issue: Everything was working fine untill i added these lines in my roles/base/tasks/main.yml file. Now the ansible-container build fails...

  • name: Add a container to a network, leaving existing containers connected
    docker_network:
    name: ocs_network
    #connected:

    - container_a

    appends: yes
STEPS TO REPRODUCE
root@nabeel-pc:/home/nabeel/Desktop/node5may# ps -aux | grep docker
root     13841  4.5  1.0 657476 83144 ?        Ssl  12:07   0:26 /usr/bin/dockerd -H fd:// -H unix:///var/run/docker.sock -H tcp://localhost:2375
root     13848  0.3  0.3 680600 23840 ?        Ssl  12:07   0:02 docker-containerd --config /var/run/docker/containerd/containerd.toml


===========================

Also the contents of my etc/docker/daemon.json file 

{

  "experimental": true

}

{
  "hosts": ["fd://", "unix:///var/run/docker.sock" ,"tcp://localhost:2375"]
}
``

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->

##### ACTUAL RESULTS
<!--- What actually happened? If possible run with debugging (--debug) -->
"msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', error(2, 'No such file or directory'))"
}

<!--- Paste verbatim command output between quotes below -->
@karthik-arris
Copy link

@xacaxulu
Copy link

+1

@Voronenko
Copy link
Contributor

That's quite confusing

You are adding that in the role for the container build, which looks erroneous

name: Add a container to a network, leaving existing containers connected
docker_network:
name: ocs_network

@alexanderadam
Copy link

You should try whether the Docker daemon is really started.

For example with

$ sudo systemctl status docker

In my case Docker setup was broken in general (and therefore not related to ansible)

@wired00
Copy link

wired00 commented Feb 13, 2019

You should try whether the Docker daemon is really started.

For example with

$ sudo systemctl status docker

In my case Docker setup was broken in general (and therefore not related to ansible)

uggg can't believe this was my problem. Ansible seems to bomb out with a completely misleading error... but still i should have ensured docker was running!

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

No branches or pull requests

6 participants