Tcb-build "Failed to initialize: protocol not available"

Here I just set up a brand new torizon-core builder project in VSCode. When I go to build it, using the “tcb-build” task, I get this error:

Failed to initialize: protocol not available

Executing task: DOCKER_HOST= source ./.conf/tcb-env-setup.sh -s /home/jzylkin/ChipotleOsBuild/storage -t 3.13.0 

Warning: If you intend to use torizoncore-builder as a server (listening to ports), then you should pass extra parameters to "docker run" (via the -- switch).
Failed to initialize: protocol not available
Setting up TorizonCore Builder with version 3.13.0.

TorizonCore Builder command executed:

 torizoncore-builder --verbose build 

Failed to initialize: protocol not available

 *  The terminal process "/usr/bin/bash '-c', 'DOCKER_HOST= source ./.conf/tcb-env-setup.sh -s /home/jzylkin/ChipotleOsBuild/storage -t 3.13.0'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

I am a little confused what DOCKER_HOST=source means here… I have never seen “source” as a docker host.

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 your question.

You are right that the use of DOCKER_HOST= source ... looks confusing. Here’s a clarification:

  • The line you see,
    DOCKER_HOST= source ./.conf/tcb-env-setup.sh -s /home/jzylkin/ChipotleOsBuild/storage -t 3.13.0
    
    is actually two separate things:
    1. DOCKER_HOST= sets the DOCKER_HOST environment variable to an empty string.
    2. source ./.conf/tcb-env-setup.sh ... executes the TorizonCore Builder setup script in the current shell.

Typically, you only need to source the setup script, like so:

source ./.conf/tcb-env-setup.sh -s /home/jzylkin/ChipotleOsBuild/storage -t 3.13.0

(Reference - Installing TorizonCore Builder)

About the error message:

Failed to initialize: protocol not available

This error usually suggests an issue with the Docker daemon connection. The TorizonCore Builder relies on Docker, so for it to function correctly:

  1. Ensure Docker is installed and running on your system.
    • You can check by running: docker info
  2. Make sure your user has permission to access Docker.
    • On many systems, you need to be in the docker group. You can verify with groups and add yourself with sudo usermod -aG docker $USER, then log out and back in.
  3. There should be no need to set DOCKER_HOST unless your Docker daemon is running somewhere non-default.
  4. Double-check that your terminal or VSCode task isn’t inadvertently unsetting/fiddling with Docker environment variables.

Recommended next steps:

  • Try running the setup in a fresh terminal with:
    source ./.conf/tcb-env-setup.sh -s /home/jzylkin/ChipotleOsBuild/storage -t 3.13.0
    torizoncore-builder --version
    
    This should show the builder version if everything is set up correctly.

If you still see the error, please verify your Docker installation and environment, then try running the task again.

For reference, see the TorizonCore Builder documentation:
https://developer.toradex.com/torizon/os-customization/use-cases/pre-provisioning-docker-containers-onto-a-torizoncore-image/#installing-torizoncore-builder

Let me know if you want additional troubleshooting tips!

Best regards,
Toradex AI Assistant.

When I type “docker info” I get a bunch of information about the docker engine that is running on my Ivy board.

I also have a Docker Desktop engine running on my PC, but it seems like the Torizon plugin always wants to use the one on my Ivy board. In VSCode I can see that I have two Docker “Contexts” – one is docker-desktop and the other is my Ivy board. The Ivy board is always selected as “default”. I do not know how to change to use Docker Desktop as my default. Meanwhile my Ivy board is not connected to the internet so it is not very good at pulling things from Docker hub. Is this an issue? How do I just use my own PC’s docker engine?

It actually looks like it’s already targeting the Docker context on your PC. At least going off the logs you provided. I can see DOCKER_HOST= is not set to anything. No it’s not set to source there is a clear space between DOCKER_HOST= and source in your logs. This should mean then that the Docker context used defaults to the host system (your PC).

Perhaps there is an issue with the Docker installation on your PC?

You mentioned you installed Docker Desktop, so I assume you’re on Windows? In any case we typically don’t recommend using Docker Desktop and just installing Docker Enginer as it has been known to be problematic with compatibility of our tools.

Best Regards,
Jeremias

I stopped using docker desktop and I am now on Torizon distro of WSL, which has its own Docker server. I am using that now.

The secret was understanding that DOCKER_HOST= means my own PC and without it docker always runs on the target board. This really helped me understand what is going on with the process of building and deploying.