Errors 500 and 525

Hi, when trying to debug from VS code with the Torizon extension I get the following errors:

[08-01 19:42:01.782] Initializing Torizon Extension
[08-01 19:42:01.789] Checking system setup...
[08-01 19:42:01.790] Checking Moses ...
[08-01 19:42:01.804] Starting backend local instance running on port 5001
[08-01 19:42:06.698] Torizon Backend version 1.0 API version: 1.0
[08-01 19:42:06.698] Torizon IDE backend started
[08-01 19:42:06.698] Checking Docker ...
[08-01 19:42:06.726] Docker version 20.10.8 build 75249d8
[08-01 19:42:06.762] Trying connect to Toradex Colibri iMX6DL/S on Colibri Evaluation Board V3(10672463)
[08-01 19:42:07.220] Active configuration has been selected c684fc6b-7960-49f5-b66b-dab773632e1c, updating it.
[08-01 19:42:07.221] Initializing Torizon C/C++ application.
[08-01 19:42:07.844] SDK-related features are enabled for this project.
[08-01 19:42:07.854] Torizon: Qt5 arm32v7 bullseye - qtest - c684fc6b-7960-49f5-b66b-dab773632e1c
[08-01 19:42:07.870] LA_OPT_NXP_Software_License v5 January 2019 EULA accepted
[08-01 19:42:20.877] Toradex Colibri iMX6DL/S on Colibri Evaluation Board V3(10672463) connected
[08-01 19:42:20.877] Torizon: all devices refreshed
[08-01 19:42:55.953] Preparing debug environment for C/C++ application...
[08-01 19:42:55.954] Running preLaunchTask build_debug...
[08-01 19:43:02.906] preLaunchTask completed.
[08-01 19:43:03.766] Selecting device...
[08-01 19:43:03.777] Device 10672463 selected.
[08-01 19:43:03.777] Updating app configuration...
[08-01 19:43:03.802] Image is not up to date, building it (this may take some time)...
[08-01 19:43:04.009] Step 1/10 : FROM --platform=linux/arm torizon/qt5-wayland:2
[08-01 19:43:05.945] ---> 6d58cb6a5dd3
[08-01 19:43:05.950] Step 2/10 : EXPOSE 6502
[08-01 19:43:05.950] ---> Using cache
[08-01 19:43:05.951] ---> 11e8ce1dda07
[08-01 19:43:05.951] Step 3/10 : ARG SSHUSERNAME=torizon
[08-01 19:43:05.952] ---> Using cache
[08-01 19:43:05.952] ---> eeb2411e1a24
[08-01 19:43:05.953] Step 4/10 : ENV DEBIAN_FRONTEND="noninteractive"
[08-01 19:43:05.953] ---> Using cache
[08-01 19:43:05.953] ---> 537972c77ef2
[08-01 19:43:05.954] Step 5/10 : RUN apt-get -q -y update     && apt-get -q -y install     gdbserver     procps     && rm -rf /var/lib/apt/lists/*
[08-01 19:43:05.954] ---> Using cache
[08-01 19:43:05.955] ---> ab340d3920e1
[08-01 19:43:05.955] Step 6/10 : RUN if [ ! -z "libqt5widgets5 libgpiod2 gpiod" ]; then     apt-get -q -y update     && apt-get -q -y install libqt5widgets5 libgpiod2 gpiod     && rm -rf /var/lib/apt/lists/* ;     fi
[08-01 19:43:05.956] ---> Using cache
[08-01 19:43:05.957] ---> f8c154351a9d
[08-01 19:43:05.957] Step 7/10 : RUN usermod -a -G gpio torizon
[08-01 19:43:05.958] ---> Using cache
[08-01 19:43:05.958] ---> ed78ac5f2319
[08-01 19:43:05.958] Step 8/10 : USER torizon
[08-01 19:43:05.959] ---> Using cache
[08-01 19:43:05.959] ---> 31f30ba7c2ac
[08-01 19:43:05.960] Step 9/10 : WORKDIR /qtest
[08-01 19:43:05.961] ---> Using cache
[08-01 19:43:05.961] ---> b75e99668aee
[08-01 19:43:05.961] Step 10/10 : CMD stdbuf -oL -eL gdbserver 0.0.0.0:6502 /qtest/qtest
[08-01 19:43:05.962] ---> Using cache
[08-01 19:43:05.962] ---> 806125ddc69d
[08-01 19:43:05.962] Successfully built 806125ddc69d
[08-01 19:43:05.980] Successfully tagged qtest_arm32v7-qt5-wayland-no-ssh_bullseye_debug_c684fc6b-7960-49f5-b66b-dab773632e1c:latest
[08-01 19:43:06.124] Deploying image to device (may take a few minutes)...
[08-01 19:43:06.267] Deploying application to device...
[08-01 19:43:06.332] Image on target is already up to date.
[08-01 19:43:06.757] sending incremental file list
[08-01 19:43:06.799] ./
[08-01 19:43:06.799] qtest
[08-01 19:43:07.155] sent 397,591 bytes  received 6,578 bytes  269,446.00 bytes/sec
[08-01 19:43:07.156] total size is 1,175,268  speedup is 2.91
[08-01 19:43:07.158] Restarting application container...
[08-01 19:43:07.456] Stopping current instance...
[08-01 19:43:07.753] running startup script...
[08-01 19:43:07.753] running docker-compose...
[08-01 19:43:12.611] Starting c684fc6b-7960-49f5-b66b-dab773632e1c_weston_1 ...
[08-01 19:43:14.144] e[1Ae[2K
Starting c684fc6b-7960-49f5-b66b-dab773632e1c_weston_1 ... e[32mdonee[0m
e[1B
[08-01 19:43:14.434] Starting new instance...
[08-01 19:43:48.792] Internal server error
[08-01 19:43:48.793] Error (500) - ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
[08-01 19:43:48.793] Ready to start debug session.
[08-01 19:52:44.419] Preparing debug environment for C/C++ application...
[08-01 19:52:44.420] Running preLaunchTask build_debug...
[08-01 19:52:46.176] preLaunchTask completed.
[08-01 19:52:47.117] Selecting device...
[08-01 19:52:47.125] Device 10672463 selected.
[08-01 19:52:47.127] Updating app configuration...
[08-01 19:52:47.147] Deploying image to device (may take a few minutes)...
[08-01 19:52:58.761] Image on target is already up to date.
[08-01 19:52:58.765] Deploying application to device...
[08-01 19:52:59.271] sending incremental file list
[08-01 19:52:59.303] Restarting application container...
[08-01 19:52:59.308] sent 81 bytes  received 12 bytes  62.00 bytes/sec
[08-01 19:52:59.308] total size is 1,175,268  speedup is 12,637.29
[08-01 19:52:59.669] Stopping current instance...
[08-01 19:53:00.024] running startup script...
[08-01 19:53:00.024] running docker-compose...
[08-01 19:53:05.283] Starting c684fc6b-7960-49f5-b66b-dab773632e1c_weston_1 ...
[08-01 19:53:06.849] e[1Ae[2K
Starting c684fc6b-7960-49f5-b66b-dab773632e1c_weston_1 ... e[32mdonee[0m
e[1B
[08-01 19:53:07.182] Starting new instance...
[08-01 19:53:08.268] Remote docker exception.
[08-01 19:53:08.269] Error (525) - Docker exception: 500 Server Error for http://127.0.0.1:36709/v1.40/containers/882cf7d9d26724094ee275597fa2b3ad23c10b66dc590e24f77f9e833e9aa530/start: Internal Server Error ("driver failed programming external connectivity on endpoint qtest_arm32v7-qt5-wayland-no-ssh_bullseye_debug_c684fc6b-7960-49f5-b66b-dab773632e1c_latest_instance (01438d74b99fa6bbd3c2d0bf0917791ac9ba02873898c8c4f02090ffc084c622): Bind for 0.0.0.0:8080 failed: port is already allocated")
device:10672463
[08-01 19:53:08.270] Ready to start debug session.
[08-01 19:54:14.769] Building debug container for C/C++ application...
[08-01 19:54:15.694] Building debug image (this may take some time)...
[08-01 19:54:15.899] Step 1/10 : FROM --platform=linux/arm torizon/qt5-wayland:2
[08-01 19:54:17.974] ---> 6d58cb6a5dd3
[08-01 19:54:17.975] Step 2/10 : EXPOSE 6502
[08-01 19:54:17.979] ---> Using cache
[08-01 19:54:17.979] ---> 11e8ce1dda07
[08-01 19:54:17.980] Step 3/10 : ARG SSHUSERNAME=torizon
[08-01 19:54:17.980] ---> Using cache
[08-01 19:54:17.981] ---> eeb2411e1a24
[08-01 19:54:17.981] Step 4/10 : ENV DEBIAN_FRONTEND="noninteractive"
[08-01 19:54:17.982] ---> Using cache
[08-01 19:54:17.982] ---> 537972c77ef2
[08-01 19:54:17.982] Step 5/10 : RUN apt-get -q -y update     && apt-get -q -y install     gdbserver     procps     && rm -rf /var/lib/apt/lists/*
[08-01 19:54:17.983] ---> Using cache
[08-01 19:54:17.983] ---> ab340d3920e1
[08-01 19:54:17.984] Step 6/10 : RUN if [ ! -z "libqt5widgets5 libgpiod2 gpiod" ]; then     apt-get -q -y update     && apt-get -q -y install libqt5widgets5 libgpiod2 gpiod     && rm -rf /var/lib/apt/lists/* ;     fi
[08-01 19:54:17.985] ---> Using cache
[08-01 19:54:17.986] ---> f8c154351a9d
[08-01 19:54:17.986] Step 7/10 : RUN usermod -a -G gpio torizon
[08-01 19:54:17.987] ---> Using cache
[08-01 19:54:17.987] ---> ed78ac5f2319
[08-01 19:54:17.987] Step 8/10 : USER torizon
[08-01 19:54:17.988] ---> Using cache
[08-01 19:54:17.988] ---> 31f30ba7c2ac
[08-01 19:54:17.988] Step 9/10 : WORKDIR /qtest
[08-01 19:54:17.989] ---> Using cache
[08-01 19:54:17.990] ---> b75e99668aee
[08-01 19:54:17.990] Step 10/10 : CMD stdbuf -oL -eL gdbserver 0.0.0.0:6502 /qtest/qtest
[08-01 19:54:17.990] ---> Using cache
[08-01 19:54:17.991] ---> 806125ddc69d
[08-01 19:54:17.991] Successfully built 806125ddc69d
[08-01 19:54:18.019] Successfully tagged qtest_arm32v7-qt5-wayland-no-ssh_bullseye_debug_c684fc6b-7960-49f5-b66b-dab773632e1c:latest
[08-01 19:54:18.035] Image has been built successfully.
[08-01 19:54:37.633] Preparing debug environment for C/C++ application...
[08-01 19:54:37.633] Running preLaunchTask build_debug...
[08-01 19:54:39.601] preLaunchTask completed.
[08-01 19:54:40.780] Selecting device...
[08-01 19:54:40.788] Device 10672463 selected.
[08-01 19:54:40.788] Updating app configuration...
[08-01 19:54:40.816] Deploying image to device (may take a few minutes)...
[08-01 19:54:52.633] Deploying application to device...
[08-01 19:54:52.638] Image on target is already up to date.
[08-01 19:54:53.100] sending incremental file list
[08-01 19:54:53.129] Restarting application container...
[08-01 19:54:53.131] sent 81 bytes  received 12 bytes  62.00 bytes/sec
[08-01 19:54:53.131] total size is 1,175,268  speedup is 12,637.29
[08-01 19:54:53.433] Stopping current instance...
[08-01 19:54:53.773] running startup script...
[08-01 19:54:53.774] running docker-compose...
[08-01 19:54:59.058] Starting c684fc6b-7960-49f5-b66b-dab773632e1c_weston_1 ...
[08-01 19:55:00.638] e[1Ae[2K
Starting c684fc6b-7960-49f5-b66b-dab773632e1c_weston_1 ... e[32mdonee[0m
e[1B
[08-01 19:55:00.946] Starting new instance...
[08-01 19:55:35.323] Internal server error
[08-01 19:55:35.324] Error (500) - ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
[08-01 19:55:35.325] Ready to start debug session.
[08-01 19:55:45.347] Preparing debug environment for C/C++ application...
[08-01 19:55:45.348] Running preLaunchTask build_debug...
[08-01 19:55:47.174] preLaunchTask completed.
[08-01 19:55:48.219] Selecting device...
[08-01 19:55:48.228] Device 10672463 selected.
[08-01 19:55:48.228] Updating app configuration...
[08-01 19:55:48.248] Deploying image to device (may take a few minutes)...
[08-01 19:55:59.970] Deploying application to device...
[08-01 19:55:59.974] Image on target is already up to date.
[08-01 19:56:00.547] sending incremental file list
[08-01 19:56:00.594] Restarting application container...
[08-01 19:56:00.601] sent 81 bytes  received 12 bytes  62.00 bytes/sec
[08-01 19:56:00.602] total size is 1,175,268  speedup is 12,637.29
[08-01 19:56:00.941] Stopping current instance...
[08-01 19:56:01.359] running startup script...
[08-01 19:56:01.359] running docker-compose...
[08-01 19:56:06.652] Starting c684fc6b-7960-49f5-b66b-dab773632e1c_weston_1 ...
[08-01 19:56:08.204] e[1Ae[2K
Starting c684fc6b-7960-49f5-b66b-dab773632e1c_weston_1 ... e[32mdonee[0m
e[1B
[08-01 19:56:08.667] Starting new instance...
[08-01 19:56:09.810] Remote docker exception.
[08-01 19:56:09.811] Error (525) - Docker exception: 500 Server Error for http://127.0.0.1:38269/v1.40/containers/fb526f1f660c41be00956c2da2f22d527adf45e3ee3f83f0338c859b946b3277/start: Internal Server Error ("driver failed programming external connectivity on endpoint qtest_arm32v7-qt5-wayland-no-ssh_bullseye_debug_c684fc6b-7960-49f5-b66b-dab773632e1c_latest_instance (9e40be9a9e779c526ad021a1c8539c01569d5b0b1874465ab4f7bdb2bc6e8684): Bind for 0.0.0.0:8080 failed: port is already allocated")
device:10672463
[08-01 19:56:09.811] Ready to start debug session.

I had previously managed to build and deploy this exact code, but today it has stopped working. I thought it was a network issue but I’m able to connect normally through a SSH shell. What should I do?

Usually the containers can only be deployed with the port bindings once.
In your case, it seems like two containers require port 8080 at once.
The error code 5xx usually denotes an internal server error.

The server response returned

Bind for 0.0.0.0:8080 failed: port is already allocated

which I’m guessing is because the previous container already runs.

Can you try stopping, removing and redeploying the container?

Hi @MGlolenstine, thanks for the answer. I manually removed the files from the Colibri, but the error persisted. Even changing the port didn’t affect the outcome. I believe it’s somehow linked to the debug configuration, since no errors are launched when deploying a release container. Indeed, I get the following message when trying to debug:

Captura de tela de 2021-09-02 14-12-21

I am using the launch.json created through the “Torizon: Create C/C++ application” command in VS code. I couldn’t find instructions on how to edit that file.

Greetings @tcm,

The exact root cause here is still a bit unclear. Let’s do a quick sanity check. Create a new C/C++ project with the extension. Just do a simple single file application template. Once that’s created just try to build, deploy, and debug the default hello-world template.

If this works then this suggests that the issue is more with the configuration of your specific C/C++ project. If it fails in a similar way then the issue probably more systematic.

Also just to have additional information what version of the Torizon extension do you have installed and running?

Best Regards,
Jeremias

Hi @jeremias.tx,

When creating a single file application, I get the following error:

[08-02 16:45:27.966] Initializing Torizon Extension
[08-02 16:45:27.969] Checking system setup...
[08-02 16:45:27.969] Checking Moses ...
[08-02 16:45:27.969] Starting backend local instance running on port 5000
[08-02 16:45:32.196] Torizon Backend version 1.0 API version: 1.0
[08-02 16:45:32.197] Torizon IDE backend started
[08-02 16:45:32.197] Checking Docker ...
[08-02 16:45:32.224] Docker version 20.10.8 build 75249d8
[08-02 16:45:32.255] Trying connect to Toradex Colibri iMX6DL/S on Colibri Evaluation Board V3(10672463)
[08-02 16:45:35.166] ARM emulation enabled.
[08-02 16:45:35.535] No active configuration found, selecting first valid one.
[08-02 16:45:35.536] Active configuration has been changed undefined - 89f37b2e-6559-4c63-82ff-1b5b2e793b8a, updating it.
[08-02 16:45:35.701] Initializing Torizon C/C++ application.
[08-02 16:45:35.772] SDK-related features are enabled for this project.
[08-02 16:45:35.776] Torizon: Wayland arm32v7 bullseye - simple - 89f37b2e-6559-4c63-82ff-1b5b2e793b8a
[08-02 16:45:35.785] LA_OPT_NXP_Software_License v5 January 2019 EULA accepted
[08-02 16:45:44.844] Toradex Colibri iMX6DL/S on Colibri Evaluation Board V3(10672463) connected
[08-02 16:45:44.845] Torizon: all devices refreshed
[08-02 16:45:48.814] Step 1/5 : FROM torizon/debian-cross-toolchain-armhf:2
[08-02 16:45:51.447] Local docker exception.
[08-02 16:45:51.447] Error (530) - Docker exception: manifest for torizon/debian-cross-toolchain-armhf:2 not found: manifest unknown: manifest unknown
message:manifest for torizon/debian-cross-toolchain-armhf:2 not found: manifest unknown: manifest unknown
Step 1/5 : FROM torizon/debian-cross-toolchain-armhf:2

Curiously, when I created a QT widget application, it managed to build and deploy as debug.

I’m using version 1.3.0 of the Torizon extension. I’m developing on Ubuntu 20.04 for a Colibri IMx6 on the Aster board.

Oh that error you encountered with the fresh project is a old known issue. There’s a fix with the early access version of the extension. This fix will eventually be available on the stable release of the extension, but for now it’s available via the early access version.

With that said try this:

  • Uninstall the stable version of the extension
  • Install the early access version of the extension
  • Try the sanity check again with a new project using the early access version.

Best Regards,
Jeremias

Hi @jeremias.tx,

I installed the early access extension and I managed to build and deploy the single file application.

I also managed to build and deploy my original application after I increased the power supply current. I suppose the error could be that opening a port consumed excessive energy, though that seems far fetched to me.

Anyway, thanks for your time.

The power supply theory seems far fetched for me as well.

I assume all the errors you were experiecing earlier were some issues with the stable release, that have been fixed in the early access version. As a side-note to clarify the whole early-access vs stable versions.

The early access version changes very frequently as basically any changes to the extensions get pushed to early access. Things in early access may be a work in progress, be missing documentation, or need further testing. But it should work at basic level.

Once the changes are a bit more polished is when they get published to the stable release. So for now I would suggest sticking with the early access release if possible until the stable release gets updated with these fixes.

Best Regards,
Jeremias