Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoneType is not callable when ctrl-c twice for kill #620

Closed
fables-tales opened this issue Nov 5, 2014 · 8 comments
Closed

NoneType is not callable when ctrl-c twice for kill #620

fables-tales opened this issue Nov 5, 2014 · 8 comments

Comments

@fables-tales
Copy link

^CGracefully stopping... (press Ctrl+C again to force)
Stopping kya_workercorpus_1...
^CKilling kya_workercorpus_1...
Killing kya_wordpress_1...
Killing kya_mysqldb_1...
Killing kya_redis_1...
Killing kya_db_1...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/threading", line 810, in __bootstrap_inner
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/threading", line 763, in run
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.cli.multiplexer", line 41, in _enqueue_output
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.cli.log_printer", line 56, in _make_log_generator
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.container", line 127, in wait
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.packages.docker.client", line 764, in wait
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.packages.docker.client", line 65, in _post
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/requests.sessions", line 425, in post
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/requests.sessions", line 383, in request
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/requests.sessions", line 486, in send
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/requests.adapters", line 391, in send
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/requests.adapters", line 167, in build_response
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/requests.models", line 526, in __init__
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/requests.structures", line 69, in __init__
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/_abcoll", line 540, in update
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/abc", line 144, in __instancecheck__
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/abc", line 174, in __subclasscheck__
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/_weakrefset", line 59, in __iter__
TypeError: 'NoneType' object is not callable

got this error when trying to shut down my project.

@chriscohoat
Copy link

I'm also getting this error pretty regularly now. Have tried rebuilding with fig build --no-cache, tried removing all Docker containers/images, etc. I get the same error when trying to run fig up.

Christophers-MacBook-Pro-2:nodejs-nginx chris$ fig up
Recreating nodejsnginx_mongodb_1...
Recreating nodejsnginx_elasticsearch_1...
Creating nodejsnginx_web_1...
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.cli.main", line 31, in main
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.cli.docopt_command", line 21, in sys_dispatch
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.cli.command", line 28, in dispatch
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.cli.docopt_command", line 24, in dispatch
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.cli.command", line 51, in perform_command
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.cli.main", line 416, in up
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.project", line 175, in up
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.service", line 196, in recreate_containers
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.service", line 176, in create_container
  File "/Users/ben/fig/build/fig/out00-PYZ.pyz/fig.service", line 363, in _get_container_create_options
TypeError: 'NoneType' object is not iterable

@dnephin
Copy link

dnephin commented Nov 6, 2014

@chriscohoat I believe this is unrelated to the original issue (very different stack traces), but is possibly easier to track down. Could you paste your fig.yml?

I suspect you have something like volumes: (with no value), which is realted to #129 (improve validation of the fig.yml).

@dnephin
Copy link

dnephin commented Nov 6, 2014

@samphippen is this something you're able to reproduce, or a one-time occurrence? From the stack trace it looks like an error pretty deep in a core module. Did it end up killing all the containers or did this crash prevent it from killing some?

@chriscohoat
Copy link

@samphippen you are absolutely correct, my fig.yml had volumes: with no value. If you want me to remove my comment to keep this issue clean let me know. Thanks!

@jamshid
Copy link

jamshid commented Mar 3, 2015

Yes, in my case, I had an empty environment in fig.yml. Feeding google with the new docker-compose stack trace.

  environment:
    - 
$ docker-compose up -d
Creating foo_test_1...
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 445, in up
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.project", line 184, in up
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 259, in recreate_containers
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 227, in create_container
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 453, in _get_container_create_options
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 640, in merge_environment
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 640, in <genexpr>
  File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 648, in split_env
TypeError: argument of type 'NoneType' is not iterable

@bastibense
Copy link

I think I found a similar issue with docker-compose. Let me know if not directly related and I'll open a separate issue.

$ docker-compose up
Traceback (most recent call last):
  File "/usr/local/Cellar/fig/1.2.0/libexec/bin/docker-compose", line 9, in <module>
    load_entry_point('docker-compose==1.2.0', 'console_scripts', 'docker-compose')()
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/cli/main.py", line 31, in main
    command.sys_dispatch()
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/cli/docopt_command.py", line 21, in sys_dispatch
    self.dispatch(sys.argv[1:], None)
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/cli/command.py", line 27, in dispatch
    super(Command, self).dispatch(*args, **kwargs)
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/cli/docopt_command.py", line 24, in dispatch
    self.perform_command(*self.parse(argv, global_options))
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/cli/command.py", line 57, in perform_command
    verbose=options.get('--verbose'))
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/cli/command.py", line 76, in get_project
    config.load(config_path),
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/config.py", line 55, in load
    return from_dictionary(load_yaml(filename), working_dir=working_dir, filename=filename)
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/config.py", line 65, in from_dictionary
    service_dict = loader.make_service_dict(service_name, service_dict)
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/config.py", line 89, in make_service_dict
    return process_container_options(service_dict, working_dir=self.working_dir)
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/config.py", line 175, in process_container_options
    service_dict['build'] = resolve_build_path(service_dict['build'], working_dir=working_dir)
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/config.py", line 342, in resolve_build_path
    _path = expand_path(working_dir, build_path)
  File "/usr/local/Cellar/fig/1.2.0/libexec/lib/python2.7/site-packages/compose/config.py", line 383, in expand_path
    return os.path.abspath(os.path.join(working_dir, path))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 75, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

and my docker-compose.yml looked like this:

db:
  image: postgres

portal:
  build:
  links:
    - db
  ports:
    - "8000:8000"
  volumes:
    - .:/

It seems to work fine when I add a period (.) after build: like this:

db:
  image: postgres

portal:
  build: .
  links:
    - db
  ports:
    - "8000:8000"
  volumes:
    - .:/

@li0nel
Copy link

li0nel commented Sep 17, 2015

Got the same problem, reinstalled compose and boot2docker, but it was just a malformed docker-compose.yml...

@dnephin
Copy link

dnephin commented Sep 18, 2015

There area few different issues being reported here.

The config validation issues should be resolved by #129 in the 1.5.0 release.
The original issue was most likely a bug in requests, which we've upgraded a couple times since this issue was created.

@dnephin dnephin closed this as completed Sep 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants