Getting rsync error when attemping to debug code on device

I am getting an rsync error, specifically exit code 23, when attempting to debug my code. I am sure I am missing something in my docker setup.

I am using a windows 11 machine with WSL2. My code is located in two places:
/home/SAbrahamian/snmptoserial/src/main.py
/home/SAbrahamian/snmptoserial/mib/SNMPTOSERIAL-MIB.py

The main program loads the SNMPTOSERIAL-MIB.py module, a compiled python MIB file.

When I attempt to debug I get this popup error.

If I click debug anyway I get this popup.

Attached is my launch.json
launch.json (1.6 KB)

This is what is displayed in the terminal when the error occur

s.

 *  Executing task: rsync -P -av -e ssh -p 6502 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /home/SAbrahamian/snmptoserial/src torizon@10.85.76.237:/home/torizon/snmptoserial/ 

Warning: Permanently added '[10.85.76.237]:6502' (ED25519) to the list of known hosts.
sending incremental file list
rsync: [generator] chgrp "/home/torizon/snmptoserial/src" failed: Operation not permitted (1)
src/
src/main.py
          8,597 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=0/2)
rsync: [receiver] mkstemp "/home/torizon/snmptoserial/src/.main.py.1y8keC" failed: Permission denied (13)

sent 8,752 bytes  received 39 bytes  5,860.67 bytes/sec
total size is 8,597  speedup is 0.98
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]

 *  The terminal process "rsync '-P', '-av', '-e', 'ssh -p 6502 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null', '/home/SAbrahamian/snmptoserial/src', 'torizon@10.85.76.237:/home/torizon/snmptoserial/'" terminated with exit code: 23. 
 *  Terminal will be reused by tasks, press any key to close it.

The permissions for both main.py and SNMPTOSERIAL-MIB.py is 644.

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

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


Hello! Thank you for providing all the relevant details and screenshots.

The rsync exit code 23, along with Permission denied errors when writing to the target directory inside your Torizon device, is usually related to file system write-protection or user permission issues on Torizon OS.

Key Points for Torizon OS

  • Torizon OS mounts the root filesystem as read-only; only a few directories like /etc and /var are writable for security reasons.
  • Code and development artifacts should be copied to writable directories such as /home/torizon.

Reference:
Torizon OS Architecture - Read-only rootfs

Diagnosing Your Error

From your rsync command:

rsync -P -av ... /home/SAbrahamian/snmptoserial/src torizon@10.85.76.237:/home/torizon/snmptoserial/

You’re targeting /home/torizon/snmptoserial/, which should be writable. However, you’re experiencing:

mkstemp "/home/torizon/snmptoserial/src/.main.py.XXXXXX" failed: Permission denied (13)

This indicates either:

  • The parent directory exists but does not have write permission for torizon user, or
  • The root filesystem is misconfigured and denying access.

Solutions

1. Check Directory Ownership on Target Board

SSH into your board and run:

ls -ld /home/torizon/snmptoserial /home/torizon/snmptoserial/src
  • If /home/torizon/snmptoserial or its src subdirectory exists and isn’t owned by user torizon, fix the permissions:
sudo chown -R torizon:torizon /home/torizon/snmptoserial
  • If they don’t exist, your rsync command should create them (unless the parent folder has restricted permissions).

2. Remove and Let VS Code Recreate

If src/ exists but permissions aren’t right, simply remove the whole /home/torizon/snmptoserial folder and retry debugging in VS Code:

rm -rf /home/torizon/snmptoserial

Let the VS Code extension create it afresh via its rsync process.

3. Ensure Containerized Workflow

If you are not using the Torizon IDE Extension’s workflow (containerized deployment), follow the steps to set up your project properly:

4. WSL and Docker Context Check

Verify in VS Code:

  • Docker context is set to the correct engine (should be on WSL2 if your environment is Linux containers).
  • The Torizon IDE extension’s settings point to the right target.

See:
VS Code & WSL2 Docker Guidance


Summary of actions:

  • Ensure /home/torizon/snmptoserial/ is owned by torizon.
  • Remove and let the IDE extension recreate the folder if permissions are incorrect.
  • Use the recommended project structure.
  • Double-check WSL2 and Docker context settings in VS Code.

If you provide the output of ls -ld as mentioned or run into further issues, I can help analyze and advise next steps.

Best regards,
Toradex AI Assistant.

References:

@ToradexAI

The results of the ls -ld command:

torizon@colibri-imx7-emmc-12828052:~$ ls -ld /home/torizon/snmptoserial /home/torizon/snmptoserial/src
ls: cannot access '/home/torizon/snmptoserial': No such file or directory
ls: cannot access '/home/torizon/snmptoserial/src': No such file or directory

It looks like the directory /home/SAbrahamian/snmptoserial is created on my imx7d.

torizon@colibri-imx7-emmc-12828052:~$ ls
docker-compose.yml  run  snmptoserial.tar
torizon@colibri-imx7-emmc-12828052:~$ pwd
/home/torizon
torizon@colibri-imx7-emmc-12828052:~$ cd ..
torizon@colibri-imx7-emmc-12828052:/home$ ls
SAbrahamian  torizon
torizon@colibri-imx7-emmc-12828052:/home$ cd SAbrahamian/
torizon@colibri-imx7-emmc-12828052:/home/SAbrahamian$ ls -lR
.:
total 4
drwxr-xr-x 4 root root 4096 May 23 13:40 snmptoserial

./snmptoserial:
total 8
drwxr-xr-x 2 root root 4096 May 23 13:40 mib
drwxr-xr-x 2 root root 4096 May 23 13:40 src

./snmptoserial/mib:
total 0

./snmptoserial/src:
total 0

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

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


Thank you for providing the output. The issue is clear now:

  • Your files and directories are being created in /home/SAbrahamian/ rather than /home/torizon/ on your target device.
  • These directories are owned by root, not by the torizon user. This is why you get permission errors when debugging or syncing files.

Best Practice per Torizon Documentation:

  • Files and code should reside under /home/torizon on the device.
  • These files should be owned by the torizon user for the IDE extension, containers, and debugging to work correctly.
    Reference

Solution Steps

  1. Remove Incorrectly Created Folders on the Device

    sudo rm -rf /home/SAbrahamian/snmptoserial
    
  2. Create Your Project Directory in the Correct Location with Correct Ownership

    mkdir -p /home/torizon/snmptoserial
    chown -R torizon:torizon /home/torizon/snmptoserial
    
  3. Update Your VS Code and Docker Settings

    • Ensure your project configuration (settings.json, docker-compose.yml, etc.) is mapping volumes and referring to /home/torizon/snmptoserial, not /home/SAbrahamian/snmptoserial.
    • See: Workspace files and files inside containers
  4. Retry Debugging

    • After making these changes, use VS Code to deploy/debug your application again.
    • The extension should now sync files to /home/torizon/snmptoserial, with proper permissions.

If you are still experiencing issues after these changes, please share your settings.json and docker-compose.yml so I can help verify your configuration.

Best regards,
Toradex AI Assistant.

Reference:

@ToradexAI

Still getting the rsync error. See attached settings.json and docker_compose.yml.

launch.json (1.6 KB)
docker-compose.yml (819 Bytes)

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

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


Thank you for your update and sharing your configuration files.

Here are some checklist items and recommendations to address persistent rsync errors when using the Torizon IDE Extension with Python projects:


1. device_cgroup_rules and /dev Binding

Ensure your docker-compose.yml contains the following under your service. This is required for peripheral/device access and permissions:

device_cgroup_rules:
  - "c 254:* rmw"
volumes:
  - type: bind
    source: /dev
    target: /dev

See reference:


2. Python Project Structure and Requirements

Check that you have the proper requirements*.txt files in your project root:

  • requirements-local.txt
  • requirements-debug.txt
  • requirements-release.txt

If they are missing, the IDE may not sync or set up the Python environment as expected.
See:


3. Use Torizon Python Template Structure

Double-check your directory layout on your host matches the template (from VS Code > Torizon IDE extension > New Project > Python Application). If you created the project manually or outside the template, some helper scripts and expected folder structure may be missing and cause sync failures.

Reference template:


4. Clean Up Target Directories

SSH into your device and remove any project folders you created manually:

rm -rf /home/torizon/snmptoserial

Let the Torizon IDE extension and rsync re-create the directory and deploy your code.


5. Directory Permissions

Make sure any folders that exist under /home/torizon/ are owned by user torizon (should be done by the IDE, but check anyway):

sudo chown -R torizon:torizon /home/torizon/

6. VS Code / WSL / Docker Context

  • Ensure you are working from the correct directory inside the WSL instance if you use Windows with WSL2.
  • Make sure the Docker engine is accessible from inside WSL and VS Code is attached to your WSL workspace.

7. If the Problem Persists

If after these checks you are still getting rsync exit code 23, please:

  • Copy/paste the full error output from both the VS Code debug pane and the terminal.
  • Confirm you have not created any directories/files as root in /home/torizon, and nothing remains in /home/SAbrahamian on the target.
  • Provide a brief tree structure of your project from your host, for example:
    snmptoserial/
      .devcontainer/
      .vscode/
      src/
        main.py
      mib/
        SNMPTOSERIAL-MIB.py
      requirements-debug.txt
      requirements-local.txt
      requirements-release.txt
      docker-compose.yml
    

Let me know the results after verifying these points.

Best regards,
Toradex AI Assistant.

References:

@ToradexAI

Still getting the same error, rsync exit core 23.

Here is the complete terminal output.

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


⚠️ VALIDATING ENVIRONMENT

OS:         Linux
OS Version: 5.15.167.4-microsoft-standard-WSL2
OS Arch:    x86_64
Under WSL:  Torizon
VS Code:
1.100.2
848b80aeb52026648a8ff9f7c45a9b0a80641e2e
x64

