Hi,
I have had a bunch of problems getting the extension to work today, I only use it occasionally but really need it to work when I do, not spend 4 hours trying to persuade it.
I have managed to solve a number of error messages partly by reinstalling just about everything but now I am stumped by this building the container error:
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello there!
It sounds like you’re encountering an ‘exec format error,’ which often happens when there’s an architecture mismatch—essentially trying to run a binary built for one architecture on a different one. Let’s go through some steps to help you resolve this issue:
Configure Your Build Environment:
Ensure your build environment is set up correctly for Torizon containers. You can follow the initial setup guide here: Torizon Quickstart Guide.
Package Installation Tips:
Always update your package list first using apt-get update.
After installation, clean up with apt-get clean && apt-get autoremove to keep your environment tidy.
Using Visual Studio Code:
Make sure you have Visual Studio Code installed along with the Torizon extension and the Remote Containers extension from Microsoft. This setup is crucial for a smooth development experience. Here’s a helpful blog post: Importing Qt Project into Torizon.
Troubleshooting Persistent Issues:
Try restarting the Docker daemon on your host machine if problems continue.
If you’re using Windows, you might need to run wsl --shutdown in PowerShell with administrative privileges. More troubleshooting tips are available here: Torizon FAQ.
I hope these steps help you get back on track! If you have more details about your development environment or target architecture, feel free to share, and I can provide more tailored advice.
Best regards,
Toradex AI Assistant
Please, also check if these links can help you solve your problem:
Are you using it to build an existing project?
Or is it a new project?
Which template is being used as a base?
Regardless, this error is caused by the lack of ARM emulation on the system.
The extension should take care of this, so we need to understand what may be wrong here.
Can you run the run-torizon-binfmt task and try again?
It is under the task-runner pane of the explorer view.
You will need to click on the little eye highlighted to unhide it.
* Executing task: pwsh /home/edwaugh/cloudbox_v3_bba/v3DeviceApplication/.conf/runContainerIfNotExists.ps1 -ContainerRuntime docker -RunArguments "--rm --privileged commontorizon/binfmt:9.0.2" -ContainerName binfmt
Container Runtime: docker
Run Arguments: --rm --privileged commontorizon/binfmt:9.0.2
Container Name: binfmt
Error response from daemon: No such container: binfmt
Container does not exist. Starting ...
Unable to find image 'commontorizon/binfmt:9.0.2' locally
9.0.2: Pulling from commontorizon/binfmt
c2e6b12a30f6: Pull complete
10c0800f9ae9: Pull complete
3063715dccfe: Pull complete
Digest: sha256:95f6fdec8daa850f05c5870e73f97a38dbd9e698f75d36096b95411327179f13
Status: Downloaded newer image for commontorizon/binfmt:9.0.2
* Terminal will be reused by tasks, press any key to close it.
@bruno.tx, ok next sticking point which I think I was before I reinstalled everything:
* Executing task: DOCKER_HOST=192.168.203.2:2375 LOCAL_REGISTRY=192.168.178.23 TAG=arm64 GPU=-imx8 DEBUG_SSH_PORT=6502 DEBUG_PORT1=6512 DEBUG_PORT2= DEBUG_PORT3= docker compose --ansi never pull vs_device_application-debug
WARN[0000] The "DOCKER_LOGIN" variable is not set. Defaulting to a blank string.
vs_device_application-debug Pulling
vs_device_application-debug Warning Get "http://192.168.178.23:5002/v2/": dial tcp 192.168.178.23:5002: connect: network is unreachable
WARNING: Some service image(s) must be built from source by running:
docker compose build vs_device_application-debug
1 error occurred:
* Error response from daemon: Get "http://192.168.178.23:5002/v2/": dial tcp 192.168.178.23:5002: connect: network is unreachable
* The terminal process "/usr/bin/bash '-c', 'DOCKER_HOST=192.168.203.2:2375 LOCAL_REGISTRY=192.168.178.23 TAG=arm64 GPU=-imx8 DEBUG_SSH_PORT=6502 DEBUG_PORT1=6512 DEBUG_PORT2= DEBUG_PORT3= docker compose --ansi never pull vs_device_application-debug'" failed to launch (exit code: 1).
Hi Bruno,
I will give that a go shortly, having another look today I got a message that the OS version on the target was too old which I had not seen before. I had picked up an old unit to use and have now upgraded it and get back to this message:
Hi @bruno.tx,
Fresh project gives the same error, this ran ok in the simulator and printed hello world. I think selected torizon arm64 in the debug menu and get here:
Hi Bruno,
Switching back to 2.8.1 fixed it for me, although when changing from the test project back to my project it lost track of the device password somehow so an rsync failed at the password prompted. Removing and re-connecting to the device fixed that.
Something I noticed that changed is the port it is attempting to connect to. On the non-working attempts it was 5002 and now it is 6502. I can see that gets recorded in settings.json but it is not clear to me where it comes from. I will give the latest another go now to see if it will work now we have had a successful build of the container.
Hi @bruno.tx,
Going to 3.0.3 is broken for me with that error but 2.8.1 is working. The only thing I noticed is that during startup the extension complains about templates:
Thanks for your help, but maybe some better testing is required, at least on my machine your standard Python command line project is broken in the latest release.
The extension team has looked into this issue and found the problem.
The fix will be released with version 3.0.4 of the extension, but should be available a bit earlier in the pre-release version.
it seems to work OK.
If I re-set my default device, the ports are immediately overwritten to empty strings.
When I attempt to debug, I see this output.
* Terminal will be reused by tasks, press any key to close it.
* Executing task in folder v3DeviceApplication: DOCKER_HOST= docker compose --ansi never build --pull --build-arg SSHUSERNAME=root --build-arg APP_ROOT=/home/torizon/app --build-arg IMAGE_ARCH=arm64 --build-arg DEBUG_SSH_PORT=6502 --build-arg GPU=-imx8 vs_device_application-debug
WARN[0000] The "DOCKER_LOGIN" variable is not set. Defaulting to a blank string.
no port specified: :<empty>
* The terminal process "/bin/bash '-c', 'DOCKER_HOST= docker compose --ansi never build --pull --build-arg SSHUSERNAME=root --build-arg APP_ROOT=/home/torizon/app --build-arg IMAGE_ARCH=arm64 --build-arg DEBUG_SSH_PORT=6502 --build-arg GPU=-imx8 vs_device_application-debug'" failed to launch (exit code: 15).
* Terminal will be reused by tasks, press any key to close it.