I tried using the C++ template doing a helloworld project. It had issues

I started a new project to figure out how to get my existing project to work. So, I created a helloworld C++ project using the torizon templates. Everything went swimmingly until near the end. there are a couple of warndings, but the error is at the end. Here are the logs:

Executing task: xonsh .conf/validate-deps-running.xsh

:warning: VALIDATING ENVIRONMENT

OS: Linux
OS Version: 6.6.87.2-microsoft-standard-WSL2
OS Arch: x86_64
Under WSL: Ubuntu-24.04
VS Code:
1.106.3
bf9252a2fb45be6893dd8870c0bf37e2e1766d61
x64

TOR Extension: toradex.apollox-vscode@3.2.3

:white_check_mark: Environment is valid!

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: bash -c [[ ! -z “192.168.6.241” ]] && true || false

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: bash -c [[ “arm64” == “arm64” ]] && true || false

  • Executing task: sshpass -p password scp -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAuthentication=no /home/steve/HelloWorldcpp/docker-compose.yml torizon@192.168.6.241:~/

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: /home/steve/HelloWorldcpp/.conf/remove-dangling-images.xsh 192.168.6.241:2375

Waiting for prune lock on host 192.168.6.241:2375
Pruning dangling images on 192.168.6.241:2375
Error response from daemon: client version 1.52 is too new. Maximum supported API version is 1.41

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: docker compose -p torizon stop helloworldcpp helloworldcpp-debug && docker compose -p torizon rm -f helloworldcpp helloworldcpp-debug && sleep 1

No stopped containers

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: xonsh /home/steve/HelloWorldcpp/.conf/torizon-packages.xsh arm64

Applying torizonPackages.json:
Applying to Dockerfile.debug …
:white_check_mark: Dockerfile.debug
Applying to Dockerfile.sdk …
:white_check_mark: Dockerfile.sdk
Applying to Dockerfile …
:white_check_mark: Dockerfile
torizonPackages.json applied

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker build --pull -f /home/steve/HelloWorldcpp/Dockerfile.sdk /home/steve/HelloWorldcpp -t cross-toolchain-arm64-helloworldcpp --build-arg IMAGE_ARCH=arm64 --build-arg GPU=-imx8 --build-arg APP_ROOT=/home/torizon/app

[+] Building 21.9s (8/8) FINISHED docker:default
=> [internal] load build definition from Dockerfile.sdk 0.0s
=> => transferring dockerfile: 1.06kB 0.0s
=> WARN: InvalidDefaultArgInFrom: Default value for ARG torizon/cross- 0.0s
=> [internal] load metadata for docker.io/torizon/cross-toolchain-arm6 2.3s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 56B 0.0s
=> [1/4] FROM docker.io/torizon/cross-toolchain-arm64:4@sha256:65007e 10.5s
=> => resolve docker.io/torizon/cross-toolchain-arm64:4@sha256:65007ec 0.0s

Lines Skipped due to post limitations

=> [2/4] RUN apt-get -q -y update && apt-get -q -y install && 4.4s
=> [3/4] RUN apt-get -q -y update && apt-get -q -y install && 4.2s
=> [4/4] WORKDIR /home/torizon/app 0.3s
=> exporting to image 0.1s
=> => exporting layers 0.1s
=> => writing image sha256:81fde3946f4fe5cb9c4ebff48b1ada9755488718c67 0.0s
=> => naming to Docker Hub Container Image Library | App Containerization 0.0s

1 warning found (use docker --debug to expand):

  • InvalidDefaultArgInFrom: Default value for ARG torizon/cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} results in empty or invalid base image name (line 16)

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: make ARCH=arm64 makedir

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker run --rm -v /home/steve/HelloWorldcpp:/home/torizon/app cross-toolchain-arm64-helloworldcpp make ARCH=arm64 CC=aarch64-linux-gnu-g++ debug

aarch64-linux-gnu-g++ -Iincludes/ -c -g -o build-arm64/debug/main.o src/main.cpp
aarch64-linux-gnu-g++ -Iincludes/ -g build-arm64/debug/main.o -o build-arm64/debug/helloWorrldCpp

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker compose build --pull --build-arg SSHUSERNAME=torizon --build-arg APP_ROOT=/home/torizon/app --build-arg IMAGE_ARCH=arm64 --build-arg DEBUG_SSH_PORT=2230 --build-arg GPU=-imx8 helloworldcpp-debug

