Trying to build a torizon install, with my Overlay

OK, so I am using builder and have created an overlay that I have installed, which works.
I have a CUSTOM directory with those changes.
when I run dto apply, it already says my dto has been applied. OK.
I had one small change to fstab which was captured with “isolate”. on my board letting it use the default directory.
So at this point I think I am ready to run the union command. However, when I do I get:
torizoncore-builder union --body testOfUnion MyCustomDir
Applying changes from STORAGE/changes.
An unexpected Exception occurred. Please provide the following stack trace to
the Toradex TorizonCore support team:

Traceback (most recent call last):
File “/builder/torizoncore-builder”, line 221, in
mainargs.func(mainargs)
File “/builder/tcbuilder/cli/union.py”, line 259, in do_union
union(args.changes_dirs, args.storage_directory,
File “/builder/tcbuilder/cli/union.py”, line 225, in union
commit = ub.union_changes(
File “/builder/tcbuilder/backend/union.py”, line 154, in union_changes
final_commit = commit_changes(
File “/builder/tcbuilder/backend/union.py”, line 137, in commit_changes
result, stats = repo.commit_transaction()
gi.repository.GLib.GError: g-io-error-quark: Invalid refspec MyCustomDir (0)

What am I missing?
I am using a nightly build. I wouldn’t think that is a problem, since it runs fine. Also, all the other options are optional, to me means that they are not required. The only thing that is required is the directory.
I am using a build of which I have deployed to my device and tested. Is that not the directory I’m supposed to use?

Steve

Hey @Evets,

The error you are getting suggest there is an issue with your MyCustomDir. Can you give more details on this directory and what steps you have done to produce this error.

-Eric

@eric.tx
I downloaded the original via the images download command from my board which is using a 6.6.0 nightly build, then ran builder to verify my .dts file, which created the custom directory. I did run unpack on that directory. and deployed it to my board for verification of the device tree changes.
I then ran builder with the isolate command to capture changes I made for fstab a few others. without giving a specific --changes-directory, since it says that is optional. That was succesful.
So, now I added to my tcbuild.yaml file:
bundle:
dir: bundle/
as directed in the TorizonCore Builder - Workflow | Toradex Developer Center page.

And then ran build. I did this a second time: I added debug info:

2024-03-08 19:50:41,594 - root - CRITICAL - An unexpected Exception occurred. Please provide the following stack trace to
the Toradex TorizonCore support team:

2024-03-08 19:50:41,595 - root - ERROR - Traceback (most recent call last):
File “/builder/torizoncore-builder”, line 221, in
mainargs.func(mainargs)
File “/builder/tcbuilder/cli/build.py”, line 479, in do_build
build(args.config_fname, args.storage_directory,
File “/builder/tcbuilder/cli/build.py”, line 465, in build
raise exc
File “/builder/tcbuilder/cli/build.py”, line 454, in build
handle_output_section(
File “/builder/tcbuilder/cli/build.py”, line 303, in handle_output_section
handle_bundle_output(
File “/builder/tcbuilder/cli/build.py”, line 321, in handle_bundle_output
comb_be.combine_image(**combine_params)
File “/builder/tcbuilder/backend/combine.py”, line 174, in combine_image
with open(target_name_file, ‘w’) as target_name_fd:
FileNotFoundError: [Errno 2] No such file or directory: ‘bundle/target_name’

Where does target_name get set?

Steve

Hey @Evets,

I assume the first issue has been solved and you have moved onto bundling your containers?

You do not mention running the bundle command. With how you have modified your tcbuild.yaml file you will need to run this command first. You can also pass your docker-compose file directly if you do not want to run the docker bundle command.

-Eric

@eric.tx, no never got past that. But yes, I went back to trying to bundle an image in with my stuff. It’s calling the right image, but it keeps saying it’s denied. I am logged into docker, but that’s what currently the error is, denied: requested access to the resource is denied. I’ve deleted my config file and relogged into docker, several different times, I had a saved image that runs fine on the board, but I pushed it back to my local repository, but it claims it can’t find it, (and to be honest, I don’t see it in the images either), so I just decided to use my last build debug image, and called that one out in my yml file. Builder says it’s fetching the right file, but says it can’t find it, even if it is running on the board. I can look in VSC and see the image it is using to create the container. It says the the same name I am using in my yml file, but if I list the images in docker desktop, it isn’t there. But if I list it in the command line it IS there.
In VSC, it lists it with the external IP address, not the local host one, and even though I put the external IP address it still uses the localhost IP and port. I’ve also tried without the IP address and with localhost in front. According to Docker, if it shows an ipaddress, it must be pulled that way. VSC uses my external IP address, where as when I see the images listed, it shows localhost:5002/myimage:arm64.
But if I use localhost:5002, I get using http://localhost:5002/v2/: dial tcp 127.0.0.1:5002: connect: connection refused"), it is not using an https connection, and it is adding /v2 inline. That seems weird.

I have also tried with the compose file being referenced in the tcbuild.yaml file via the page you referenced.
It has the same result, it can’t pull the image.

2024-03-12 14:21:56,694 - torizon.tcbuilder.backend.deploy - DEBUG - Running compress command: zstd --rm /workdir/torizon-core-docker-verdin-imx8mp-Tezi_6.6.0-devel-20240305+build.522.CUSTOM/torizon-core-docker-verdin-imx8mp.ota.tar
2024-03-12 14:22:01,555 - torizon.tcbuilder.backend.deploy - INFO - Packing rootfs done.
2024-03-12 14:22:01,556 - torizon.tcbuilder.backend.combine - INFO - Updating TorizonCore image in place.
2024-03-12 14:22:01,556 - torizon.tezi.image - DEBUG - No ‘filelist’ present in image configuration.
2024-03-12 14:22:01,556 - torizon.tezi.image - DEBUG - Reading json_data[key], value ‘TorizonCore’
2024-03-12 14:22:01,556 - torizon.tezi.image - DEBUG - Writing json_data[key] = ‘TorizonCore’
2024-03-12 14:22:01,556 - torizon.tezi.image - DEBUG - Reading json_data[key], value ‘6.6.0-devel-20240305+build.522’
2024-03-12 14:22:01,556 - torizon.tezi.image - DEBUG - Writing json_data[key] = ‘6.6.0-devel-20240305+build.522.modified’
2024-03-12 14:22:01,557 - torizon.tezi.image - DEBUG - Writing json_data[key] = ‘2024-03-12’
2024-03-12 14:22:01,557 - torizon.tezi.image - DEBUG - Reading json_data[key], value ‘6.6.0-devel-20240305+build.522.modified’
2024-03-12 14:22:01,557 - torizon.tcbuilder.cli.build - INFO - Removing output directory ‘torizon-core-docker-verdin-imx8mp-Tezi_6.6.0-devel-20240305+build.522.CUSTOM’ due to build errors
2024-03-12 14:22:01,587 - root - CRITICAL - An unexpected Exception occurred. Please provide the following stack trace to
the Toradex TorizonCore support team:

2024-03-12 14:22:01,588 - root - ERROR - Traceback (most recent call last):
File “/builder/torizoncore-builder”, line 221, in
mainargs.func(mainargs)
File “/builder/tcbuilder/cli/build.py”, line 479, in do_build
build(args.config_fname, args.storage_directory,
File “/builder/tcbuilder/cli/build.py”, line 465, in build
raise exc
File “/builder/tcbuilder/cli/build.py”, line 454, in build
handle_output_section(
File “/builder/tcbuilder/cli/build.py”, line 303, in handle_output_section
handle_bundle_output(
File “/builder/tcbuilder/cli/build.py”, line 321, in handle_bundle_output
comb_be.combine_image(**combine_params)
File “/builder/tcbuilder/backend/combine.py”, line 174, in combine_image
with open(target_name_file, ‘w’) as target_name_fd:
FileNotFoundError: [Errno 2] No such file or directory: ‘bundle/target_name’

Any help would be appreciated.
Thanks,
Steve

I am running under WSL with ubuntu 20.04LTS as I do this.

Also I am simply adding the lines to my tcbuild.yaml file as suggested and doing a build:
bundle:
compose-file: custom/docker-compose.yml

hey @Evets,

Can you tell me what command you ran to produce that error?

-Eric

@eric.tx
In the case where you add the compose file to the tcbuild.yaml, it says to just run a build command. That’s what I did. I didn’t include the first part of the device tree overlay debug output because that was successful. so I just added the bundle and compose lines (shown above) to my tcbuild.yaml file at the end, as described in the directions. Then I ran a build command:

torizoncore-builder --verbose --log-level debug build

Oh , before this I ran an isolate command.

Steve

@eric.tx
Just to be clear, my tcbuild.yaml was made to make a new device tree for my verdin module with no overlays but mine, so basically, the dev board setup, then removing all overlays and adding only my overlay.
So, then I added my working startup docker-compose.yml file but changed the image to be the docker debug image.
Then, I added the lines to my tcbuild.yaml:
bundle:
compose-file: custom/docker-compose.yml

Then I ran the build command.

Steve

@Evets,

I was just able to build and bundle a docker-compose.yml file.

image

image

The error is suggesting that the build is still looking for a file at bundle, do you still have the bundle dir referenced in the output of the tcbuild.yaml file? Or is that not the most current error produced by the build command. When you pass the docker-compose.yml file directly to the ouput, you do not manual run the bundle command.

-Eric

@eric.tx
No, the most current error is it is getting a connection refused when trying to pull the docker image.

Internal Server Error (“Get http://localhost:38301/v2/: dial tcp 127.0.0.1:5002: connect: connection refused”)

in checking, it seems like it is certainly listening on the right port:

sudo ss -lntp
[sudo] password for steve:
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 511 127.0.0.1:38301 0.0.0.0:* users:((“node”,pid=432,fd=19))
LISTEN 0 4096 *:5002 :

Am I supposed to change the output directory to something other than the one I use for images unpack?

Steve

@Evets,

Can you post the full logs, including the command that is run to the error.

-Eric

@eric.tx
torizoncore-builder --verbose --log-level debug build
2024-03-13 17:29:02,215 - torizon.tcbuilder.cli.build - INFO - Building image as per configuration file ‘tcbuild.yaml’…
2024-03-13 17:29:02,215 - torizon.tcbuilder.cli.build - DEBUG - Substitutions (enabled): {}
2024-03-13 17:29:02,277 - torizon.tcbuilder.cli.build - INFO -
=>> Handling input section
2024-03-13 17:29:03,966 - torizon.tcbuilder.backend.images - INFO - Unpacking Toradex Easy Installer image.
2024-03-13 17:29:03,967 - torizon.tcbuilder.backend.images - DEBUG - Running tar command: cat /workdir/torizon-core-docker-verdin-imx8mp-Tezi_6.6.0-devel-20240305+build.522.tar | cat | tar -xf - -C /storage/tezi.tmp
2024-03-13 17:29:04,528 - torizon.tcbuilder.backend.images - INFO - Copying Toradex Easy Installer image.
2024-03-13 17:29:04,528 - torizon.tcbuilder.backend.images - DEBUG - Copy directory /storage/tezi.tmp/torizon-core-docker-verdin-imx8mp-Tezi_6.6.0-devel-20240305+build.522 → /storage/tezi.
2024-03-13 17:29:04,703 - torizon.tcbuilder.backend.images - INFO - Unpacking TorizonCore Toradex Easy Installer image.
2024-03-13 17:29:04,704 - torizon.tcbuilder.backend.images - DEBUG - Running tar command: cat ‘/storage/tezi/torizon-core-docker-verdin-imx8mp.ota.tar.zst’ | zstd -dc | tar --xattrs --xattrs-include=‘*’ -xhf - -C /storage/sysroot
2024-03-13 17:29:08,488 - torizon.tcbuilder.backend.images - INFO - Importing OSTree revision b335e79d27949c07af0a4c5c31500fc66e153dd8b597debd7dcfe19389583374 from local repository…
2024-03-13 17:29:08,490 - torizon.tcbuilder.backend.ostree - DEBUG - Pulling from local repository /storage/sysroot/ostree/repo commit checksum b335e79d27949c07af0a4c5c31500fc66e153dd8b597debd7dcfe19389583374
921 metadata, 9128 content objects imported; 582.9 MB content written
2024-03-13 17:29:12,705 - torizon.tcbuilder.backend.ostree - DEBUG - Pulling from local repository /storage/sysroot/ostree/repo commit checksum b335e79d27949c07af0a4c5c31500fc66e153dd8b597debd7dcfe19389583374
0 metadata, 0 content objects imported; 0 bytes content written
2024-03-13 17:29:12,762 - torizon.tcbuilder.backend.images - INFO - Unpacked OSTree from Toradex Easy Installer image:
2024-03-13 17:29:12,762 - torizon.tcbuilder.backend.images - INFO - Commit checksum: b335e79d27949c07af0a4c5c31500fc66e153dd8b597debd7dcfe19389583374
2024-03-13 17:29:12,762 - torizon.tcbuilder.backend.images - INFO - TorizonCore Version: 6.6.0-devel-20240305+build.522
2024-03-13 17:29:12,762 - torizon.tcbuilder.cli.build - INFO -
=>> Handling customization section
2024-03-13 17:29:12,762 - torizon.tcbuilder.cli.build - INFO -
=> Handling device-tree subsection
2024-03-13 17:29:12,762 - torizon.tcbuilder.cli.dto - DEBUG - Removing all overlays
2024-03-13 17:29:12,811 - torizon.tcbuilder.cli.build - INFO - Not testing overlay because base image does not have a device-tree set!
2024-03-13 17:29:12,811 - torizon.tcbuilder.cli.build - INFO -
=> Adding device-tree overlay ‘device-trees/overlays/verdin-imx8mp-gimbal3b-overlay.dts’
2024-03-13 17:29:12,836 - torizon.tcbuilder.backend.dt - INFO - ‘verdin-imx8mp-gimbal3b-overlay.dts’ compiles successfully.
2024-03-13 17:29:12,860 - torizon.tcbuilder.cli.dto - INFO - Overlay verdin-imx8mp-gimbal3b-overlay.dtbo successfully applied.
2024-03-13 17:29:12,860 - torizon.tcbuilder.cli.build - INFO -
=>> Handling output section
2024-03-13 17:29:12,860 - torizon.tcbuilder.cli.union - DEBUG - union: subject=‘None’ body=‘None’
2024-03-13 17:29:12,862 - torizon.tcbuilder.cli.union - INFO - Applying changes from STORAGE/dt.
2024-03-13 17:29:12,864 - torizon.tcbuilder.backend.union - DEBUG - Processing whiteouts.
2024-03-13 17:29:12,970 - torizon.tcbuilder.backend.union - DEBUG - Transaction committed. 2946 bytes 2 objects written.
2024-03-13 17:29:12,974 - torizon.tcbuilder.cli.union - INFO - Commit 43f5511447c81e6fc9a8e555b3dbc60aa0d66438c3ab5aac6ebb49651631f2e7 has been generated for changes and is ready to be deployed.
Deploying commit ref: tcbuilder-20240313172912
2024-03-13 17:29:12,980 - torizon.tcbuilder.backend.deploy - INFO - Pulling OSTree with ref tcbuilder-20240313172912 from local archive repository…
2024-03-13 17:29:12,980 - torizon.tcbuilder.backend.deploy - INFO - Commit checksum: 43f5511447c81e6fc9a8e555b3dbc60aa0d66438c3ab5aac6ebb49651631f2e7
2024-03-13 17:29:12,980 - torizon.tcbuilder.backend.deploy - INFO - TorizonCore Version: 6.6.0-devel-20240305+build.522-tcbuilder.20240313172912
2024-03-13 17:29:12,980 - torizon.tcbuilder.backend.deploy - INFO - Default kernel arguments: quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3

2024-03-13 17:29:12,980 - torizon.tcbuilder.backend.ostree - DEBUG - Pulling from local repository /storage/ostree-archive commit checksum 43f5511447c81e6fc9a8e555b3dbc60aa0d66438c3ab5aac6ebb49651631f2e7
921 metadata, 9129 content objects imported; 582.9 MB content written
2024-03-13 17:29:14,485 - torizon.tcbuilder.backend.deploy - INFO - Pulling done.
2024-03-13 17:29:14,486 - torizon.tcbuilder.backend.deploy - INFO - Deploying OSTree with checksum 43f5511447c81e6fc9a8e555b3dbc60aa0d66438c3ab5aac6ebb49651631f2e7
2024-03-13 17:29:14,486 - torizon.tcbuilder.backend.deploy - DEBUG - Deploying revision 43f5511447c81e6fc9a8e555b3dbc60aa0d66438c3ab5aac6ebb49651631f2e7
2024-03-13 17:29:15,061 - torizon.tcbuilder.backend.deploy - DEBUG - Write deployment for revision 43f5511447c81e6fc9a8e555b3dbc60aa0d66438c3ab5aac6ebb49651631f2e7
2024-03-13 17:29:15,272 - torizon.tcbuilder.backend.deploy - INFO - Deploying done.
2024-03-13 17:29:15,272 - torizon.tcbuilder.backend.deploy - INFO - Copy files not under OSTree control from original deployment.
2024-03-13 17:29:15,279 - torizon.tcbuilder.backend.deploy - INFO - Packing rootfs…
2024-03-13 17:29:15,281 - torizon.tcbuilder.backend.deploy - DEBUG - Running tar command: tar --xattrs --xattrs-include=‘*’ -cf /workdir/torizon-core-docker-verdin-imx8mp-Tezi_6.6.0-devel-20240305+build.522.CUSTOM/torizon-core-docker-verdin-imx8mp.ota.tar -S -C /deploy -p .
2024-03-13 17:29:16,104 - torizon.tcbuilder.backend.deploy - DEBUG - Running compress command: zstd --rm /workdir/torizon-core-docker-verdin-imx8mp-Tezi_6.6.0-devel-20240305+build.522.CUSTOM/torizon-core-docker-verdin-imx8mp.ota.tar
2024-03-13 17:29:20,661 - torizon.tcbuilder.backend.deploy - INFO - Packing rootfs done.
2024-03-13 17:29:20,662 - torizon.tcbuilder.backend.combine - INFO - Updating TorizonCore image in place.
2024-03-13 17:29:20,662 - torizon.tezi.image - DEBUG - No ‘filelist’ present in image configuration.
2024-03-13 17:29:20,662 - torizon.tezi.image - DEBUG - Reading json_data[key], value ‘TorizonCore’
2024-03-13 17:29:20,662 - torizon.tezi.image - DEBUG - Writing json_data[key] = ‘TorizonCore’
2024-03-13 17:29:20,662 - torizon.tezi.image - DEBUG - Reading json_data[key], value ‘6.6.0-devel-20240305+build.522’
2024-03-13 17:29:20,662 - torizon.tezi.image - DEBUG - Writing json_data[key] = ‘6.6.0-devel-20240305+build.522.modified’
2024-03-13 17:29:20,662 - torizon.tezi.image - DEBUG - Writing json_data[key] = ‘2024-03-13’
2024-03-13 17:29:20,663 - torizon.tezi.image - DEBUG - Reading json_data[key], value ‘6.6.0-devel-20240305+build.522.modified’
2024-03-13 17:29:20,664 - torizon.tcbuilder.cli.build - INFO - Bundling images to directory bundle_20240313172920_664668.tmp
2024-03-13 17:29:20,665 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2024-03-13 17:29:20,665 - docker.utils.config - DEBUG - No config file found
2024-03-13 17:29:20,665 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2024-03-13 17:29:20,665 - docker.utils.config - DEBUG - No config file found
2024-03-13 17:29:20,677 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /version HTTP/1.1” 200 None
2024-03-13 17:29:20,684 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.43/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22name%22%3A+%5B%22tcb_1710350941%22%5D%7D HTTP/1.1” 200 None
2024-03-13 17:29:20,691 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.43/containers/4f855ff0817d78cb58cf49629e45e7f6421dc7b2c23e7aab32c233c824c74321/json HTTP/1.1” 200 None
2024-03-13 17:29:20,695 - torizon.tcbuilder.backend.common - DEBUG - Current container ID (found by container name): 4f855ff0817d78cb58cf49629e45e7f6421dc7b2c23e7aab32c233c824c74321
2024-03-13 17:29:20,699 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.43/containers/4f855ff0817d78cb58cf49629e45e7f6421dc7b2c23e7aab32c233c824c74321/json HTTP/1.1” 200 None
2024-03-13 17:29:20,703 - compose.config.config - DEBUG - Using configuration files: /workdir/docker-compose.yml
2024-03-13 17:29:20,718 - torizon.tcbuilder.backend.bundle - DEBUG - Using DindManager
2024-03-13 17:29:20,719 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2024-03-13 17:29:20,719 - docker.utils.config - DEBUG - No config file found
2024-03-13 17:29:20,719 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2024-03-13 17:29:20,719 - docker.utils.config - DEBUG - No config file found
2024-03-13 17:29:20,729 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /version HTTP/1.1” 200 None
2024-03-13 17:29:20,741 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.43/info HTTP/1.1” 200 None
2024-03-13 17:29:20,743 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2024-03-13 17:29:20,743 - docker.utils.config - DEBUG - No config file found
2024-03-13 17:29:20,743 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2024-03-13 17:29:20,743 - docker.utils.config - DEBUG - No config file found
2024-03-13 17:29:20,753 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /version HTTP/1.1” 200 None
2024-03-13 17:29:20,760 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.43/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22name%22%3A+%5B%22tcb_1710350941%22%5D%7D HTTP/1.1” 200 None
2024-03-13 17:29:20,769 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.43/containers/4f855ff0817d78cb58cf49629e45e7f6421dc7b2c23e7aab32c233c824c74321/json HTTP/1.1” 200 None
2024-03-13 17:29:20,772 - torizon.tcbuilder.backend.common - DEBUG - Current container ID (found by container name): 4f855ff0817d78cb58cf49629e45e7f6421dc7b2c23e7aab32c233c824c74321
2024-03-13 17:29:20,776 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.43/containers/4f855ff0817d78cb58cf49629e45e7f6421dc7b2c23e7aab32c233c824c74321/json HTTP/1.1” 200 None
2024-03-13 17:29:20,780 - torizon.tcbuilder.backend.bundle - INFO -
Starting DIND container
2024-03-13 17:29:20,787 - urllib3.connectionpool - DEBUG - http://localhost:None “POST /v1.43/volumes/create HTTP/1.1” 201 None
2024-03-13 17:29:20,789 - torizon.tcbuilder.backend.bundle - DEBUG - Default platform: linux/arm64
2024-03-13 17:29:20,789 - torizon.tcbuilder.backend.bundle - DEBUG - Volume mapping for DinD: [{‘Target’: ‘/workdir/’, ‘Source’: ‘/home/steve/tcbdir’, ‘Type’: ‘bind’, ‘ReadOnly’: False}, {‘Target’: ‘/var/lib/docker/’, ‘Source’: ‘dind-volume’, ‘Type’: ‘volume’, ‘ReadOnly’: False}]
2024-03-13 17:29:20,789 - torizon.tcbuilder.backend.bundle - DEBUG - Running DinD container: ports={‘22376/tcp’: 22376}, network=bridge
2024-03-13 17:29:20,825 - urllib3.connectionpool - DEBUG - http://localhost:None “POST /v1.43/containers/create?name=tcb-fetch-dind HTTP/1.1” 201 None
2024-03-13 17:29:20,831 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.43/containers/86698456eb526f5691b1aa00ac176603a5e757cf59fe4c8b6b18259b136b6387/json HTTP/1.1” 200 None
2024-03-13 17:29:21,348 - urllib3.connectionpool - DEBUG - http://localhost:None “POST /v1.43/containers/86698456eb526f5691b1aa00ac176603a5e757cf59fe4c8b6b18259b136b6387/start HTTP/1.1” 204 0
2024-03-13 17:29:21,354 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.43/containers/86698456eb526f5691b1aa00ac176603a5e757cf59fe4c8b6b18259b136b6387/json HTTP/1.1” 200 None
2024-03-13 17:29:24,361 - torizon.tcbuilder.backend.bundle - INFO - Connecting to Docker Daemon at “tcp://172.17.0.4:22376”
2024-03-13 17:29:24,362 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2024-03-13 17:29:24,362 - docker.utils.config - DEBUG - No config file found
2024-03-13 17:29:24,362 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2024-03-13 17:29:24,362 - docker.utils.config - DEBUG - No config file found
2024-03-13 17:29:24,363 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): 172.17.0.4:22376
2024-03-13 17:29:24,394 - urllib3.connectionpool - DEBUG - https://172.17.0.4:22376 “GET /version HTTP/1.1” 200 895
2024-03-13 17:29:24,395 - torizon.tcbuilder.backend.bundle - INFO - Fetching container image localhost:5002/gimbal3bcontainer-debug:arm64
2024-03-13 17:29:24,395 - docker.auth - DEBUG - Looking for auth config
2024-03-13 17:29:24,395 - docker.auth - DEBUG - No auth config in memory - loading from filesystem
2024-03-13 17:29:24,395 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2024-03-13 17:29:24,395 - docker.utils.config - DEBUG - No config file found
2024-03-13 17:29:24,395 - docker.auth - DEBUG - Looking for auth entry for ‘localhost:5002’
2024-03-13 17:29:24,395 - docker.auth - DEBUG - No entry found
2024-03-13 17:29:24,395 - docker.auth - DEBUG - No auth config found
2024-03-13 17:29:24,399 - urllib3.connectionpool - DEBUG - https://172.17.0.4:22376 “POST /v1.40/images/create?tag=arm64&fromImage=localhost%3A5002%2Fgimbal3bcontainer-debug&platform=linux%2Farm64 HTTP/1.1” 500 98
2024-03-13 17:29:24,399 - torizon.tcbuilder.backend.bundle - INFO - Stopping DIND container
2024-03-13 17:29:25,802 - urllib3.connectionpool - DEBUG - http://localhost:None “POST /v1.43/containers/86698456eb526f5691b1aa00ac176603a5e757cf59fe4c8b6b18259b136b6387/stop HTTP/1.1” 204 0
2024-03-13 17:29:26,822 - urllib3.connectionpool - DEBUG - http://localhost:None “DELETE /v1.43/volumes/dind-volume HTTP/1.1” 204 0
2024-03-13 17:29:26,822 - torizon.tcbuilder.cli.build - DEBUG - Removing temporary bundle directory bundle_20240313172920_664668.tmp
2024-03-13 17:29:26,823 - torizon.tcbuilder.cli.build - INFO - Removing output directory ‘torizon-core-docker-verdin-imx8mp-Tezi_6.6.0-devel-20240305+build.522.CUSTOM’ due to build errors
2024-03-13 17:29:26,853 - root - ERROR - Error: Error: container images download failed: 500 Server Error for https://172.17.0.4:22376/v1.40/images/create?tag=arm64&fromImage=localhost%3A5002%2Fgimbal3bcontainer-debug&platform=linux%2Farm64: Internal Server Error (“Get http://localhost:5002/v2/: dial tcp 127.0.0.1:5002: connect: connection refused”)
2024-03-13 17:29:26,856 - root - DEBUG - Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/docker/api/client.py”, line 268, in _raise_for_status
response.raise_for_status()
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://172.17.0.4:22376/v1.40/images/create?tag=arm64&fromImage=localhost%3A5002%2Fgimbal3bcontainer-debug&platform=linux%2Farm64

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/builder/tcbuilder/backend/bundle.py”, line 573, in download_containers_by_compose_file
res_stream = dind_client.api.pull(
File “/usr/local/lib/python3.9/dist-packages/docker/api/image.py”, line 429, in pull
self._raise_for_status(response)
File “/usr/local/lib/python3.9/dist-packages/docker/api/client.py”, line 270, in _raise_for_status
raise create_api_error_from_http_exception(e) from e
File “/usr/local/lib/python3.9/dist-packages/docker/errors.py”, line 39, in create_api_error_from_http_exception
raise cls(e, response=response, explanation=explanation) from e
docker.errors.APIError: 500 Server Error for https://172.17.0.4:22376/v1.40/images/create?tag=arm64&fromImage=localhost%3A5002%2Fgimbal3bcontainer-debug&platform=linux%2Farm64: Internal Server Error (“Get http://localhost:5002/v2/: dial tcp 127.0.0.1:5002: connect: connection refused”)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/builder/torizoncore-builder”, line 221, in
mainargs.func(mainargs)
File “/builder/tcbuilder/cli/build.py”, line 506, in do_build
raise exc
File “/builder/tcbuilder/cli/build.py”, line 479, in do_build
build(args.config_fname, args.storage_directory,
File “/builder/tcbuilder/cli/build.py”, line 465, in build
raise exc
File “/builder/tcbuilder/cli/build.py”, line 454, in build
handle_output_section(
File “/builder/tcbuilder/cli/build.py”, line 303, in handle_output_section
handle_bundle_output(
File “/builder/tcbuilder/cli/build.py”, line 364, in handle_bundle_output
download_containers_by_compose_file(**download_params)
File “/builder/tcbuilder/backend/bundle.py”, line 594, in download_containers_by_compose_file
raise OperationFailureError(
tcbuilder.errors.OperationFailureError: Error: container images download failed: 500 Server Error for https://172.17.0.4:22376/v1.40/images/create?tag=arm64&fromImage=localhost%3A5002%2Fgimbal3bcontainer-debug&platform=linux%2Farm64: Internal Server Error (“Get http://localhost:5002/v2/: dial tcp 127.0.0.1:5002: connect: connection refused”)

@eric.tx
The weird thing is i can do these things from commandline:
docker save -o myimage.docker localhost:5002/gimbal3b container-debug:arm64 with no issue.

And also:
docker pull localhost:5002/gimbal3bcontainer-debug:arm64

arm64: Pulling from gimbal3bcontainer-debug
Digest: sha256:3d792e9ebea12ff6d6c362b598a164bac1feebf18e9fddbdd1605ce275e25447
Status: Image is up to date for localhost:5002/gimbal3bcontainer-debug:arm64
localhost:5002/gimbal3bcontainer-debug:arm64

And that works fine. Why is it that the pull from within torizoncore-builder doesn’t work?

I do see this under docker info:
WARNING: daemon is not using the default seccomp profile

And thus:
docker info --format ‘{{ .SecurityOptions }}’
[name=seccomp,profile=unconfined]

is that normal?

Steve

Hey @Evets,

From your logs, It looks like you have your containers stored at an unsecured registry. HTTP vs HTTPS. Torizoncore-builder uses Docker-in-Docker container instances to obtain the images, so you will need to pass extra parameters depending to allow/inform DIND of the insecure registries.

Please see this article.

-Eric

@eric.tx
Yes, I had already read this and tried it, got the same answer, i.e. connection refused. I used port 5002 since that is the only port it’s listening on. I just tried it again and got the same results.

And in the logs from builder I see an insecure fetch without setting that parameter (which cab only be used in the bundle command), i.e., from the logs with bundle and that parameter set,
(“Get http://localhost:5002/v2/: dial tcp 127.0.0.1:5002: connect: connection refused”)

And also in the logs with the build command. It is showing an http connection not an https connection.
Steve

@eric.tx
I can fetch and save the image somewhere. Can I use that somehow to build everything?

Steve

@Evets,

Can I ask how are you hosting your images. Is it via: Docker locally on your machine? Can you describe what is running on windows for you and what is running on wsl, in regards to docker?

Also, when you attempted the parameters for insecure registries, did you change how your tcbuild.yaml file reflects the different bundle methods?

-Eric

The images are hosted on my machine’s repository, built by VSCode. I tried creating an image on the board, via the commit command and that works too. But I can’t seem to pull it from the board, OR use the image made by VSC since I can’t get it to pull it. The image is shown with docker images in wsl, but it is not in the list on the windows side.

I have just installed docker. Nothing special, but it has been updated several times. I have a docker hub login, which I’ve had for a long time for myself. But I can’t tell you whether it is a secure registry or not, but by the info, it looks as if it is, and the fact that it refuses the connection for a normal http: connection, tells me that a non-secure connection is being attempted.

I just ran the command as recommended by the example, with the added parameter. It doesn’t use the tcbuild.yaml for that, i.e.

torizoncore-builder bundle --dind-param=“–insecure-registry=localhost.:5002” docker-compose.yml

@eric.tx

I can do this with no issue on my PC in wsl:
docker pull localhost:5002/torizon6gimbal3b:latest
This works fine. What command is builder actually doing trying to pull the image? It says in the logs:
“File “/builder/tcbuilder/backend/bundle.py”, line 573, in download_containers_by_compose_file”
is that just trying to save the image? Or is it doing something to it? Because a pull just brings to the local registry.
In my docker info it has this:
Insecure Registries:
hubproxy.docker.internal:5555
127.0.0.0/8

which means if you pull from localhost, it should default to insecure Registries. However, you are doing something separate because it should connect, not refuse, or timeout. It doesn’t go long enough to timeout.

Steve

@Evets,

For this issue, can you show in your tcbuild.yaml file the bundle parameter*.

Edit

-Eric