tmpnb
tmpnb copied to clipboard
Provide better errors when userland container fails to boot
[I 150427 21:06:32 spawnpool:298] Booting server at [user/JwBPPIPZBTyw], getting HTTP status [599]
[I 150427 21:06:32 spawnpool:298] Booting server at [user/JwBPPIPZBTyw], getting HTTP status [599]
[I 150427 21:06:32 spawnpool:304] Server [user/JwBPPIPZBTyw] at address [127.0.0.1:33279] has booted! Have at it.
[I 150427 21:06:32 spawnpool:251] Proxied path [user/JwBPPIPZBTyw] to port [33279].
[I 150427 21:06:32 spawnpool:257] Adding container [PooledContainer(id=u'5b6ed13712de09b04ea3f0452c518998e47074aeef9dfcd12001dc21ce922a13', path='user/JwBPPIPZBTyw')] to the pool.
Traceback (most recent call last):
File "orchestrate.py", line 245, in <module>
main()
File "orchestrate.py", line 225, in main
ioloop.run_sync(pool.heartbeat)
File "/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py", line 418, in run_sync
return future_cell[0].result()
File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 109, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 631, in run
yielded = self.gen.throw(*sys.exc_info())
File "/srv/tmpnb/spawnpool.py", line 189, in heartbeat
yield tasks
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 628, in run
value = future.result()
File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 109, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 464, in callback
result_list = [i.result() for i in children]
File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 109, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 631, in run
yielded = self.gen.throw(*sys.exc_info())
File "/srv/tmpnb/spawnpool.py", line 227, in _launch_container
container_config=self.container_config)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 628, in run
value = future.result()
File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 109, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 631, in run
yielded = self.gen.throw(*sys.exc_info())
File "/srv/tmpnb/dockworker.py", line 115, in create_notebook_server
container_config.container_port)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 628, in run
value = future.result()
File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 109, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 631, in run
yielded = self.gen.throw(*sys.exc_info())
File "/srv/tmpnb/dockworker.py", line 163, in _with_retries
result = yield fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 628, in run
value = future.result()
File "/usr/local/lib/python2.7/dist-packages/concurrent/futures/_base.py", line 400, in result
return self.__get_result()
File "/usr/local/lib/python2.7/dist-packages/concurrent/futures/_base.py", line 359, in __get_result
reraise(self._exception, self._traceback)
File "/usr/local/lib/python2.7/dist-packages/concurrent/futures/_compat.py", line 107, in reraise
exec('raise exc_type, exc_value, traceback', {}, locals_)
File "/usr/local/lib/python2.7/dist-packages/concurrent/futures/thread.py", line 61, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 736, in port
h_ports = json_['NetworkSettings']['Ports'].get(s_port + '/udp')
AttributeError: 'NoneType' object has no attribute 'get'
When I first saw this error, I thought maybe we were out of sync with docker-py or the Docker API.
Instead, this happened when a container failed to boot. Command wasn't available (ipython3 in this case).