[BUG] Docker build is not working
Describe the bug When I am running the docker compose build I am facing the error. It seems like the old package hasn't been updated and a recent upgrade in the Python package that has introduced a breaking change. The docker forced "apt update" now pull a fresh version of everything except that package and it's broken.
I was trying to upgrade from v2.3.6 to v2.4.7.
To Reproduce Steps to reproduce the behavior:
- run the docker compose build
- The following error will come up
33.20 Running setup.py install for python-docx: started
33.78 Running setup.py install for python-docx: finished with status 'done'
35.27 DEPRECATION: splunk-hec is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
35.27 Running setup.py install for splunk-hec: started
35.55 Running setup.py install for splunk-hec: finished with status 'error'
35.56 error: subprocess-exited-with-error
35.56
35.56 × Running setup.py install for splunk-hec did not run successfully.
35.56 │ exit code: 1
35.56 ╰─> [39 lines of output]
35.56 /opt/venv/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
35.56 !!
35.56
35.56 ********************************************************************************
35.56 Please avoid running ``setup.py`` directly.
35.56 Instead, use pypa/build, pypa/installer or other
35.56 standards-based tools.
35.56
35.56 See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
35.56 ********************************************************************************
35.56
35.56 !!
35.56 self.initialize_options()
35.56 Traceback (most recent call last):
35.56 File "<string>", line 2, in <module>
35.56 File "<pip-setuptools-caller>", line 34, in <module>
35.56 File "/tmp/pip-install-uduhcev5/splunk-hec_091f871f5c0b42938e3769330fcea921/setup.py", line 13, in <module>
35.56 setup(name='Splunk-HEC',
35.56 File "/opt/venv/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 184, in setup
35.56 return run_commands(dist)
35.56 File "/opt/venv/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
35.56 dist.run_commands()
35.56 File "/opt/venv/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 970, in run_commands
35.56 self.run_command(cmd)
35.56 File "/opt/venv/lib/python3.9/site-packages/setuptools/dist.py", line 974, in run_command
35.56 super().run_command(command)
35.56 File "/opt/venv/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
35.56 cmd_obj.ensure_finalized()
35.56 File "/opt/venv/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
35.56 self.finalize_options()
35.56 File "/opt/venv/lib/python3.9/site-packages/setuptools/command/install.py", line 57, in finalize_options
35.56 super().finalize_options()
35.56 File "/opt/venv/lib/python3.9/site-packages/setuptools/_distutils/command/install.py", line 407, in finalize_options
35.56 'dist_fullname': self.distribution.get_fullname(),
35.56 File "/opt/venv/lib/python3.9/site-packages/setuptools/_core_metadata.py", line 266, in get_fullname
35.56 return _distribution_fullname(self.get_name(), self.get_version())
35.56 File "/opt/venv/lib/python3.9/site-packages/setuptools/_core_metadata.py", line 284, in _distribution_fullname
35.56 canonicalize_version(version, strip_trailing_zero=False),
35.56 TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
35.56 [end of output]
35.56
35.56 note: This error originates from a subprocess, and is likely not a problem with pip.
35.56 error: legacy-install-failure
35.56
35.56 × Encountered error while trying to install package.
35.56 ╰─> splunk-hec
35.56
35.56 note: This is an issue with the package mentioned above, not pip.
35.56 hint: See above for output from the failure.
35.74
35.74 [notice] A new release of pip is available: 23.0.1 -> 24.1.2
35.74 [notice] To update, run: pip install --upgrade pip
------
failed to solve: process "/bin/sh -c pip3 install -r requirements.txt" did not complete successfully: exit code: 1
Desktop (please complete the following information):
- OS: [e.g. iOS]: ubuntu 22.04
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
i'm also facing this issue. can any one help to fix
hello,
you can handle this temporarily via:
assuming /tmp/dfiriris is your git checkout:
cd /tmp/dfiriris
cp docker/webApp/Dockerfile docker/webApp/Dockerfile.orig.`date -I`
sed s',pip3 install -r requirements.txt,pip3 install --upgrade pip \&\& pip3 install -r requirements.txt,' -i docker/webApp/Dockerfile
afterwards: docker-compose build
the problem is caused by an outdated pip in the underlaying docker image.
bye, dsek
I encountered the same issue upgrading to v2.4.7, and then again when trying to roll back after the failed upgrade (all the way back to v2.3.7), so it seems this impacts multiple (if not all) versions.
The above workaround from dsek resolved the issue for me and I was able to deploy v2.4.7.
I encountered the same issue upgrading to v2.4.7, and then again when trying to roll back after the failed upgrade (all the way back to v2.3.7), so it seems this impacts multiple (if not all) versions.
The above workaround from dsek resolved the issue for me and I was able to deploy v2.4.7.
yeah, the "pip" thing is a general issue and caused by the underlaying outdated pip version in the docker image.
We'll close this issue as the containers are now published on GCHR and the end user doesn't have to build it anymore. Cheers