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

Error building conductor image (conductor-requirements) "ImportError: No module named six" #569

Closed
LouisStAmour opened this issue Jun 1, 2017 · 2 comments · Fixed by #571

Comments

@LouisStAmour
Copy link

ISSUE TYPE
  • Bug Report
container.yml

The default that was created with ansible-container init:

version: "2"
settings:
  # 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.
  conductor_base: centos:7

  # 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.
  #k8s_auth:
    # path to a K8s config file
    #config_file:
    # name of a context found within the config.json file
    #context:
    # URL for accessing the K8s API
    #host:
    # An API authentication token
    #api_key:
    # Path to a ca cert file
    #ssl_ca_cert:
    # Path to a cert file
    #cert_file:
    # Path to a key file
    #key_file:
    #boolean, indicating if SSL certs should be validated
    #verify_ssl:

  # When using the k8s or openshift engines, use the following to set the namespace.
  # If not set, the project name will be used. For openshift, the namespace maps to a project,
  # and description and display_name are supported.
  #k8s_namespace:
  #  name:
  #  description:
  #  display_name:

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.

  # web:
  #   from: "centos:7"
  #   ports:
  #     - "80:80"
  #   command: ["/usr/bin/dumb-init", "/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
  #   dev_overrides:
  #     environment:
  #       - "DEBUG=1"
registries: {}
  # Add optional registries used for deployment. For example:
  #  google:
  #    url: https://gcr.io
  #    namespace: my-cool-project-xxxxxx   
OS / ENVIRONMENT
Ansible Container, version 0.9.1
Darwin, MacBook-Pro-22.lan, 16.6.0, Darwin Kernel Version 16.6.0: Mon Apr 17 17:15:27 PDT 2017; root:xnu-3789.60.24~21/RELEASE_X86_64, x86_64
2.7.13 (default, Dec 18 2016, 07:03:39) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] /Users/xyz/foo/venv/bin/python2.7
{
  "ContainersPaused": 0, 
  "Labels": null, 
  "CgroupDriver": "cgroupfs", 
  "ContainersRunning": 0, 
  "ContainerdCommit": {
    "Expected": "4ab9917febca54791c5f071a9d1f404867857fcc", 
    "ID": "4ab9917febca54791c5f071a9d1f404867857fcc"
  }, 
  "InitBinary": "docker-init", 
  "NGoroutines": 30, 
  "Swarm": {
    "Managers": 0, 
    "ControlAvailable": false, 
    "NodeID": "", 
    "Cluster": {
      "Spec": {
        "TaskDefaults": {}, 
        "Orchestration": {}, 
        "EncryptionConfig": {
          "AutoLockManagers": false
        }, 
        "Raft": {
          "HeartbeatTick": 0, 
          "ElectionTick": 0
        }, 
        "CAConfig": {}, 
        "Dispatcher": {}
      }, 
      "Version": {}, 
      "ID": "", 
      "CreatedAt": "0001-01-01T00:00:00Z", 
      "UpdatedAt": "0001-01-01T00:00:00Z"
    }, 
    "Nodes": 0, 
    "Error": "", 
    "RemoteManagers": null, 
    "LocalNodeState": "inactive", 
    "NodeAddr": ""
  }, 
  "LoggingDriver": "json-file", 
  "OSType": "linux", 
  "HttpProxy": "", 
  "Runtimes": {
    "runc": {
      "path": "docker-runc"
    }
  }, 
  "DriverStatus": [
    [
      "Root Dir", 
      "/var/lib/docker/aufs"
    ], 
    [
      "Backing Filesystem", 
      "extfs"
    ], 
    [
      "Dirs", 
      "49"
    ], 
    [
      "Dirperm1 Supported", 
      "true"
    ]
  ], 
  "OperatingSystem": "Alpine Linux v3.5", 
  "Containers": 5, 
  "HttpsProxy": "", 
  "BridgeNfIp6tables": true, 
  "MemTotal": 2096177152, 
  "SecurityOptions": [
    "name=seccomp,profile=default"
  ], 
  "Driver": "aufs", 
  "IndexServerAddress": "https://index.docker.io/v1/", 
  "ClusterStore": "", 
  "InitCommit": {
    "Expected": "949e6fa", 
    "ID": "949e6fa"
  }, 
  "Isolation": "", 
  "SystemStatus": null, 
  "OomKillDisable": true, 
  "ClusterAdvertise": "", 
  "SystemTime": "2017-06-01T03:37:08.835461445Z", 
  "Name": "moby", 
  "CPUSet": true, 
  "RegistryConfig": {
    "InsecureRegistryCIDRs": [
      "127.0.0.0/8"
    ], 
    "IndexConfigs": {
      "docker.io": {
        "Official": true, 
        "Name": "docker.io", 
        "Secure": true, 
        "Mirrors": null
      }
    }, 
    "Mirrors": []
  }, 
  "DefaultRuntime": "runc", 
  "ContainersStopped": 5, 
  "NCPU": 2, 
  "NFd": 18, 
  "Architecture": "x86_64", 
  "KernelMemory": true, 
  "CpuCfsQuota": true, 
  "Debug": true, 
  "ID": "FUHN:BUXY:4T7P:5YXH:FHVV:Y7EF:GXXT:S33R:QNLR:ERRQ:Z57R:IJIS", 
  "IPv4Forwarding": true, 
  "KernelVersion": "4.9.27-moby", 
  "BridgeNfIptables": true, 
  "NoProxy": "*.local, 169.254/16", 
  "LiveRestoreEnabled": false, 
  "ServerVersion": "17.03.1-ce", 
  "CpuCfsPeriod": true, 
  "ExperimentalBuild": true, 
  "MemoryLimit": true, 
  "SwapLimit": true, 
  "Plugins": {
    "Volume": [
      "local"
    ], 
    "Network": [
      "bridge", 
      "host", 
      "ipvlan", 
      "macvlan", 
      "null", 
      "overlay"
    ], 
    "Authorization": null
  }, 
  "Images": 33, 
  "DockerRootDir": "/var/lib/docker", 
  "NEventsListener": 2, 
  "CPUShares": true, 
  "RuncCommit": {
    "Expected": "54296cf40ad8143b62dbcaa1d90e520a2136ddfe", 
    "ID": "54296cf40ad8143b62dbcaa1d90e520a2136ddfe"
  }
}
{
  "KernelVersion": "4.9.27-moby", 
  "Arch": "amd64", 
  "BuildTime": "2017-03-24T00:00:50.070226199+00:00", 
  "ApiVersion": "1.27", 
  "Version": "17.03.1-ce", 
  "MinAPIVersion": "1.12", 
  "GitCommit": "c6d412e", 
  "Os": "linux", 
  "Experimental": true, 
  "GoVersion": "go1.7.5"
}
SUMMARY

