-
Notifications
You must be signed in to change notification settings - Fork 47
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
docker move_to_ns issue (GNS3 2.2.19 - Gentoo Linux) #74
Comments
Have you check you have the correct capabilities/rights?
If not, set using this command:
|
Hello @grossmj, Thanks for answering. The output seems a bit different: gentoolinux /home/gab # getcap /usr/bin/ubridge The differences seem related only to output format, is it ok? |
It looks fine. The error I am not a Gentoo expert but maybe the Kernel wasn't compiled with Netlink support or something similar? https://packages.gentoo.org/useflags/netlink |
The link you provided is related to the USE flags. Regarding kernel support, I filtered my kernel config and found the output below:
Please let me know I should enable any flag is not enabled at all. |
Hello @grossmj I'm maintaining the gns3 packages at gentoo and i was looking into this problem for some time now. Actually i don't really have an idea were the problem come from. Checking the packages from both distros I saw that the Qt version is different. While gentoo and opensuse are already on 5.15, ubuntu still uses 5.14, which is why i was wondering if the Qt version could be the issue here? |
I doubt Qt has anything to do with it. The move_to_ns command basically moves an interface to a Linux namespace: https://github.com/GNS3/ubridge#docker-module-docker I am still suspecting something isn't enabled or any other kind of restrictions, maybe checking this could help: https://wiki.gentoo.org/wiki/Docker#Kernel Also, please try to manually create a network namespace and add a veth pair like this:
There is a problem with netlink if you get any RTNETLINK errors. This would help to isolate the issue. Thanks 👍 |
Hi @grossmj, No issues while running the commands you provided: gentoolinux /home/gab # ip netns add test |
Thanks, this must mean there is nothing wrong with netlink itself. Let's try to use uBridge to manually add an interface to a Docker container. 1 - Start a Docker container
2 - Find the Pid of the container Now that the container is running, we need it's ID.
Then we can use the container ID to find the Pid
3 - Run uBridge in hypervisor mode Start uBridge to listen on port 4242 (with the same user you would use to run the GNS3 server).
4 - Create a TAP interface and move it to Docker container Then use telnet to connect to port 4242 and issue commands (replace the container Pid 308036 by the one from your container):
Now I expect you would get the error right after you enter the |
Hi, i've just tried the steps on my system to see what the problem is. Unfortunately i didn't got any error back when running the command on the cli. alpine:
ehlers/ostinato:
I even checked in the docker image if the interface was really there:
Seems to be fine. Trying again with |
The docker move_to_ns error message is also shown, when during the setup of the bridge the docker container dies. So your issue might have nothing to do with ubridge. I suggest to have a look at the logs of the docker container. Use
In my example the container dies early with "exec format error". Even though this error has nothing to do with an ubridge issue, I get the same log messages as you with all that ubridge stuff. |
I'm currently investigating the same behaviour on Debian 11.5 & podman (instead of Docker, but exposing the same interface through the appropriate socket). The GNS3 server erroneously sends back the container's stdout as error message to the GNS3 client, but further investigation into the logs show that the containers do come up, but ubridge fails during The capabilities are set correctly on the ubridge binary, and I've confirmed that it makes no difference whether the ubridge hypervisor runs under a normal user or root. Interestingly I've encountered the kernel message "A link change request failed with some changes committed already." during troubleshooting, which may help to pinpoint what exactly the cause is here, but I don't yet have a reliable repro for that. Edit: I should highlight that in my case, I do indeed get an error immediately after |
Update: Upon further investigating, it seems that GNS3 is attempting the |
Hi guys,
I am experiencing some problems while trying to bring up a docker container within GNS3. After running gns3server with '-d' I found the output:
2021-03-24 19:01:48 ERROR route.py:242 Uncaught exception detected: <class 'KeyError'>
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/gns3server/compute/base_node.py", line 631, in _ubridge_send
await self._ubridge_hypervisor.send(command)
File "/usr/lib/python3.8/site-packages/gns3server/utils/asyncio/init.py", line 163, in wrapper
return await f(oself, *args, **kwargs)
File "/usr/lib/python3.8/site-packages/gns3server/ubridge/ubridge_hypervisor.py", line 259, in send
raise UbridgeError(data[-1][4:])
gns3server.ubridge.ubridge_error.UbridgeError: could not complete netlink transaction
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/gns3server/compute/docker/docker_vm.py", line 914, in _add_ubridge_connection
await self._ubridge_send('docker move_to_ns {ifc} {ns} eth{adapter}'.format(ifc=adapter.host_ifc,
File "/usr/lib/python3.8/site-packages/gns3server/compute/base_node.py", line 633, in _ubridge_send
raise UbridgeError("Error while sending command '{}': {}: {}".format(command, e, self._ubridge_hypervisor.read_stdout()))
gns3server.ubridge.ubridge_error.UbridgeError: Error while sending command 'docker move_to_ns tap-gns3-e0 27347 eth0': could not complete netlink transaction: uBridge version 0.9.18 running with libpcap version 1.10.0 (with TPACKET_V3)
Hypervisor TCP control server started (IP 0.0.0.0 port 36283).
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/gns3server/compute/docker/docker_vm.py", line 478, in start
await self._add_ubridge_connection(nio, adapter_number)
File "/usr/lib/python3.8/site-packages/gns3server/compute/docker/docker_vm.py", line 918, in _add_ubridge_connection
raise UbridgeNamespaceError(e)
gns3server.ubridge.ubridge_error.UbridgeNamespaceError: Error while sending command 'docker move_to_ns tap-gns3-e0 27347 eth0': could not complete netlink transaction: uBridge version 0.9.18 running with libpcap version 1.10.0 (with TPACKET_V3)
Hypervisor TCP control server started (IP 0.0.0.0 port 36283).
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/gns3server/web/route.py", line 198, in control_schema
await func(request, response)
File "/usr/lib/python3.8/site-packages/gns3server/handlers/api/compute/docker_handler.py", line 89, in start
await container.start()
File "/usr/lib/python3.8/site-packages/gns3server/compute/docker/docker_vm.py", line 484, in start
logdata = await self._get_log()
File "/usr/lib/python3.8/site-packages/gns3server/compute/docker/docker_vm.py", line 1141, in _get_log
result = await self.manager.query("GET", "containers/{}/logs".format(self._cid), params={"stderr": 1, "stdout": 1})
File "/usr/lib/python3.8/site-packages/gns3server/compute/docker/init.py", line 114, in query
if response.headers['CONTENT-TYPE'] == 'application/json':
KeyError: 'CONTENT-TYPE'
I've executed ubridge hypervisor mode and accessed it by telnet. The docker move_to_ns command does not work in my environment. Please, could someone help to fix this?
Thanks in advance
Regards
The text was updated successfully, but these errors were encountered: