GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
811 stars 263 forks source link

Nightly build 1.5: Errors when starting docker containers #405

Closed AJNOURI closed 8 years ago

AJNOURI commented 8 years ago

I observe this with different images ajnouri/dockervpc and phusion/baseimage.

Inserted both devices to the topology docker ps -a

docker ps -a
CONTAINER ID        IMAGE                      COMMAND             CREATED             STATUS              PORTS               NAMES
61500dcd9f4d        phusion/baseimage:latest   "/bin/bash"         3 seconds ago       Created                                 insane_snyder
6bdcd07e5847        ajnouri/dockervpc:latest   "/sbin/my_init"     7 seconds ago       Created                                 suspicious_snyder

Ater pushing start, both containers are up: docker ps -a

CONTAINER ID        IMAGE                      COMMAND             CREATED              STATUS              PORTS               NAMES
61500dcd9f4d        phusion/baseimage:latest   "/bin/bash"         About a minute ago   Up 5 seconds                            insane_snyder
6bdcd07e5847        ajnouri/dockervpc:latest   "/sbin/my_init"     About a minute ago   Up 5 seconds                            suspicious_snyder

And can attach a console to the one started with /bin/bash

docker attach 61500dcd9f4d root@61500dcd9f4d:/# root@61500dcd9f4d:/#

Here is the last nightly build showing a 0.9.0

unzip -l GNS3-1.5.0dev1.source.zip

Archive:  GNS3-1.5.0dev1.source.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
  1013203  2016-01-20 00:35   dynamips-0.2.14.zip
    86796  2016-01-20 00:35   iouyap-0.97.zip
    47936  2016-01-20 00:35   ubridge-0.9.0.zip
   153350  2016-01-20 00:35   vpcs-0.6.1.zip
   509696  2016-01-20 00:35   gns3-server-1.5.2016-01-20.zip
  6220442  2016-01-20 00:35   gns3-gui-1.5.2016-01-20.zip
---------                     -------
  8031423                     6 files

/usr/local/bin/ubridge -v

ubridge version 0.9.0

log

2016-01-22 16:28:13 INFO docker_vm.py:147 Docker container 'phusion/baseimage-1' [c49f820a-3b2e-445c-93a7-5040f9f223a6] created
2016-01-22 16:28:58 INFO base_vm.py:326 Starting new uBridge hypervisor 127.0.0.1:52522
2016-01-22 16:28:58 ERROR route.py:189 VM error detected: <class 'gns3server.ubridge.ubridge_error.UbridgeError'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/web/route.py", line 179, in control_schema
    yield from func(request, response)
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/handlers/api/docker_handler.py", line 101, in start
    yield from container.start()
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/modules/docker/docker_vm.py", line 168, in start
    yield from self._start_ubridge()
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/modules/base_vm.py", line 327, in _start_ubridge
    yield from self._ubridge_hypervisor.start()
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/ubridge/hypervisor.py", line 142, in start
    yield from self._check_ubridge_version()
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/ubridge/hypervisor.py", line 130, in _check_ubridge_version
    raise UbridgeError("uBridge executable version must be >= 0.9.1")
gns3server.ubridge.ubridge_error.UbridgeError: uBridge executable version must be >= 0.9.1
2016-01-22 16:29:31 INFO docker_vm.py:481 Docker container "ajnouri/dockervpc-1" [a1769ff0-f8cf-4a83-a651-a4ad56d4a5bb]: number of Ethernet adapters changed to 1
2016-01-22 16:29:31 INFO docker_vm.py:147 Docker container 'ajnouri/dockervpc-1' [a1769ff0-f8cf-4a83-a651-a4ad56d4a5bb] created
2016-01-22 16:29:36 INFO base_vm.py:326 Starting new uBridge hypervisor 127.0.0.1:54632
2016-01-22 16:29:36 ERROR route.py:189 VM error detected: <class 'gns3server.ubridge.ubridge_error.UbridgeError'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/web/route.py", line 179, in control_schema
    yield from func(request, response)
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/handlers/api/docker_handler.py", line 101, in start
    yield from container.start()
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/modules/docker/docker_vm.py", line 168, in start
    yield from self._start_ubridge()
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/modules/base_vm.py", line 327, in _start_ubridge
    yield from self._ubridge_hypervisor.start()
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/ubridge/hypervisor.py", line 142, in start
    yield from self._check_ubridge_version()
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/ubridge/hypervisor.py", line 130, in _check_ubridge_version
    raise UbridgeError("uBridge executable version must be >= 0.9.1")
