compose icon indicating copy to clipboard operation
compose copied to clipboard

docker-compose up for running containers gives error 'NoneType' object has no attribute 'get'

Open Sciencegeek123 opened this issue 8 years ago • 6 comments

I have a running application and need to update 1 of the containers without taking the whole set down. I run:

docker-compose kill bp-proxy docker-compose up

The result is:

[ec2-user@ip-10-0-1-91 eve-moon]$ docker-compose up
evemoon_bp-redis_1 is up-to-date
Recreating 11630199370e_11630199370e_11630199370e_11630199370e_evemoon_bp-proxy_1 ...
evemoon_bp-mongo_1 is up-to-date
evemoon_bp-maria_1 is up-to-date

ERROR: for 11630199370e_11630199370e_11630199370e_11630199370e_evemoon_bp-proxy_1  'NoneType' object has no attribute 'get'

ERROR: for bp-proxy  'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/local/bin/docker-compose", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/compose/cli/main.py", line 71, in main
    command()
  File "/usr/local/lib/python2.7/site-packages/compose/cli/main.py", line 124, in perform_command
    handler(command, command_options)
  File "/usr/local/lib/python2.7/site-packages/compose/cli/main.py", line 959, in up
    start=not no_start
  File "/usr/local/lib/python2.7/site-packages/compose/project.py", line 479, in up
    get_deps,
  File "/usr/local/lib/python2.7/site-packages/compose/parallel.py", line 80, in parallel_execute
    raise error_to_reraise
AttributeError: 'NoneType' object has no attribute 'get'

OS: Amazon Linux AMI release 2017.09

My compose file:

version: '3.3'

networks:
  prod-network:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.32.0.0/16

volumes:
  maria-data:
  redis-data:
  mongo-data:
  www-data:
  static-data:

services:
  bp-proxy:
    image: nginx:1.13-alpine
    restart: always
    ports:
      - 10.0.1.22:80:1080
      - 10.0.1.22:443:1443
      - 10.0.1.73:80:2080
      - 10.0.1.73:443:2443
      - 10.0.1.91:80:3080
      - 10.0.1.91:443:3443
      - 10.0.1.176:80:4080
      - 10.0.1.176:443:4443
      - 10.0.1.212:80:5080
      - 10.0.1.212:443:5443
    networks:
      - prod-network
    volumes:
      - type: bind
        source: /opt/eve-moon/configuration/nginx/
        target: /etc/nginx/
      - type: bind
        source: /opt/eve-moon/www/
        target: /www/
      - type: bind
        source: /opt/eve-moon/static/
        target: /static/
      - type: bind
        source: /opt/eve-moon/ts3/
        target: /ts3/
      - type: bind
        source: /opt/eve-moon/secure/
        target: /secure/
      - type: bind
        source: /opt/eve-moon/api/
        target: /api/
  bp-mongo:
    image: mongo
    restart: always
    networks:
      - prod-network
    volumes:
      - type: volume
        source: redis-data
        target: /data
  bp-redis:
    image: redis
    restart: always
    networks:
      - prod-network
    volumes:
      - type: volume
        source: mongo-data
        target: /data/db
      - type: bind
        source: /opt/eve-moon/configuration/redis.conf
        target: /usr/local/etc/redis/redis.conf
  bp-maria:
    image: mariadb
    restart: always
    networks:
      - prod-network
    volumes:
      - type: volume
        source: maria-data
        target: /var/lib/mysql
      - type: bind
        source: /opt/eve-moon/configuration/redis.conf
        target: /usr/local/etc/redis/redis.conf

pip freeze

[ec2-user@ip-10-0-1-91 eve-moon]$ pip freeze
aws-cfn-bootstrap==1.4
awscli==1.14.18
Babel==0.9.4
backports.ssl-match-hostname==3.5.0.1
boto==2.48.0
botocore==1.8.22
cached-property==1.3.1
certifi==2017.11.5
chardet==3.0.4
cloud-init==0.7.6
colorama==0.3.7
configobj==4.7.2
docker==2.7.0
docker-compose==1.18.0
docker-pycreds==0.2.1
dockerpty==0.4.1
docopt==0.6.2
docutils==0.14
ecdsa==0.11
enum34==1.1.6
functools32==3.2.3.post2
futures==3.2.0
hibagent==1.0.0
idna==2.6
iniparse==0.3.1
ipaddress==1.0.19
Jinja2==2.7.2
jmespath==0.9.3
jsonpatch==1.2
jsonpointer==1.0
jsonschema==2.6.0
kitchen==1.1.1
lockfile==0.8
MarkupSafe==0.11
paramiko==1.15.1
PIL==1.1.6
ply==3.4
pyasn1==0.4.2
pycrypto==2.6.1
pycurl==7.19.0
pygpgme==0.3
pyliblzma==0.5.3
pystache==0.5.3
python-daemon==1.5.2
python-dateutil==2.6.1
pyxattr==0.5.0
PyYAML==3.12
requests==2.18.4
rsa==3.4.2
s3transfer==0.1.12
simplejson==3.6.5
six==1.11.0
texttable==0.9.1
urlgrabber==3.10
urllib3==1.22
virtualenv==15.1.0
websocket-client==0.46.0
yum-metadata-parser==1.1.4

Sciencegeek123 avatar Jan 14 '18 07:01 Sciencegeek123

This was actually caused by an issue in my docker-compose. The bind for bp-proxy was wrong. When I took everything down and put it up, docker-compose told me the actual error.

I'm leaving this open for someone else to close however, because it would have been more useful for docker-compose to report the full error.

Sciencegeek123 avatar Jan 14 '18 08:01 Sciencegeek123

Thanks for the report! As a side-note, docker-compose up --force-recreate bp-proxy should work well if you're only looking to regenerate containers for 1 service.

I'll look into the issue of that error message.

shin- avatar Jan 16 '18 21:01 shin-

I believe this was fixed in 1.20.

shin- avatar Mar 29 '18 22:03 shin-

@shin- It is still happening here with docker-compose version 1.18.0, build 8dd22a9

Xplouder avatar Apr 08 '18 21:04 Xplouder

1.18 is no longer supported.

shin- avatar Apr 08 '18 22:04 shin-

Same error occurring on current versions of docker and docker-compose

naveedkamran avatar Mar 26 '19 16:03 naveedkamran