0

I have cloned the kubespray repo and I am attempting to create a container from the Dockerfile in order to run my deploys. It gets through steps 1-5 of the Dockerfile without issue but fails on step 6 every time when downloading the ansible base tar. Here is the output:

docker build --no-cache --force-rm=true --tag=kubespray-builder .

 => ERROR [6/7] RUN /usr/bin/python3 -m pip install pip -U     && /usr/bin/python3 -m pip install -r tests/requirements.txt     && python3 -m   29.1s
------
 > [6/7] RUN /usr/bin/python3 -m pip install pip -U     && /usr/bin/python3 -m pip install -r tests/requirements.txt     && python3 -m pip install -r requirements.txt     && update-alternatives --install /usr/bin/python python /usr/bin/python3 1:
#11 1.615 Collecting pip
#11 1.988   Downloading https://files.pythonhosted.org/packages/ca/bf/4133a0e05eac641ec270bbcef30512b5ad307d7838adb994acd652cc30e3/pip-21.2.3-py3-none-any.whl (1.6MB)
#11 2.965 Installing collected packages: pip
#11 2.965   Found existing installation: pip 9.0.1
#11 2.972     Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
#11 3.788 Successfully installed pip-21.2.3
#11 4.623 Collecting ansible==3.4.0
#11 4.771   Downloading ansible-3.4.0.tar.gz (31.9 MB)
#11 26.29 Collecting ansible-base==2.10.11
#11 26.31   Downloading ansible-base-2.10.11.tar.gz (6.0 MB)
#11 27.38 ERROR: Exception:
#11 27.38 Traceback (most recent call last):
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/base_command.py", line 173, in _main
#11 27.38     status = self.run(options, args)
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/req_command.py", line 203, in wrapper
#11 27.38     return func(self, options, args)
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/commands/install.py", line 316, in run
#11 27.38     reqs, check_supported_wheels=not options.target_dir
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
#11 27.38     collected.requirements, max_rounds=try_to_avoid_resolution_too_deep
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 472, in resolve
#11 27.38     state = resolution.resolve(requirements, max_rounds=max_rounds)
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 341, in resolve
#11 27.38     self._add_to_criteria(self.state.criteria, r, parent=None)
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 172, in _add_to_criteria
#11 27.38     if not criterion.candidates:
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/resolvelib/structs.py", line 151, in __bool__
#11 27.38     return bool(self._sequence)
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 140, in __bool__
#11 27.38     return any(self)
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 128, in <genexpr>
#11 27.38     return (c for c in iterator if id(c) not in self._incompatible_ids)
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 32, in _iter_built
#11 27.38     candidate = func()
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/resolution/resolvelib/factory.py", line 209, in _make_candidate_from_link
#11 27.38     version=version,
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 301, in __init__
#11 27.38     version=version,
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 156, in __init__
#11 27.38     self.dist = self._prepare()
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 227, in _prepare
#11 27.38     dist = self._prepare_distribution()
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 306, in _prepare_distribution
#11 27.38     self._ireq, parallel_builds=True
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/operations/prepare.py", line 508, in prepare_linked_requirement
#11 27.38     return self._prepare_linked_requirement(req, parallel_builds)
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/operations/prepare.py", line 552, in _prepare_linked_requirement
#11 27.38     self.download_dir, hashes
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/operations/prepare.py", line 249, in unpack_url
#11 27.38     unpack_file(file.path, location, file.content_type)
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/utils/unpacking.py", line 256, in unpack_file
#11 27.38     untar_file(filename, location)
#11 27.38   File "/usr/local/lib/python3.6/dist-packages/pip/_internal/utils/unpacking.py", line 226, in untar_file
#11 27.38     with open(path, "wb") as destfp:
#11 27.38 UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 117: ordinal not in range(128)
------
executor failed running [/bin/sh -c /usr/bin/python3 -m pip install pip -U     && /usr/bin/python3 -m pip install -r tests/requirements.txt     && python3 -m pip install -r requirements.txt     && update-alternatives --install /usr/bin/python python /usr/bin/python3 1]: exit code: 2

Any help is appreciated, I have not run into this issue previously, and have built this container plenty of times with a previous version of kubespray.

  • 1
    I would guess it's [an ancient version of pip](https://github.com/pypa/wheel/issues/331), but pragmatically this is not a programming question and thus belongs on https://SuperUser.com/ for help with how to install software – mdaniel Aug 07 '21 at 03:31
  • See [this bug](https://github.com/pypa/pip/issues/10219) which is still opened and the [proposed workarround in a comment](https://github.com/pypa/pip/issues/10219#issuecomment-887337037). I successfully built the image making [The following change I already proposed as a PR](https://github.com/kubernetes-sigs/kubespray/pull/7862) (that might get accepted if I manage to tame the bot...) – Zeitounator Aug 07 '21 at 08:11
  • Thanks @Zeitounator adding that to the Dockerfile worked. – Josh Schubert Aug 09 '21 at 12:56
  • @JoshSchubert Just to let you know the PR has been approved and is undergoing tests. Should be in some next version hopefully. – Zeitounator Aug 20 '21 at 17:14
  • 1
    @Zeitounator Thanks for the PR, it is now approved, lgtm-ed and merged – Florian Aug 26 '21 at 14:50

0 Answers0