WARN[0000] The “DOCKER_LOGIN” variable is not set. Defaulting to a blank string.
[+] Building 64.2s (11/11) FINISHED
=> [internal] load local bake definitions 0.0s
=> => reading from stdin 788B 0.0s
=> [internal] load build definition from Dockerfile.debug 0.0s
=> => transferring dockerfile: 2.43kB 0.0s
=> [internal] load metadata for docker.io/torizon/debian:4 1.8s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 56B 0.0s
=> [1/5] FROM docker.io/torizon/debian:4@sha256:eafcfdf5ee95136c719b21 2.5s
=> => resolve docker.io/torizon/debian:4@sha256:eafcfdf5ee95136c719b21 0.0s
=> => sha256:98c8a97f54c806a3a980ae48a6ebf6d19b41459a3 2.56kB / 2.56kB 0.0s
Lines Skipped due to post limitation

=> [2/5] RUN apt-get -q -y update && apt-get -q -y install op 36.9s
=> [3/5] RUN apt-get -q -y update && apt-get -q -y install && 11.0s
=> [4/5] RUN mkdir /var/run/sshd && sed 's@session\srequired\spa 0.6s
=> [5/5] RUN rm -r /etc/ssh/ssh*key && dpkg-reconfigure openssh-s 10.8s
=> exporting to image 0.3s
=> => exporting layers 0.3s
=> => writing image sha256:e5a65c83a3c23f09d5a064ec28b5025b24134e247d3 0.0s
=> => naming to localhost:5002/helloworldcpp-debug:arm64 0.0s
=> resolving provenance for metadata file 0.0s
[+] Building 1/1
:check_mark: localhost:5002/helloworldcpp-debug:arm64 Built 0.0s

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker compose push helloworldcpp-debug

WARN[0000] The “DOCKER_LOGIN” variable is not set. Defaulting to a blank string.
[+] Pushing 2/16
⠋ Pushing localhost:5002/helloworldcpp-debug:arm64: d599356eaa20 Pushing 1.719MB0.1s
Lines skipped due to posting limitations
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 3e5d01a55aea Pushed 2.4s

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: /home/steve/.local/bin/xonsh /home/steve/HelloWorldcpp/.conf/spin-up-down-registry.xsh down password torizon 192.168.6.241 /home/steve/HelloWorldcpp

Error response from daemon: No such container: torizon-ide-port-tunnel

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: /home/steve/.local/bin/xonsh /home/steve/HelloWorldcpp/.conf/spin-up-down-registry.xsh up password torizon 192.168.6.241 /home/steve/HelloWorldcpp

Container Runtime: docker
Run Arguments: --rm -d --network host torizonextras/ide-port-tunnel:0.0.0 sshpass -p password ssh -vv -N -R 5002:localhost:5002 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAuthentication=no torizon@192.168.6.241
Container Name: torizon-ide-port-tunnel
Container does not exist. Starting …
Cmd: docker run --name torizon-ide-port-tunnel --rm -d --network host torizonextras/ide-port-tunnel:0.0.0 sshpass -p password ssh -vv -N -R 5002:localhost:5002 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAuthentication=no torizon@192.168.6.241
Unable to find image ‘torizonextras/ide-port-tunnel:0.0.0’ locally
0.0.0: Pulling from torizonextras/ide-port-tunnel
2d35ebdb57d9: Pull complete
526f04333b05: Pull complete
Digest: sha256:bb97aed7c548f682f2da5858e9ac5e085363a6114de706cd635021033463d56c
Status: Downloaded newer image for torizonextras/ide-port-tunnel:0.0.0
d88c5d3b9e3dd4adc116bc66984fd57f107e1146f8e90198bf7bc0e11e85e0a6

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: xonsh /home/steve/HelloWorldcpp/.conf/service-check.xsh registry password 22 torizon 192.168.6.241 ‘curl --silent --max-time 5 http://localhost:5002/v2/_catalog’

Error: Expected 7 arguments, but got 1.
Report on GitHub · Where software is built
Error cause: Invalid argument

  • The terminal process “/usr/bin/bash ‘-c’, ‘xonsh /home/steve/HelloWorldcpp/.conf/service-check.xsh registry password 22 torizon 192.168.6.241 ‘curl --silent --max-time 5 http://localhost:5002/v2/_catalog’’” failed to launch (exit code: 22).
  • Terminal will be reused by tasks, press any key to close it.

I see 7 arguments in the line. I find it odd that it only sees one…

Any ideas how to fix this?

Steve

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I’d be glad to help! Could you let me know which OS and version you are using? Also, to help troubleshoot this issue more effectively, please run the tdx-info command on your device to get detailed information about your setup. You can find more details about this command at Getting Device Information with Tdx-Info | Toradex Developer Center

The error you’re encountering appears to be related to argument parsing in the service-check script, but understanding your specific platform configuration will help provide the most accurate troubleshooting guidance.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI

Software summary

Bootloader: U-Boot

Kernel version: 5.15.148-6.6.1+git.23a8e831749d #1-TorizonCore SMP PREEMPT Thu Feb 29 20:25:21 UTC 2024
Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/1159f434d9e1087cb7f3d87fbe915a4d738f414888501ed14c28a75e528c23a5/0
Distro name: NAME=“TorizonCore”
Distro version: VERSION_ID=6.6.1-build.14
Distro variant: VARIANT=“Docker”
Hostname: verdin-imx8mp-15132708

Hardware info

HW model: Toradex Verdin iMX8M Plus WB on Verdin Development Board

Toradex version: 0058 V1.1A
Serial number: 15132708
Processor arch: aarch64

We do plan to go to TorizonOS version 7 soon though. It just happens to be what is on this device.

Steve

Troubleshooting Service Check Script Error

Thank you for providing the system information! Based on your setup (Verdin iMX8M Plus V1.1A running TorizonCore 6.6.1-build.14), I can help address the service check script error you’re encountering.

Issue Analysis

The error occurs in the service-check script where it expects 7 arguments but only receives 1. This is typically caused by shell argument parsing issues, particularly with quoted strings containing special characters.

Potential Solutions

1. Quote Handling Issue
The command line shows:

xonsh /home/steve/HelloWorldcpp/.conf/service-check.xsh registry password 22 torizon 192.168.6.241 'curl --silent --max-time 5 http://localhost:5002/v2/_catalog''

Notice the double single quotes at the end (''). This suggests a quote escaping problem in the task definition.

2. Docker API Version Compatibility
Earlier in your logs, there’s a warning:

Error response from daemon: client version 1.52 is too new. Maximum supported API version is 1.41

This indicates a Docker client/daemon version mismatch that might be affecting the entire workflow.

Recommended Actions

Step 1: Update TorizonCore
Your current version (6.6.1-build.14) may have compatibility issues with newer Docker clients. Consider updating to a more recent TorizonCore version that supports newer Docker API versions.

Step 2: Check VS Code Extension Version
Ensure you’re using a compatible version of the Torizon VS Code extension (currently showing 3.2.3) that matches your TorizonCore version.

Step 3: Verify Network Connectivity
The registry service check is trying to verify the local registry at localhost:5002. Ensure the port tunnel is working correctly between your development machine and the target device.

Step 4: Manual Registry Check
Try manually running the registry check on your target device:

curl --silent --max-time 5 http://localhost:5002/v2/_catalog

This will help determine if the issue is with the script or the registry service itself.

Alternative Approach

If the issue persists, you can try creating a new project with the same template to see if it’s project-specific or a broader environment issue.

The combination of Docker API version mismatch and argument parsing errors suggests there may be compatibility issues between your development environment and the target TorizonCore version.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI

OK, I have a new board that has torizonOS 7 on it. Also, when I first start VSC in this folder, I get issues where xonsh wants cwd into the workspace, and that is denied by VSC saying it is untrustworthy. I have implemented the option: cwd:””, which gets by this issue. It is the only way I have been able to get by that permissions issue.
Anyway, this is what I get when try to build now with OS7:

Executing task: xonsh .conf/validate-deps-running.xsh

:warning: VALIDATING ENVIRONMENT

OS: Linux
OS Version: 6.6.87.2-microsoft-standard-WSL2
OS Arch: x86_64
Under WSL: Ubuntu-24.04
VS Code:
1.106.3
bf9252a2fb45be6893dd8870c0bf37e2e1766d61
x64

TOR Extension: toradex.apollox-vscode@3.2.5

:white_check_mark: Environment is valid!

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: bash -c [[ ! -z “192.168.6.243” ]] && true || false

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: bash -c [[ “arm64” == “arm64” ]] && true || false

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: sshpass -p #FFE!Vibora$l scp -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAuthentication=no /home/steve/HelloWorldcpp/docker-compose.yml torizon@192.168.6.243:~/

Warning: Permanently added ‘192.168.6.243’ (ED25519) to the list of known hosts.

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: /home/steve/HelloWorldcpp/.conf/remove-dangling-images.xsh 192.168.6.243:2375

Waiting for prune lock on host 192.168.6.243:2375
Pruning dangling images on 192.168.6.243:2375
Total reclaimed space: 0B

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: docker compose -p torizon stop helloworldcpp helloworldcpp-debug && docker compose -p torizon rm -f helloworldcpp helloworldcpp-debug && sleep 1

No stopped containers

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: xonsh /home/steve/HelloWorldcpp/.conf/torizon-packages.xsh arm64

Applying torizonPackages.json:
Applying to Dockerfile.debug …
:white_check_mark: Dockerfile.debug
Applying to Dockerfile.sdk …
:white_check_mark: Dockerfile.sdk
Applying to Dockerfile …
:white_check_mark: Dockerfile
torizonPackages.json applied

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker build --pull -f /home/steve/HelloWorldcpp/Dockerfile.sdk /home/steve/HelloWorldcpp -t cross-toolchain-arm64-helloworldcpp --build-arg IMAGE_ARCH=arm64 --build-arg GPU=-imx8 --build-arg APP_ROOT=/home/torizon/app

[+] Building 0.9s (8/8) FINISHED docker:default
=> [internal] load build definition from Dockerfile.sdk 0.0s
=> => transferring dockerfile: 1.06kB 0.0s
=> WARN: InvalidDefaultArgInFrom: Default value for ARG torizon/cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_ 0.0s
=> [internal] load metadata for docker.io/torizon/cross-toolchain-arm64:4 0.8s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 56B 0.0s
=> [1/4] FROM docker.io/torizon/cross-toolchain-arm64:4@sha256:65007ec3c44cc782e61843d2ed60fd362a268e5d6824e262 0.0s
=> CACHED [2/4] RUN apt-get -q -y update && apt-get -q -y install && apt-get clean && apt-get autor 0.0s
=> CACHED [3/4] RUN apt-get -q -y update && apt-get -q -y install && apt-get clean && apt-get autor 0.0s
=> CACHED [4/4] WORKDIR /home/torizon/app 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:81fde3946f4fe5cb9c4ebff48b1ada9755488718c676fda133d4a16f76d0f8cc 0.0s
=> => naming to Docker Hub Container Image Library | App Containerization 0.0s

1 warning found (use docker --debug to expand):

  • InvalidDefaultArgInFrom: Default value for ARG torizon/cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} results in empty or invalid base image name (line 16)

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: make ARCH=arm64 makedir

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker run --rm -v /home/steve/HelloWorldcpp:/home/torizon/app cross-toolchain-arm64-helloworldcpp make ARCH=arm64 CC=aarch64-linux-gnu-g++ debug

make: Nothing to be done for ‘debug’.

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker compose build --pull --build-arg SSHUSERNAME=torizon --build-arg APP_ROOT=/home/torizon/app --build-arg IMAGE_ARCH=arm64 --build-arg DEBUG_SSH_PORT=2230 --build-arg GPU=-imx8 helloworldcpp-debug

WARN[0000] The “DOCKER_LOGIN” variable is not set. Defaulting to a blank string.
[+] Building 0.8s (11/11) FINISHED
=> [internal] load local bake definitions 0.0s
=> => reading from stdin 788B 0.0s
=> [internal] load build definition from Dockerfile.debug 0.0s
=> => transferring dockerfile: 2.43kB 0.0s
=> [internal] load metadata for docker.io/torizon/debian:4 0.7s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 56B 0.0s
=> [1/5] FROM docker.io/torizon/debian:4@sha256:eafcfdf5ee95136c719b219cac53480ecee4cb85a3655d13d0836bb29ee3cf0 0.0s
=> CACHED [2/5] RUN apt-get -q -y update && apt-get -q -y install openssl openssh-server rsync 0.0s
=> CACHED [3/5] RUN apt-get -q -y update && apt-get -q -y install && apt-get clean && apt-get autor 0.0s
=> CACHED [4/5] RUN mkdir /var/run/sshd && sed 's@session\srequired\spam_loginuid.so@session optional pam 0.0s
=> CACHED [5/5] RUN rm -r /etc/ssh/ssh*key && dpkg-reconfigure openssh-server 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:e5a65c83a3c23f09d5a064ec28b5025b24134e247d31d1d1898d55269a6b5607 0.0s
=> => naming to localhost:5002/helloworldcpp-debug:arm64 0.0s
=> resolving provenance for metadata file 0.0s
[+] Building 1/1
:check_mark: localhost:5002/helloworldcpp-debug:arm64 Built 0.0s

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker compose push helloworldcpp-debug

WARN[0000] The “DOCKER_LOGIN” variable is not set. Defaulting to a blank string.
[+] Pushing 16/16
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: d599356eaa20 Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 42a25b36965f Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 27c5b0390bce Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: dfc1a8f56768 Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 2b0a92b65536 Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 2d150839e3fc Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: fe1e47ec2d53 Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 643d70c9c98b Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 5f59aed187eb Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 154018f8f276 Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 567ef5ff4ef8 Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 27b609b94cd1 Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 5f70bf18a086 Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: c0d17df75b5a Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: fb518d894ad8 Layer already exists 0.0s
:check_mark: Pushing localhost:5002/helloworldcpp-debug:arm64: 3e5d01a55aea Layer already exists 0.0s

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: ssh -p 2230 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no torizon@192.168.6.243 rm -rf /home/torizon/app

ssh: connect to host 192.168.6.243 port 2230: Connection refused

  • The terminal process “ssh ‘-p’, ‘2230’, ‘-o’, ‘UserKnownHostsFile=/dev/null’, ‘-o’, ‘StrictHostKeyChecking=no’, ‘torizon@192.168.6.243’, ‘rm -rf /home/torizon/app’” failed to launch (exit code: 255).
  • Terminal will be reused by tasks, press any key to close it.

I think it is missing that step where it tells the OS to open that port for the container, but I don’t see where it does that.

Steve

Issue Analysis

You’re encountering a connection issue during the debug deployment process. The error ssh: connect to host 192.168.6.243 port 2230: Connection refused indicates that the debug container isn’t running or the SSH service isn’t accessible on port 2230.

Key Observations

Looking at your logs, I notice several important details:

  1. Build Process Completed Successfully: The container images were built and pushed successfully to the local registry
  2. Missing Application Build: The log shows make: Nothing to be done for 'debug' - this suggests the application wasn’t compiled
  3. Container Not Running: The SSH connection failure indicates the debug container isn’t started yet

Troubleshooting Steps

Step 1: Verify Debug Container Deployment

The debug process should automatically start the container with SSH access enabled (1). Check if the debug container is running on your target device:

docker ps

Step 2: Check Docker Compose Status

On your target device, verify the container orchestration:

docker compose -p torizon ps

Step 3: Manual Container Start

If the container isn’t running, you can manually start it using the docker-compose.yml file that was copied to your device (2):

docker compose -p torizon up -d helloworldcpp-debug

Step 4: Verify SSH Service

Once the container is running, check if the SSH service is accessible:

docker compose -p torizon logs helloworldcpp-debug

Common Causes and Solutions

Application Build Issue: The make: Nothing to be done for 'debug' suggests your Makefile might not have the correct debug target or the source files weren’t detected properly.

Port Forwarding: The debug container should automatically expose port 2230 for SSH access (1). This is typically configured in the docker-compose.yml file.

Torizon OS 7 Compatibility: Since you’re using TorizonOS 7 with extension version 3.2.5, ensure you’re using compatible templates. The pre-release support for TorizonOS 7 has been migrating from PowerShell to Python/Xonsh scripts (3), which might affect some workflows.

Recommended Actions

  1. Check your Makefile: Ensure it has a proper debug target
  2. Verify project structure: Make sure your source files are in the expected locations
  3. Try a fresh debug session: Stop any existing containers and restart the debug process
  4. Check VS Code extension settings: Ensure you’re using templates compatible with TorizonOS 7

The debug deployment process should automatically handle port forwarding and container startup (1). If the issue persists, try creating a fresh project from the template to isolate whether this is a project-specific issue.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI

Yes, I already tried starting the container and then logging into it via ssh -p 2230, but it won’t take my torizon password. I can log into the device on the standard port 22 with the container running.
If I start the container manually using VSC (Right click on the container and select start), but it won’t let me log in. The same if I have the container running and try to debug, it asks for a password, but my password doesn’t work.