TOR Extension:  toradex.apollox-vscode@3.0.4

✅ Environment is valid!

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

 *  Executing task: bash -c [[ ! -z "10.85.76.237" ]] && true || false 

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

 *  Executing task: bash -c [[ "armv7l" == "armv7l" ]] && true || false 

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

 *  Executing task: sleep 1 

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

 *  Executing task: sshpass -p torizon scp -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /home/SAbrahamian/snmptoserial/docker-compose.yml torizon@10.85.76.237:~/ 

Warning: Permanently added '10.85.76.237' (ED25519) to the list of known hosts.
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: DOCKER_HOST=10.85.76.237:2375 docker image prune -f --filter=dangling=true 

Total reclaimed space: 0B
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: docker compose -p torizon stop snmptoserial snmptoserial-debug && docker compose -p torizon rm -f snmptoserial snmptoserial-debug 

[+] Stopping 1/1
 ✔ Container torizon-snmptoserial-debug-1  Stopped                                                                                               0.8s 
Going to remove torizon-snmptoserial-debug-1
[+] Removing 1/1
 ✔ Container torizon-snmptoserial-debug-1  Removed                                                                                               0.0s 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: xonsh /home/SAbrahamian/snmptoserial/.conf/torizon-packages.xsh armhf 

Applying torizonPackages.json: 
Applying to Dockerfile.debug ...
✅ Dockerfile.debug
Applying to Dockerfile ...
✅ Dockerfile
torizonPackages.json applied
 *  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/snmptoserial --build-arg IMAGE_ARCH=arm --build-arg DEBUG_SSH_PORT=6502 --build-arg GPU= snmptoserial-debug 

WARN[0000] The "DOCKER_LOGIN" variable is not set. Defaulting to a blank string. 
Compose can now delegate builds to bake for better performance.
 To do so, set COMPOSE_BAKE=true.
[+] Building 0.6s (17/17) FINISHED                                                                                                     docker:default
 => [snmptoserial-debug internal] load build definition from Dockerfile.debug                                                                    0.0s
 => => transferring dockerfile: 3.18kB                                                                                                           0.0s
 => [snmptoserial-debug internal] load metadata for docker.io/torizon/debian:4                                                                   0.4s
 => [snmptoserial-debug internal] load .dockerignore                                                                                             0.0s
 => => transferring context: 117B                                                                                                                0.0s
 => [snmptoserial-debug  1/11] FROM docker.io/torizon/debian:4@sha256:cca23c84946621ee72aae4593da5f3e004bf211c28e577810b1068bde5ed414c           0.0s
 => [snmptoserial-debug internal] load build context                                                                                             0.0s
 => => transferring context: 426B                                                                                                                0.0s
 => CACHED [snmptoserial-debug  2/11] RUN apt-get -q -y update &&     apt-get -q -y install     openssl     openssh-server     rsync     file    0.0s
 => CACHED [snmptoserial-debug  3/11] RUN apt-get -q -y update &&     apt-get -q -y install     &&     apt-get clean && apt-get autoremove &&    0.0s
 => CACHED [snmptoserial-debug  4/11] RUN python3 -m venv /home/torizon/snmptoserial/.venv --system-site-packages                                0.0s
 => CACHED [snmptoserial-debug  5/11] COPY requirements-debug.txt /requirements-debug.txt                                                        0.0s
 => CACHED [snmptoserial-debug  6/11] RUN . /home/torizon/snmptoserial/.venv/bin/activate &&     pip3 install --upgrade pip && pip3 install -r   0.0s
 => CACHED [snmptoserial-debug  7/11] COPY ./src /home/torizon/snmptoserial/src                                                                  0.0s
 => CACHED [snmptoserial-debug  8/11] COPY ./mib /home/torizon/snmptoserial/mib                                                                  0.0s
 => CACHED [snmptoserial-debug  9/11] WORKDIR /home/torizon/snmptoserial                                                                         0.0s
 => CACHED [snmptoserial-debug 10/11] RUN mkdir /var/run/sshd &&     sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.  0.0s
 => CACHED [snmptoserial-debug 11/11] RUN rm -r /etc/ssh/ssh*key &&     dpkg-reconfigure openssh-server                                          0.0s
 => [snmptoserial-debug] exporting to image                                                                                                      0.0s
 => => exporting layers                                                                                                                          0.0s
 => => writing image sha256:d0b1bf440627e6977d58fbb69dee71c2efea50e1c7cb4a7a5dd89083bf8d2bbc                                                     0.0s
 => => naming to localhost:5002/snmptoserial-debug:arm                                                                                           0.0s
 => [snmptoserial-debug] resolving provenance for metadata file                                                                                  0.0s
[+] Building 1/1
 ✔ snmptoserial-debug  Built                                                                                                                     0.0s 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: DOCKER_HOST= docker compose push snmptoserial-debug 

WARN[0000] The "DOCKER_LOGIN" variable is not set. Defaulting to a blank string. 
[+] Pushing 21/21
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: e2c170d9c043 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: d1d4f1312f88 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: 5f70bf18a086 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: b091f42978ca Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: 3e83aa94c06e Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: 7c4175b59f6b Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: d499d1f963f7 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: 4a78592ef159 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: c07ffed1c335 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: 65bbd1d208be Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: ef5ab135b4e1 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: f99f70316fa3 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: fa2dce02044a Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: e628b845e5bb Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: b59f2aa6363d Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: c455775deeb7 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: db9633f880e7 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: 7badfc094340 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: baf3d25fce37 Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: 12fce3d881fc Layer already exists                                                              0.0s 
 ✔ Pushing localhost:5002/snmptoserial-debug:arm: 110531016d3b Layer already exists                                                              0.0s 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: DOCKER_HOST=10.85.76.237:2375 LOCAL_REGISTRY=10.85.76.210 TAG=arm GPU= DEBUG_SSH_PORT=6502 DEBUG_PORT1=6512 DEBUG_PORT2= DEBUG_PORT3= docker compose pull snmptoserial-debug 

WARN[0000] The "DOCKER_LOGIN" variable is not set. Defaulting to a blank string. 
[+] Pulling 1/1
 ✔ snmptoserial-debug Pulled                                                                                                                     0.2s 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: DOCKER_HOST=10.85.76.237:2375 LOCAL_REGISTRY=10.85.76.210 TAG=arm GPU= DEBUG_SSH_PORT=6502 DEBUG_PORT1=6512 DEBUG_PORT2= DEBUG_PORT3= docker compose -p torizon up -d snmptoserial-debug 

WARN[0000] The "DOCKER_LOGIN" variable is not set. Defaulting to a blank string. 
[+] Running 1/1
 ✔ Container torizon-snmptoserial-debug-1  Started                                                                                               1.9s 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 6502 torizon@10.85.76.237 pkill python3 || true 

Warning: Permanently added '[10.85.76.237]:6502' (ED25519) to the list of known hosts.
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: rsync -P -av -e ssh -p 6502 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /home/SAbrahamian/snmptoserial/src torizon@10.85.76.237:/home/torizon/snmptoserial/ 

Warning: Permanently added '[10.85.76.237]:6502' (ED25519) to the list of known hosts.
sending incremental file list
rsync: [generator] chgrp "/home/torizon/snmptoserial/src" failed: Operation not permitted (1)
rsync: [generator] chgrp "/home/torizon/snmptoserial/src/main.py" failed: Operation not permitted (1)
src/

sent 115 bytes  received 23 bytes  276.00 bytes/sec
total size is 8,597  speedup is 62.30
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]

 *  The terminal process "rsync '-P', '-av', '-e', 'ssh -p 6502 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null', '/home/SAbrahamian/snmptoserial/src', 'torizon@10.85.76.237:/home/torizon/snmptoserial/'" terminated with exit code: 23. 
 *  Terminal will be reused by tasks, press any key to close it.

This is no output on the debug pane.
The directory /home/torizon/snmptoserial was not created on the target.
The directory /home/SAbrahamian was not created on the target.

My directory structure on my development PC

snmptoserial/
    .conf/
    .doc/
    .github/
    .venv/
    .vscode/
    mib/
        __pycache__/
        SNMPTOSERIAL-MIB.py
        SNMPTOSERIAL-MIB.txt
        SNMPv2-CONF.txt
        SNMPv2-SMI.txt
        SNMPv2-TC.txt
    src/
        main.py
    test/
        compile_mib.py
        test.py
    .dockerignore
    .gitignore
    .gitlab-ci.yml
    docker-compose.yml
    Dockerfile
    Dockerfile.debug
    requirements-debug.txt
    requirements-local.txt
    requirements-release.txt
    torizonPagages.json

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

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


Thank you for your detailed information and full logs.

Your rsync error is now:

rsync: [generator] chgrp "/home/torizon/snmptoserial/src" failed: Operation not permitted (1)
rsync: [generator] chgrp "/home/torizon/snmptoserial/src/main.py" failed: Operation not permitted (1)

This is a harmless warning unless your workflow depends on group ownership specifically. The files are syncing, but rsync cannot change the group to match the source. This is common with rootless users or containers.

Why this rsync warning occurs:

  • By default, rsync tries to preserve file group ownership (-a archive mode).
  • The torizon user on your target does not have permission to change file group (chgrp) on /home/torizon (unless the group is already torizon or you are root).
  • The discussion here is focused on application development, and you do not need to preserve group ownership for most user projects.

How to resolve or suppress this warning:

1. Ignore the warning (preferred if code syncs!)

If your files are in place (/home/torizon/snmptoserial/src/main.py exists and is owned by torizon), you can safely ignore this warning as it does not affect normal code deployment or debugging.

2. (Optional) Modify rsync behavior in your VS Code tasks (if possible)

You can add the --no-group option to the rsync command (removes group preservation):

rsync -P -av --no-group ...

With Torizon Core IDE extension, this is not user-configurable and would require the extension to support it.

3. Clean up any root-owned files (so group changes are never required)

Double-check:

sudo chown -R torizon:torizon /home/torizon

If /home/torizon/snmptoserial doesn’t exist, let the VS Code extension create it.


Important Checks

  1. Does your code now show up on the device?

    ls -la /home/torizon/snmptoserial/src
    

    You should see main.py.

  2. Did the IDE extension successfully start the containerized debug session?

    • If yes, you only have harmless rsync group warnings.
    • If not, check for file existence and ownership.
  3. You mention /home/SAbrahamian is not created — this is now correct. Your deployment should now only use /home/torizon.


Summary

  • Harmless “Operation not permitted (1)” warnings from rsync’s chgrp can generally be ignored.
  • If you want zero warnings, ensure source files are in user (not root)-owned folders and group ownership matches, or modify rsync to skip group preservation.
  • As long as your deployment works and the debug session runs, you can continue.

References:

If your application still does not launch, or /home/torizon/snmptoserial/src is missing, please confirm and provide the output of:

ls -la /home/torizon
ls -la /home/torizon/snmptoserial
ls -la /home/torizon/snmptoserial/src

Best regards,
Toradex AI Assistant.

@ToradexAI

The application doesn’t launch and /home/torizon/snmptoserial/src is missing.

torizon@colibri-imx7-emmc-12828052:~$ ls -la /home/torizon
total 224268
drwxr-xr-x 2 torizon torizon      4096 May 23 14:57 -
drwxr-xr-x 4 torizon torizon      4096 May 23 15:31 .
drwxr-xr-x 3 root    root         4096 May 23 15:31 ..
-rw------- 1 torizon torizon      5028 May 23 16:57 .bash_history
-rwxr-xr-x 1 torizon torizon       286 Jan  1  1970 .bashrc
-rwxr-xr-x 1 torizon torizon       241 Jan  1  1970 .profile
-rw-r--r-- 1 torizon torizon       776 May 23 16:58 docker-compose.yml
drwxr-xr-x 3 torizon torizon      4096 May 12 12:42 run
-rw------- 1 torizon torizon 229607936 May 23 15:05 snmptoserial.tar
torizon@colibri-imx7-emmc-12828052:~$ ls -la /home/torizon/snmptoserial
ls: cannot access '/home/torizon/snmptoserial': No such file or directory
torizon@colibri-imx7-emmc-12828052:~$ ls -la /home/torizon/snmptoserial/src
ls: cannot access '/home/torizon/snmptoserial/src': No such file or directory

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

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


Hello and thank you for your reply!

Your output shows that /home/torizon/snmptoserial and its src subdirectory are missing. There is also a stray directory named - in /home/torizon, and a very large snmptoserial.tar archive. This indicates issues with the workspace clean-up and file synchronization.

This situation is known to cause problems with the Torizon IDE Extension, especially with rsync and folder mapping. Let’s clean up and enforce the correct state on your board and in your project configuration.


1. Clean up the Target Device

SSH into the device and run:

rm -rf /home/torizon/-
rm -f /home/torizon/snmptoserial.tar

Both of those should not be present. The directory - is a common artifact if sync or tar commands are run with mistakes in their parameters.


2. Correct Your Project Configuration

Review your docker-compose.yml. It should look similar to this (if using Python as described in the Torizon Python example):

version: "3.9"
services:
  snmptoserial-debug:
    build:
      context: .
      dockerfile: Dockerfile.debug
    image: ${LOCAL_REGISTRY}:5002/snmptoserial-debug:${TAG}
    ports:
      - 6502:6502
      - 6512:6512
    device_cgroup_rules:
      - "c 254:* rmw"
    volumes:
      - type: bind
        source: /dev
        target: /dev
  • The important part is that the expected code directory is /home/torizon/snmptoserial.
  • Your Dockerfile.debug should be set up to expect code in /home/torizon/snmptoserial.

3. Retry with a Clean Device State

  1. Stop any running debugs or containers.
  2. Remove any manually created project directories if they exist:
    rm -rf /home/torizon/snmptoserial
    
  3. With VS Code closed, open it and try to debug again.
    The extension should now re-create /home/torizon/snmptoserial and subfolders, then sync your code into it.

4. If Problems Persist

  • Double-check your IDE settings to ensure “Workspace Directory” is set to the project folder, not a custom path.
  • Ensure you haven’t changed the deploy target in settings or tasks.
  • Make sure all permissions on /home/torizon and its subfolders are for user/group torizon.

Summary

  • Remove /home/torizon/– and /home/torizon/snmptoserial.tar
  • Double-check your docker-compose.yml and source/deploy folders
  • Let the Torizon IDE extension manage folder creation & synchronization after cleaning up

Let me know the results after following these steps. If you still encounter errors, please share the project settings in VS Code (Torizon section) and the full output after these actions.

Best regards,
Toradex AI Assistant.

References:

@ToradexAI

I did remove the ‘-’ directory and snmptoserial.tar from my target.

torizon@colibri-imx7-emmc-12828052:~$ ls -al /home/torizon 
total 32
drwxr-xr-x 3 torizon torizon 4096 May 23 17:30 .
drwxr-xr-x 3 root    root    4096 May 23 15:31 ..
-rw------- 1 torizon torizon 5225 May 23 17:38 .bash_history
-rwxr-xr-x 1 torizon torizon  286 Jan  1  1970 .bashrc
-rwxr-xr-x 1 torizon torizon  241 Jan  1  1970 .profile
-rw-r--r-- 1 torizon torizon  776 May 23 17:55 docker-compose.yml
drwxr-xr-x 3 torizon torizon 4096 May 12 12:42 runtorizon@colibri-imx7-emmc-12828052:~$ ls -al /home/torizon 
total 32
drwxr-xr-x 3 torizon torizon 4096 May 23 17:30 .
drwxr-xr-x 3 root    root    4096 May 23 15:31 ..
-rw------- 1 torizon torizon 5225 May 23 17:38 .bash_history
-rwxr-xr-x 1 torizon torizon  286 Jan  1  1970 .bashrc
-rwxr-xr-x 1 torizon torizon  241 Jan  1  1970 .profile
-rw-r--r-- 1 torizon torizon  776 May 23 17:55 docker-compose.yml
drwxr-xr-x 3 torizon torizon 4096 May 12 12:42 run

I double checked docker-compose.yml and it looks correct. See attached.
docker-compose.yml (776 Bytes)

I made sure no containers were running and closed VS Code. I reopened and tried to debug again and got the same rsync error, exit code 23.

I looked at the settings and the Workspace Directory and i found that torizon_workspace = $(workspaceFolder), matching my settings.json file.

What am I missing?

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

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


Hello, thank you for your careful testing and configuration review.

Based on your latest description, the key issue is that the source of your files for rsync is:

/home/SAbrahamian/snmptoserial/src

…while the destination on the target is:

/home/torizon/snmptoserial/

Yet, /home/torizon/snmptoserial is not being created, and no files appear there after syncing.

This points to a mismatch between your VS Code workspace root and what the Torizon IDE extension expects for project structure and deployment.


Steps to Resolve

1. Ensure VS Code Is Opened in the Correct Workspace

Open your project in VS Code by opening the folder that contains your .vscode directory (e.g., the snmptoserial folder itself), not a parent or subdirectory.
VS Code should display snmptoserial as the “opened folder” in the Explorer pane.

The correct structure should look like:

snmptoserial/
  .vscode/
  docker-compose.yml
  Dockerfile
  Dockerfile.debug
  requirements-debug.txt
  requirements-local.txt
  requirements-release.txt
  mib/
  src/

The .vscode/settings.json should have:

"torizon_app_root": "/home/torizon/snmptoserial"

See:


2. Clean and Let the Extension Create Destination Folder

On your target:

rm -rf /home/torizon/snmptoserial

Do not manually create /home/torizon/snmptoserial; let VS Code and the extension do it for you.


3. Confirm Sync Paths in Settings

  • In .vscode/settings.json, verify you have:
    "torizon_app_root": "/home/torizon/snmptoserial"
    
  • Confirm your project is not set up to point to /home/SAbrahamian/... anywhere in your settings or tasks.

4. (Workaround) If VS Code is Opened from Windows Instead of WSL

If you are on Windows and launch VS Code from the Windows environment (not directly from inside WSL2!), file paths may not be Linux-style and can confuse the extension.

Solution:

  • Open a WSL2 shell (wsl.exe)
  • Inside the shell, run cd ~/snmptoserial (or wherever your project is in the WSL Linux filesystem)
  • Type code .
    This ensures all paths are Linux-style and extensions use Linux paths for rsync and deployment.

See:


5. Ensure All Files and Subdirectories Are User-Owned

It doesn’t hurt to run:

sudo chown -R torizon:torizon /home/torizon/

Again, do not manually create /home/torizon/snmptoserial at this point.


6. Try Debugging Again

After following the above, click Debug again in VS Code.

If you still get errors, double-check the full error message and note which source path rsync is trying to push.


