Hi everyone
When i deploy a container over VS code i get the error:
Error (525) - Docker exception: 400 Client Error for http://127.0.0.1:43155/v1.40/networks/759b43a35340c3fb0356d4d377477cf99e2c2d7442a189f322179c1ab9a5ab9a/connect: Bad Request (“container cannot be disconnected from the host network or connected to host network”)
When i check the running containers in portainer. A new one apears which states that its setup in bridge mode.
Now wehen i remove it and start the container over ssh with the output from “Torizon: export docker command line”:
(docker run --volume /home/torizon/test_camera:/test_camera:rw --network host --publish :6502/tcp test_camera_arm64v8-debian-no-ssh_bullseye_debug_09aa6d9e-6bd7-4c35-a3a4-4f0d7ea2c5b3)
I the container ist running correct in host mode an my application is working.
Any suggestions what i need to do?
Hi @fabian.froehlicher !
Could you please share more information, so we can better understand what is happening?
- Which Verdin iMX8M Plus version?
- Which Carrier board and version?
- Which TorizonCore version?
- Which VS Code version?
- Which version of VS Code Extension for Torizon?
- Which OS are you using on your development machine?
- What kind of VS Code project are you developing for TorizonCore?
- Are any other containers running when you deploy?
- Can you please share the
docker ps
output?
- Please also share the whole output from VS Code.
Best regards,
Just to make sure we understand your description of the issue.
Are you saying that trying to start the container using VS Code doesn’t work and results in that error. But, then starting the container by manually running docker run...
does work. Did we understand that correctly?
Furthermore, does this issue always happen and is reproducible for you? If yes, can you please provide detailed steps on what you are doing starting from creating the VS Code project.
Best Regards,
Jeremias
Hi @henrique.tx
- Well i don’t know which version of Verdin iMX8M Plus version i’m using. Is there a way without disassembling the board?
- With Verdin Development Board with HDMI Version 1.1B
- Torizon Core 5.6.0+build.13
- Torizon Extensio is 1.5.1
- OS is Debian 11
- Created a single makefile based c/c++ project with the torizon extension
- docker ps:
59cd9086ea3f torizon/kiosk-mode-browser "/usr/bin/start-brow…" 20 minutes ago Up 20 minutes torizon_kiosk_1
a98919e6a28f portainer/portainer-ce "/portainer --templa…" 20 minutes ago Up 20 minutes 8000/tcp, 9443/tcp, 0.0.0.0:8840->9000/tcp torizon_portainer_1
6610e48e130e torizon/weston-vivante "/usr/bin/entry.sh" 20 minutes ago Up 20 minutes torizon_weston_1
[06-07 06:37:28.281] Initializing Torizon Extension
[06-07 06:37:28.291] Checking system setup...
[06-07 06:37:28.292] Checking Moses ...
[06-07 06:37:28.321] Starting backend local instance running on port 5001
[06-07 06:37:36.940] Torizon Backend version 1.0.0 API version: 1.1.6
[06-07 06:37:36.941] Torizon IDE backend started
[06-07 06:37:36.941] Checking Docker ...
[06-07 06:37:36.967] Docker version 20.10.17 build a89b842
[06-07 06:37:37.003] Trying connect to Toradex Verdin iMX8M Plus WB on Verdin Development Board(123)
[06-07 06:37:37.656] Active configuration has been selected 09aa6d9e-6bd7-4c35-a3a4-4f0d7ea2c5b3, updating it.
[06-07 06:37:37.657] Initializing Torizon C/C++ application.
[06-07 06:37:37.794] SDK-related features are enabled for this project.
[06-07 06:37:37.809] Torizon: debian arm64v8 bullseye - test_camera - 09aa6d9e-6bd7-4c35-a3a4-4f0d7ea2c5b3
[06-07 06:37:37.810] Torizon Extension Initialized
[06-07 06:37:37.823] LA_OPT_NXP_Software_License v5 January 2019 EULA accepted
[06-07 06:37:49.478] Toradex Verdin iMX8M Plus WB on Verdin Development Board(123) connected
[06-07 06:37:49.479] Torizon: all devices refreshed
[06-07 06:57:49.442] Preparing debug environment for C/C++ application...
[06-07 06:57:49.443] Running preLaunchTask build_debug...
[06-07 06:57:50.565] preLaunchTask completed.
[06-07 06:57:51.370] Selecting device...
[06-07 06:57:51.383] Device 123 selected.
[06-07 06:57:51.383] Updating app configuration...
[06-07 06:57:51.423] Deploying image to device (may take a few minutes)...
[06-07 06:57:51.500] Deploying application to device...
[06-07 06:57:51.814] Restarting application container...
[06-07 06:57:51.819] Image on target is already up to date.
[06-07 06:57:51.933] sending incremental file list
[06-07 06:57:51.933] deleting test_picture.png
[06-07 06:57:51.934] ./
[06-07 06:57:51.934] test_camera
[06-07 06:57:52.122] running startup script...
[06-07 06:57:52.123] Starting new instance...
[06-07 06:57:53.441] Remote docker exception.
[06-07 06:57:53.443] Error (525) - Docker exception: 400 Client Error for http://127.0.0.1:36713/v1.40/networks/759b43a35340c3fb0356d4d377477cf99e2c2d7442a189f322179c1ab9a5ab9a/connect: Bad Request ("container cannot be disconnected from host network or connected to host network")
device:123
Best regards,
Fabian
Hi @jeremias.tx
Yes this is correct and its reproducible.
- Starting VS Code
- Pressing “F1” and Selecting “Torizon/C-C++: Create C/C++ application”
- Enter Name: “forum_question”
- Selecting Folder “~/projects”
- Selecting “Makefile-based project”
- Selecting “arm64v8-debian-no-ssh_bullseye”
- Entering username: “torizon”
- Slecting “debug”
- Pressing “F5”
- Program halts in debug modus at line 7: “printf(“Hello World!\n”);”
- Canceling debugging
- Adding “host” to Configurations → appconfig_0 → networks in the Torizon Extension
- Pressing “F5”
- Getting Error:
[06-07 07:24:25.861] Preparing debug environment for C/C++ application...
[06-07 07:24:25.862] Running preLaunchTask build_debug...
[06-07 07:24:26.551] preLaunchTask completed.
[06-07 07:24:27.456] Selecting device...
[06-07 07:24:27.467] Device 123 selected.
[06-07 07:24:27.468] Updating app configuration...
[06-07 07:24:27.496] Image is not up to date, building it (this may take some time)...
[06-07 07:24:28.344] Step 1/9 : FROM --platform=linux/arm64 torizon/debian:2-bullseye
[06-07 07:24:29.792] ---> 1a47ad880f4f
[06-07 07:24:29.820] Step 2/9 : EXPOSE 6502
[06-07 07:24:29.821] ---> Using cache
[06-07 07:24:29.822] ---> ae5a1352e1d0
[06-07 07:24:29.828] Step 3/9 : ARG SSHUSERNAME=torizon
[06-07 07:24:29.829] ---> Using cache
[06-07 07:24:29.832] ---> 49bc8c9a4b78
[06-07 07:24:29.833] Step 4/9 : ENV DEBIAN_FRONTEND="noninteractive"
[06-07 07:24:29.834] ---> Using cache
[06-07 07:24:29.834] ---> 13ee165d4c18
[06-07 07:24:29.836] Step 5/9 : RUN apt-get -q -y update && apt-get -q -y install gdbserver procps && rm -rf /var/lib/apt/lists/*
[06-07 07:24:29.837] ---> Using cache
[06-07 07:24:29.838] ---> c6dfa622c979
[06-07 07:24:29.839] Step 6/9 : RUN if [ ! -z "" ]; then apt-get -q -y update && apt-get -q -y install && rm -rf /var/lib/apt/lists/* ; fi
[06-07 07:24:29.840] ---> Using cache
[06-07 07:24:29.840] ---> 1f31344692b8
[06-07 07:24:29.843] Step 7/9 : USER torizon
[06-07 07:24:29.844] ---> Using cache
[06-07 07:24:29.845] ---> dddff42f9807
[06-07 07:24:29.845] Step 8/9 : WORKDIR /forum_question
[06-07 07:24:29.846] ---> Using cache
[06-07 07:24:29.846] ---> 95e5f6dde0ab
[06-07 07:24:29.847] Step 9/9 : CMD stdbuf -oL -eL gdbserver 0.0.0.0:6502 /forum_question/forum_question
[06-07 07:24:29.847] ---> Using cache
[06-07 07:24:29.848] ---> 46c366ecda0e
[06-07 07:24:29.848] Successfully built 46c366ecda0e
[06-07 07:24:29.848] Successfully tagged forum_question_arm64v8-debian-no-ssh_bullseye_debug_29942fad-027d-4ccb-9c6c-78b5c24c55e0:latest
[06-07 07:24:29.867] Deploying image to device (may take a few minutes)...
[06-07 07:24:29.969] Deploying application to device...
[06-07 07:24:30.217] Image on target is already up to date.
[06-07 07:24:30.246] Restarting application container...
[06-07 07:24:30.385] sending incremental file list
[06-07 07:24:30.386] forum_question
[06-07 07:24:30.386] sent 137 bytes received 131 bytes 536.00 bytes/sec
[06-07 07:24:30.390] total size is 10,568 speedup is 39.43
[06-07 07:24:30.565] Stopping current instance...
[06-07 07:24:30.608] running startup script...
[06-07 07:24:30.618] Starting new instance...
[06-07 07:24:32.082] Remote docker exception.
[06-07 07:24:32.083] Error (525) - Docker exception: 400 Client Error for http://127.0.0.1:42587/v1.40/networks/759b43a35340c3fb0356d4d377477cf99e2c2d7442a189f322179c1ab9a5ab9a/connect: Bad Request ("container cannot be disconnected from host network or connected to host network")
device:123
- Connecting to Torizon in console with ssh torizon@192.168.100.20 and running “docker ps”:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
37a07c5212f4 46c366ecda0e "/bin/sh -c 'stdbuf …" 4 minutes ago Up 4 minutes 0.0.0.0:32772->6502/tcp forum_question_arm64v8-debian-no-ssh_bullseye_debug_29942fad-027d-4ccb-9c6c-78b5c24c55e0_latest_instance
59cd9086ea3f torizon/kiosk-mode-browser "/usr/bin/start-brow…" 53 minutes ago Up 53 minutes torizon_kiosk_1
a98919e6a28f portainer/portainer-ce "/portainer --templa…" 53 minutes ago Up 53 minutes 8000/tcp, 9443/tcp, 0.0.0.0:8840->9000/tcp torizon_portainer_1
6610e48e130e torizon/weston-vivante "/usr/bin/entry.sh" 53 minutes ago Up 53 minutes torizon_weston_1
Best regards,
Fabian
I believe I know what’s happening here. So I was able to reproduce your issue on my end with your instructions.
Basically you want to run the container in host networking mode. To do this you need to add it to the configuration like so: Torizon Best Practices Guide | Toradex Developer Center
What you did was add it to the networks
option. I believe what happened is that it tried to add your container to a network named “host” rather than trying to run your container in host networking mode. If you configure the extension using the method I linked then this works fine.
Best Regards,
Jeremias
1 Like
@jeremias.tx Thanks a lot! Now it works like a charm 
Best Regards,
Fabian
1 Like
Glad I was able to help clear things up!