SSH Authentication Issue with Debug Container

This is a common authentication issue with the debug container. The problem is that the debug container uses SSH key authentication, not password authentication for the debugging session.

Understanding the Authentication Flow

When you connect to the target device on port 22, you’re connecting directly to the TorizonOS system (1). However, when debugging on port 2230, you’re connecting to the SSH service inside the debug container, which has different authentication requirements (2).

SSH Key Configuration

The Torizon IDE Extension automatically sets up SSH key authentication when you add a device (3). The extension should handle this automatically, but there might be an issue with the key setup.

Troubleshooting Steps

Step 1: Check SSH Key Configuration

Verify that SSH keys are properly configured in your project settings. The extension stores SSH connection parameters in the workspace settings (3):

  • torizon_ip: The IP address of your target device
  • torizon_login: The login username (typically “torizon”)
  • torizon_psswd: The password (stored as plain text in development)
  • torizon_ssh_port: The SSH port for the target device

Step 2: Verify Debug Container SSH Configuration

The debug container is configured with SSH access during the build process (4). Check if the container is properly configured by examining the container logs:

docker compose -p torizon logs helloworldcpp-debug

Step 3: Manual SSH Key Setup

If the automatic key setup isn’t working, you may need to manually configure SSH keys. The extension typically handles this, but based on community reports, there can be issues with SSH key authentication in certain environments (5).

Step 4: Check Extension Version Compatibility

You mentioned using extension version 3.2.5 with TorizonOS 7. Ensure that your extension version is fully compatible with your target OS version.

Alternative Debugging Approach

If SSH authentication continues to fail, you can try:

  1. Reset the device connection: Remove and re-add the target device in VS Code
  2. Check workspace settings: Verify that all connection parameters are correctly set in .vscode/settings.json (3)
  3. Try passwordless SSH setup: Configure SSH keys manually following the SSH documentation (6)

Common Resolution

Based on community feedback, this issue is often resolved by ensuring the SSH keys are properly generated and deployed by the extension (5). The extension should automatically handle the SSH key setup when you connect to a target device.

If the problem persists, try creating a fresh project and reconnecting to your target device to ensure clean SSH key generation.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI @eric.tx

Tired of all the problems, I tried a couple of different times to create a C++ “Hello World!” project. I have 3 now. They all have different problems, but the worst one is that when you create it, it can’t initialize the project correctly doing the powershell commands because it done through xonsh and VSC says that the workspace folder is untrusted. You can add it all you want, but that command just fails due to permissions. There is a work around that you put in a “Options”: { “cwd”:””} in a couple of tasks.json locations, which will get you past this.
But then there are a bunch of other issues, which I’ve managed to past some but not all. The last is that when you run: xonsh service-check.xsh, it looks like it putting out 7 arguments, but comes back with this message:
Error: Expected 7 arguments, but got 1.
Report on GitHub · Where software is built
Error cause: Invalid argument
I get the same result if I run this manually.

I am sorry, but this is shameful. The worst part is that here I am trying to wrap up my project, and I can’t because I can’t even get my project to compile and create a container. It creates the image, and pushes it to my local repository, but then it says it’s pushing it to my device, but that doesn’t happen. I pulled it from my repository to the device, and then now I get this as it doesn’t start the container.

Hey @EvetsMostel1,

How are you doing with this? The newer versions of the IDE use the xonsh, so it makes sense that the powershell commands don’t have an effect.

I can run a hello world c++ project and it works as expected. So i’m a little confused on what’s actually happening with your setup.

Can you update your IDE to the lastest version and update the templates and try again?

-Eric

@eric.tx

OK, try putting in a password with special characters. It won’t get to debug and you’ll get the “expecting 7 aurguments, but got 1” error. In ps, the special characters must be in single quotes. I changed my password to get around this.

I finally got it to build and deploy, but unlike the ps build, it won’t run. When I try to run the xonsh build, boost causes exceptions in boost logging. This doesn’t happen in the ps build. Same boost libraries. I have tried to update the sdk to use a newer compiler, but it doesn’t seem to build it. I am having a devil of a time getting boost to build under arm64 in newer boost versions, to see if that will fix the problem. The libraries in boost (only log and support libs are linked) are built with c++11 specified, according to boost. More to figure out.

Steve