Seems I might be hitting this bug when trying to build a docker image from scratch with ansible installed? pypa/setuptools#964 Note: running molecule init --role foo --driver docker && molecule test works perfectly on my system.

STEPS TO REPRODUCE
ansible-galaxy init foo && cd foo
ansible-container init
ansible-container --debug build
EXPECTED RESULTS

I'd get some kind of success or an error message relevant to my playbook and/or docker configuration.

ACTUAL RESULTS

AnsibleContainerException: Error building conductor image: The command '/bin/sh -c cd /_ansible && pip install -r container/conductor-build/conductor-requirements.txt && PYTHONPATH=. LC_ALL="en_US.UTF-8" python container/conductor-build/setup.py develop -v && ansible-galaxy install -p /etc/ansible/roles -r container/conductor-build/conductor-requirements.yml' returned a non-zero code: 1

Where the debug output shows ImportError: No module named six. The full output is below:

debug-output.txt

@leki75
Copy link
Contributor

leki75 commented Jun 1, 2017

It seems to be a bug in setuptools==36.0.0. See: pypa/setuptools#1042

leki75 pushed a commit to leki75/ansible-container that referenced this issue Jun 1, 2017
The six module is not a dependency of setuptools==36.0.0 that is why
we need to explicitly install it. It is a temporary fix.

Fixes: ansible#569
chouseknecht pushed a commit that referenced this issue Jun 1, 2017
The six module is not a dependency of setuptools==36.0.0 that is why
we need to explicitly install it. It is a temporary fix.

Fixes: #569
@LouisStAmour
Copy link
Author

LouisStAmour commented Jun 1, 2017

Thanks folks. I see now that setuptools 36.0.1 was released to fix this. https:/pypa/setuptools/blob/master/CHANGES.rst (though with this installed, I'm still seeing the error. Will try upgrading ansible-container to include the fix instead.)

Edit: Yep, the above patch fixes it for me when running from source. :)

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

Successfully merging a pull request may close this issue.

2 participants