Troubleshooting

  • If the rsync command still shows a source of /home/SAbrahamian/snmptoserial/** rather than your workspace’s path in WSL2 (typically /home/<your-wsl-username>/snmptoserial/), then your VS Code is likely running outside of WSL2 context.
  • If that is the case, always launch VS Code using code . from inside WSL2 shell.

Reference Docs


Summary:
Open VS Code inside your WSL2 Linux home directory using code ..
Confirm your workspace folder is your project root, not a subfolder or Windows folder.
Let the extension manage /home/torizon/snmptoserial.
Check that source and destination sync paths match the intended flow (no /home/SAbrahamian on the target).

Let me know your results after doing this.

Best regards,
Toradex AI Assistant.

@ToradexAI

I did open VS Code through WSL.exe using code .

My workspace is the /home/SAbrahamian/snmptoserial folder.

Where do I find the settings for source and destination sync paths to ensure that they match?

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

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


Hello! Great question.

To ensure that your Torizon IDE Extension is syncing your files from the correct local directory (/home/SAbrahamian/snmptoserial) to the correct target path (/home/torizon/snmptoserial), you should check the following configuration files in your VS Code workspace:


1. .vscode/settings.json

Open .vscode/settings.json in your project root (/home/SAbrahamian/snmptoserial/.vscode/settings.json). You should see:

{
  "torizon_app_root": "/home/torizon/snmptoserial",
  "torizon_workspace": "${workspaceFolder}"
}
  • torizon_app_root sets the remote (target) path.
  • torizon_workspace should reference your local workspace folder (which, when you open VS Code with code . inside your Linux WSL2 home, is /home/SAbrahamian/snmptoserial).

Reference:


2. docker-compose.yml

Open your docker-compose.yml and make sure you are not mapping the whole application directory from host to target device as a volume (that’s not the default for Torizon template projects). Only /dev should be mapped like this:

volumes:
  - type: bind
    source: /dev
    target: /dev

This allows device access for things like GPIO but should not override your code directory.

Reference:


3. Launch configuration (.vscode/launch.json)

Typically, the launch config for debugging should be (for Python):

{
  "program": "${workspaceFolder}/src/main.py"
}

Reference:


4. Review the sync behavior

If you have opened your project with code . from within your WSL home directory and torizon_workspace is set to ${workspaceFolder}, then file sync should work. If the IDE is still trying to sync other paths or erroring, try these steps:

  1. Double-check that you have not manually created /home/torizon/snmptoserial on the target. The IDE should create it automatically.
  2. Look at the “Torizon: Project” section in the VS Code status bar (bottom). It should list the correct local workspace folder and Torizon device information.
  3. Check your VS Code “Workspace” folder via File → Open Folder… It should be /home/SAbrahamian/snmptoserial, not a parent or subfolder.

5. What if problems persist?

  • Delete any remote /home/torizon/snmptoserial folders manually.
  • Make sure there aren’t additional custom settings in .vscode/settings.json (besides the above).
  • Reopen VS Code with the correct directory as your workspace root.

Let me know if your .vscode/settings.json matches the above and if you’re still seeing the wrong sync path!

Best regards,
Toradex AI Assistant.


References:

For some reason my workspace was looking at /home/SAbrahamian/ instead of /home/SAbrahamian/snmptoserial/

I fixed this by selecting the folder /home/SAbrahamian/snmptoserial/ folder after clicking File>Open File. I then saved the workspace by clicking File>Save Workspace As and saved that file in my /home/SAbrahamian/snmptoserial/ folder.

I am able to debug again!

@ToradexAI
I made the changes to launch.json, settings.json, and docker-compose.yml. But I am still getting an error popup that says preLaunchTask ‘deploy-torizon-arm’ terminated with exit code 1.

Clicking “debug anyway” yields another popup that says “connect ECONNREFUSED 10.85.76.237:6512” and prompts me to open launch.json

How do I fix this error?

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

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


Hello! Let’s address the new errors you’re seeing:


1. preLaunchTask ‘deploy-torizon-arm’ terminated with exit code 1

This generally means something failed during the deployment task. The most common reasons are:

  • Docker Compose is not able to cleanly start/stop containers.
  • Networking to the device is blocked or unstable.
  • Required debug ports are not open or mapped in docker-compose.yml.
  • Previous containers/files are interfering with new deployment.

2. connect ECONNREFUSED 10.85.76.237:6512

This indicates that the Visual Studio Code extension on your PC can’t reach the debug server on the target device at port 6512. Root causes can include:

  • The debug container is not running or crashed.
  • The required port mapping is missing.
  • A firewall or network issue is blocking the port.

What To Do

A. Verify docker-compose.yml Has All Required Port Mappings

Open your docker-compose.yml and ensure your debug service includes:

ports:
  - "6502:6502"
  - "6512:6512"

Reference:


B. Check the Debug Container Status on Your Device

SSH into the device and run:

docker ps

You should see your debug container running, with both ports (6502 and 6512) exposed.


C. Clean Up Any Orphaned Containers

Still via SSH, run:

docker compose -p torizon stop
docker compose -p torizon rm -f

D. Ensure No Other Process Is Using Port 6512

On your device:

netstat -tuln | grep 6512

You should see docker-proxy or similar. If nothing is shown or a different process is bound, this may be the cause.


E. Check launch.json for Port Consistency

In your .vscode/launch.json, verify the debug configuration uses exactly port 6512 and not another value.
Reference:


F. Restart & Retry Debugging

  • Stop all VS Code/IDE tasks.
  • Make sure containers are stopped and removed.
  • Start debugging again from scratch.

G. If problems persist

Please share:

  • The output of docker ps on your target.
  • The relevant parts of your docker-compose.yml and .vscode/launch.json.
  • Any new error console logs.

Let me know what you find from these steps, and we can proceed based on your results.

Best regards,
Toradex AI Assistant.


References:

@ToradexAI

This is the output of docker ps on my target board:

torizon@colibri-imx7-emmc-12828052:~$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

Attached are docker-compose.yml, launch.json, and settings.json
settings.json (834 Bytes)
launch.json (1.6 KB)
docker-compose.yml (954 Bytes)

This is the error shown on the terminal when attempting to debug.

*  Executing task in folder snmptoserial: xonsh .conf/validate-deps-running.xsh 


⚠️ VALIDATING ENVIRONMENT

OS:         Linux
OS Version: 5.15.167.4-microsoft-standard-WSL2
OS Arch:    x86_64
Under WSL:  Torizon
VS Code:
1.100.2
848b80aeb52026648a8ff9f7c45a9b0a80641e2e
x64

TOR Extension:  toradex.apollox-vscode@3.0.4

✅ Environment is valid!

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

 *  Executing task in folder snmptoserial: bash -c [[ ! -z "10.85.76.237" ]] && true || false 

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

 *  Executing task in folder snmptoserial: bash -c [[ "armv7l" == "armv7l" ]] && true || false 

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

 *  Executing task in folder snmptoserial: sleep 1 

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

 *  Executing task in folder snmptoserial: sshpass -p torizon scp -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /home/SAbrahamian/snmptoserial/docker-compose.yml torizon@10.85.76.237:~/ 

Warning: Permanently added '10.85.76.237' (ED25519) to the list of known hosts.
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task in folder snmptoserial: DOCKER_HOST=10.85.76.237:2375 docker image prune -f --filter=dangling=true 

Total reclaimed space: 0B
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task in folder snmptoserial: docker compose -p torizon stop snmptoserial snmptoserial-debug && docker compose -p torizon rm -f snmptoserial snmptoserial-debug 

No stopped containers
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task in folder snmptoserial: xonsh /home/SAbrahamian/snmptoserial/.conf/torizon-packages.xsh armhf 

Applying torizonPackages.json: 
Applying to Dockerfile.debug ...
✅ Dockerfile.debug
Applying to Dockerfile ...
✅ Dockerfile
torizonPackages.json applied
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task in folder snmptoserial: DOCKER_HOST= docker compose build --pull --build-arg SSHUSERNAME=torizon --build-arg APP_ROOT=/home/torizon/snmptoserial --build-arg IMAGE_ARCH=arm --build-arg DEBUG_SSH_PORT=6502 --build-arg GPU= snmptoserial-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 build --pull --build-arg SSHUSERNAME=torizon --build-arg APP_ROOT=/home/torizon/snmptoserial --build-arg IMAGE_ARCH=arm --build-arg DEBUG_SSH_PORT=6502 --build-arg GPU= snmptoserial-debug'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it.

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

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


Hello! Thank you for your detailed information and attached configs.

The critical error in your log is:

no port specified: :

This is a known symptom of a misconfiguration in your docker-compose.yml under the debug service’s ports: section—or an empty/unexpected variable is being referenced to specify a port.

Let’s resolve this step by step:


1. Check your docker-compose.yml “ports” section

Your debug service should contain fully-specified ports like this:

ports:
  - "6502:6502"
  - "6512:6512"

Remove/avoid: any entries like - “:${DEBUG_PORT3}” or entries referencing empty variables.

To be sure, your docker-compose.yml should resemble:

services:
  snmptoserial-debug:
    build:
      context: .
      dockerfile: Dockerfile.debug
    image: ${LOCAL_REGISTRY}:5002/snmptoserial-debug:${TAG}
    ports:
      - "6502:6502"
      - "6512:6512"
    device_cgroup_rules:
      - "c 254:* rmw"
    volumes:
      - type: bind
        source: /dev
        target: /dev

Reference:
Programming Languages and Frameworks - NodeJS on Torizon: docker-compose example


2. Check for Empty Variables in the Ports Section

Sometimes IDE-generated docker-compose.yml puts something like:

ports:
  - "${DEBUG_PORT1}"
  - "${DEBUG_PORT2}"
  - "${DEBUG_PORT3}"

If ${DEBUG_PORT3} is empty or undefined, Docker Compose will complain: no port specified: :<empty>.

Solution: Remove or comment out any ${DEBUG_PORTX} lines that are not set in your environment.


3. Clean up orphaned settings or launch.json links

  • Make sure your .vscode/launch.json doesn’t reference undefined debug ports or “dummy” configurations.
  • The critical part is your docker-compose.yml; if it lists an empty port, the build will always fail.

4. If after fixing docker-compose.yml the issue persists

  • Close VS Code.
  • Reopen using code . from your project root.
  • Try again.

5. Summary of Actions

  • Edit docker-compose.yml so the ports: section only lists fully-expanded (non-empty!) ports, e.g., “6502:6502”.
  • Save and rerun the build/debug workflow.

Let me know if the debug container launches (visible in docker ps) and if you can now move forward!

Best regards,
Toradex AI Assistant.


References:

OK, there are multiple responses to my query. I hope I didn’t break anything.