gns3server.ubridge.ubridge_error.UbridgeError: uBridge executable version must be >= 0.9.1
2016-01-22 16:30:48 ERROR route.py:189 VM error detected: <class 'gns3server.modules.docker.docker_error.DockerError'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/web/route.py", line 179, in control_schema
    yield from func(request, response)
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/handlers/api/docker_handler.py", line 101, in start
    yield from container.start()
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/modules/docker/docker_vm.py", line 166, in start
    result = yield from self.manager.query("POST", "containers/{}/start".format(self._cid))
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/modules/docker/__init__.py", line 73, in query
    response = yield from self.http_query(method, path, data=data, params=params)
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/modules/docker/__init__.py", line 108, in http_query
    raise DockerError("Docker has returned an error: {}".format(body))
gns3server.modules.docker.docker_error.DockerError: Docker has returned an error: b''
2016-01-22 16:30:56 ERROR route.py:189 VM error detected: <class 'gns3server.modules.docker.docker_error.DockerError'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/web/route.py", line 179, in control_schema
    yield from func(request, response)
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/handlers/api/docker_handler.py", line 101, in start
    yield from container.start()
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/modules/docker/docker_vm.py", line 166, in start
    result = yield from self.manager.query("POST", "containers/{}/start".format(self._cid))
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/modules/docker/__init__.py", line 73, in query
    response = yield from self.http_query(method, path, data=data, params=params)
  File "/usr/local/lib/python3.4/dist-packages/gns3_server-1.5.0dev1-py3.4.egg/gns3server/modules/docker/__init__.py", line 108, in http_query
    raise DockerError("Docker has returned an error: {}".format(body))
gns3server.modules.docker.docker_error.DockerError: Docker has returned an error: b''
julien-duponchelle commented 8 years ago

Now it should raise a clean warning everytime. I'm cleaning the docker support. A lot of stuff seem to not working properly.

AJNOURI commented 8 years ago

When starting docker container, nightly build of 2016-02-08 still checking for non existing ubridge version 0.9.3

/usr/local/bin/ubridge -v ubridge version 0.9.0

Messed with https://github.com/GNS3/gns3-server/blob/master/gns3server/ubridge/hypervisor.py by changing "0.9.3" to "0.9.0"

Now showing

2016-02-09 08:27:57 INFO docker_vm.py:48 Docker image instance is being created 2016-02-09 08:27:57 INFO docker_vm.py:265 Docker container ajnouri/dockervpc-1 is loading 2016-02-09 08:27:57 INFO project.py:290 Server project path is /home/ajn/GNS3/projects/simple-voip 2016-02-09 08:27:57 INFO vm.py:157 IOU1 setting up and updating startup_config from '' to 'startup-config.cfg' 2016-02-09 08:27:57 INFO vm.py:157 IOU1 setting up and updating md5sum from '' to '2eabae17778316c49cbc80e8e81262f9' 2016-02-09 08:27:57 INFO vm.py:157 IOU1 setting up and updating console from 'None' to '2001' 2016-02-09 08:27:57 INFO vm.py:157 IOU1 setting up and updating private_config from '' to 'private-config.cfg' 2016-02-09 08:27:57 INFO vm.py:157 IOU1 setting up and updating path from '' to 'i86bi-linux-l3-adventerprisek9-15.4.1T.bin' 2016-02-09 08:27:57 INFO iou_device.py:476 IOU device IOU1 has been loaded 2016-02-09 08:27:58 INFO vm.py:157 ajnouri/dockervpc-1 setting up and updating environment from '' to 'None' 2016-02-09 08:27:58 INFO vm.py:157 ajnouri/dockervpc-1 setting up and updating console from 'None' to '2002' 2016-02-09 08:27:58 INFO vm.py:157 ajnouri/dockervpc-1 setting up and updating start_command from '' to '/bin/bash' 2016-02-09 08:27:58 INFO docker_vm.py:290 Docker container ajnouri/dockervpc-1 has been loaded 2016-02-09 08:27:58 INFO link.py:57 adding link from ajnouri/dockervpc-1 Ethernet0 to IOU1 Ethernet0/0 2016-02-09 08:27:58 INFO topology.py:931 Topology initialized 2016-02-09 08:28:01 INFO vm.py:121 IOU1 has started 2016-02-09 08:28:11 INFO http_client.py:658 Response error: Error downloading http://Thswfu0Hstf0xInRfWeHvpVJ44xeNOeiDgswmQkaaHgOcF72lzmgtCeXktygxxdT@127.0.0.1:8000/v1/projects/226c628a-2600-470c-b095-450ccc4ba685/docker/vms/56f87547-0b3f-4df7-8cda-626559d534b9/start - server replied: Conflict (error: 299) 2016-02-09 08:28:11 ERROR vm.py:118 error while starting ajnouri/dockervpc-1: Couldn't connect to hypervisor on 127.0.0.1:57809 :[Errno 111] Connect call failed ('127.0.0.1', 57809)

Is that related to port redirection you mentioned here gns3-gui/issues/947?

julien-duponchelle commented 8 years ago

Ubridge 0.9.3 is available here: https://github.com/GNS3/ubridge/releases/tag/v0.9.3

Without it you can't use Docker.

AJNOURI commented 8 years ago

OK, Thanks Julien.