Compose: AttributeError: 'module' object has no attribute 'get_config_header'

Created on 19 Jan 2017  路  7Comments  路  Source: docker/compose

docker-compose up -d is not working if the image does not exist.

VERSION

# docker-compose --version
docker-compose version 1.10.0, build 4bd6f1a

# docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 18
Server Version: 1.13.0
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 29
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e
runc version: 2f7393a47307a16f8cee44a37b262e8b81021e3e
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-59-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.56 GiB
Name: sanyamkapoor
ID: ZUHM:M4Y7:CJRY:RPGF:W73H:M4CN:EOLW:23OG:5U7H:UPT3:ITKV:Q2U4
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

docker-compose.yml

version: '2'

services:
  rabbit:
    image: rabbitmq:3-management
    container_name: my_rabbitmq
    restart: always
    networks:
      mynet:
        ipv4_address: 172.12.23.11
    ports:
      - "5672:5672"
      - "15672:15672"
    volumes:
      - "./.data/rabbitmq:/var/lib/rabbimq:rw"
    environment:
      RABBITMQ_DEFAULT_USER: 'guest'
      RABBITMQ_DEFAULT_PASS: 'guest'
      RABBITMQ_DEFAULT_VHOST: '/'

networks:
  mynet:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.12.23.0/24
          gateway: 172.12.23.1

ERROR LOG

Pulling rabbit (rabbitmq:3-management)...
Traceback (most recent call last):
  File "/usr/local/bin/docker-compose", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 64, in main
    command()
  File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 116, in perform_command
    handler(command, command_options)
  File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 848, in up
    remove_orphans=remove_orphans)
  File "/usr/local/lib/python2.7/dist-packages/compose/project.py", line 389, in up
    svc.ensure_image_exists(do_build=do_build)
  File "/usr/local/lib/python2.7/dist-packages/compose/service.py", line 312, in ensure_image_exists
    self.pull()
  File "/usr/local/lib/python2.7/dist-packages/compose/service.py", line 878, in pull
    output = self.client.pull(repo, tag=tag, stream=True)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/image.py", line 333, in pull
    header = auth.get_config_header(self, registry)
AttributeError: 'module' object has no attribute 'get_config_header'

STEPS TO REPRODUCE

  1. Delete the image from host
  2. Run docker-compose up -d
duplicate kinbug

Most helpful comment

@mbroomfield-r7 Try the following: pip uninstall docker docker-py ; pip install docker==2.0.1

All 7 comments

What's the output of pip freeze (assuming you installed Compose using pip)?

I'm seeing this with the most recent versions of docker and docker-compose

mbroomfield@CAM-P500-mbroomfield:~/Workspace/docker-autocompose$ pip freeze
arrow==0.10.0
astroid==1.4.9
awscli==1.11.39
backports.ssl-match-hostname==3.5.0.1
boto==2.45.0
boto3==1.4.4
botocore==1.5.2
cached-property==1.3.0
cassandra-driver==3.7.1
cffi==1.9.1
chardet==2.3.0
colorama==0.3.7
cql==1.4.0
cryptography==1.7.1
decorator==4.0.11
docker==2.0.1
docker-compose==1.10.0
docker-py==1.10.6
docker-pycreds==0.2.1
dockerpty==0.4.1
docopt==0.6.2
docutils==0.13.1
ecdsa==0.13
elasticsearch==5.1.0
Fabric==1.13.1
feedparser==5.2.1
friends==0.1
httplib2==0.9.2
idna==2.2
IPy==0.83
isort==4.2.5
jmespath==0.9.0
jsonschema==2.5.1
lazy-object-proxy==1.2.2
lxml==3.7.2
mccabe==0.5.3
names==0.3.0
netaddr==0.7.19
networkx==1.11
oauthlib==2.0.1
paramiko==2.1.1
peewee==2.8.5
pika==0.10.0
prettytable==0.7.2
protobuf==3.1.0.post1
protobuf-to-dict==0.1.0
pyasn1==0.1.9
pycparser==2.17
pycrypto==2.6.1
PyGithub==1.29
pygobject==3.12.0
pylint==1.6.4
pystache==0.5.4
python-apt===0.9.3.5ubuntu2
python-dateutil==2.6.0
python-debian==0.1.28
python-gnupg==0.3.9
PyYAML==3.12
redis==2.10.5
requests==2.11.1
rsa==3.4.2
s3transfer==0.1.10
six==1.10.0
texttable==0.8.7
thrift==0.10.0
unity-scope-audacious==0.1
unity-scope-calculator==0.1
unity-scope-chromiumbookmarks==0.1
unity-scope-clementine==0.1
unity-scope-colourlovers==0.1
unity-scope-devhelp==0.1
unity-scope-firefoxbookmarks==0.1
unity-scope-gdrive==0.7
unity-scope-gmusicbrowser==0.1
unity-scope-gourmet==0.1
unity-scope-guayadeque==0.1
unity-scope-manpages==0.1
unity-scope-musique==0.1
unity-scope-openclipart==0.1
unity-scope-texdoc==0.1
unity-scope-tomboy==0.1
unity-scope-virtualbox==0.1
unity-scope-yelp==0.1
unity-scope-zotero==0.1
urllib3==1.20
virtualenv==15.1.0
websocket-client==0.40.0
wrapt==1.10.8

@mbroomfield-r7 Try the following: pip uninstall docker docker-py ; pip install docker==2.0.1

@shin- that fixed the problem for me

Glad to hear it!

As this is a duplicate of #4344 , I'll be closing this - if new questions arise feel free to comment on that other thread.

+1
pip install docker-compose==1.9.0
its work for me

We do not recommend downgrading. A better solution has already been provided here: https://github.com/docker/compose/issues/4356#issuecomment-273928911

Was this page helpful?
0 / 5 - 0 ratings