Issues with private docker registries using torizoncore-builder 3.7.0+early-access

Hello,

I am trying to create lockboxes on the torizon web platform. I ran into an issue with canonicalizing docker-compose files from a private registry. Based on the advice here: TCB cannot do "platform push" if private docker registry

I downloaded the early access version of torizoncore-builder that implemented --login and --login-to for platform push. This successfully builds my canocalized docker-compose file when I use" --login" with my dockerhub credentials. This is uploaded to the torizon platform and inserted into a lockbox. However, when I go to build the lockbox by running “torizoncore-builder platform lockbox”. It states that access to the manifest was not authorized. I have confirmed that my username and password is correct for the --login flag as it would fail at pushing the canonicalized docker-compose file initially if it wasn’t.

It also states the same thing when I try to do the “platform push” command with --login-to and our dockerhub registry.

Thanks, Mike

Update: I have gotten a bit farther with this by adding my docker login info to the “torizoncore-builder platform lockbox” command with the --login parameter. However, I get this trace when trying to build the lockbox.

Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/urllib3/connection.py”, line 200, in _new_conn
sock = connection.create_connection(
File “/usr/local/lib/python3.9/dist-packages/urllib3/util/connection.py”, line 85, in create_connection
raise err
File “/usr/local/lib/python3.9/dist-packages/urllib3/util/connection.py”, line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

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

Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py”, line 790, in urlopen
response = self._make_request(
File “/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py”, line 491, in _make_request
raise new_e
File “/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py”, line 467, in _make_request
self._validate_conn(conn)
File “/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py”, line 1092, in _validate_conn
conn.connect()
File “/usr/local/lib/python3.9/dist-packages/urllib3/connection.py”, line 604, in connect
self.sock = sock = self._new_conn()
File “/usr/local/lib/python3.9/dist-packages/urllib3/connection.py”, line 215, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7ff5f15ab2b0>: Failed to establish a new connection: [Errno 111] Connection refused

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

Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/requests/adapters.py”, line 486, in send
resp = conn.urlopen(
File “/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py”, line 844, in urlopen
retries = retries.increment(
File “/usr/local/lib/python3.9/dist-packages/urllib3/util/retry.py”, line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘127.0.0.1’, port=22376): Max retries exceeded with url: /version (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7ff5f15ab2b0>: Failed to establish a new connection: [Errno 111] Connection refused’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/docker/api/client.py”, line 214, in _retrieve_server_version
return self.version(api_version=False)[“ApiVersion”]
File “/usr/local/lib/python3.9/dist-packages/docker/api/daemon.py”, line 181, in version
return self._result(self._get(url), json=True)
File “/usr/local/lib/python3.9/dist-packages/docker/utils/decorators.py”, line 46, in inner
return f(self, *args, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/docker/api/client.py”, line 237, in _get
return self.get(url, **self._set_request_timeout(kwargs))
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 602, in get
return self.request(“GET”, url, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 589, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 703, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/adapters.py”, line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘127.0.0.1’, port=22376): Max retries exceeded with url: /version (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7ff5f15ab2b0>: Failed to establish a new connection: [Errno 111] Connection refused’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/builder/torizoncore-builder”, line 221, in
mainargs.func(mainargs)
File “/builder/tcbuilder/cli/platform.py”, line 316, in do_platform_lockbox
platform_lockbox(
File “/builder/tcbuilder/cli/platform.py”, line 298, in platform_lockbox
raise exc
File “/builder/tcbuilder/cli/platform.py”, line 277, in platform_lockbox
fetch_offupdt_targets(
File “/builder/tcbuilder/cli/platform.py”, line 194, in fetch_offupdt_targets
platform.fetch_compose_target(**params)
File “/builder/tcbuilder/backend/platform.py”, line 702, in fetch_compose_target
build_docker_tarballs(
File “/builder/tcbuilder/backend/platform.py”, line 592, in build_docker_tarballs
dind_client = manager.get_client()
File “/builder/tcbuilder/backend/bundle.py”, line 321, in get_client
dind_client = docker.DockerClient(base_url=self.docker_host, tls=tls_config)
File “/usr/local/lib/python3.9/dist-packages/docker/client.py”, line 45, in init
self.api = APIClient(*args, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/docker/api/client.py”, line 197, in init
self._version = self._retrieve_server_version()
File “/usr/local/lib/python3.9/dist-packages/docker/api/client.py”, line 221, in _retrieve_server_version
raise DockerException(
docker.errors.DockerException: Error while fetching server API version: HTTPSConnectionPool(host=‘127.0.0.1’, port=22376): Max retries exceeded with url: /version (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7ff5f15ab2b0>: Failed to establish a new connection: [Errno 111] Connection refused’))

Greetings @MikeHA,

First question, are you using TorizonCore Builder on a Windows machine?

If that is the case perhaps your issue is this: Lockbox creation failure with an 404 client error

The errors look similar, perhaps you can try the answer/workaround in that thread.

Best Regards,
Jeremias

1 Like

I was on windows. The solution you posted worked! Thanks!

Ah perfect, glad it was a relatively simple issue.

Best Regards,
Jeremias