Mistral Docker build failing with Backend Unavailable error

openstack-mini

Issue

Recently I faced challenges when building mistral docker image. Below is the stack trace.

Collecting SQLAlchemy>=1.2.5
  Downloading SQLAlchemy-1.3.15.tar.gz (6.1 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 186, in _main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/install.py", line 331, in run
    resolver.resolve(requirement_set)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(req)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 516, in prepare_linked_requirement
    req, self.req_tracker, self.finder, self.build_isolation,
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 95, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(finder, build_isolation)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/distributions/sdist.py", line 38, in prepare_distribution_metadata
    self._setup_isolation(finder)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/distributions/sdist.py", line 96, in _setup_isolation
    reqs = backend.get_requires_for_build_wheel()
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/wrappers.py", line 152, in get_requires_for_build_wheel
    'config_settings': config_settings
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/wrappers.py", line 255, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
BackendUnavailable
The command '/bin/sh -c curl -o "${TMP_CONSTRAINTS}" http://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt && sed -i "/^mistral.*/d" "${TMP_CONSTRAINTS}" && pip install -r "${MISTRAL_DIR}/requirements.txt"' returned a non-zero code: 2

Solution

After doing some research, I am able to fix this issue by updating Dockerfile. This issue is occurring during installation of python packages mentioned in requirements.txt, at this line.

 pip install -r "${MISTRAL_DIR}/requirements.txt"

Replace this line with below line where we inserted –no-use-pep517 flag.

 pip install --no-use-pep517 -r "${MISTRAL_DIR}/requirements.txt"

That’s all. Docker build should work now.

Bug Report

I have reported this bug to Mistral team. Hope fix will be released soon.

Stay Awesome !

Leave a Reply