[ERROR] Frappe docker custom container image build fail

I cloned the source from the official repository:
:link: GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext

While building a custom container using the Containerfile, I encountered the following error.

The command I used was:

docker build --file=images/custom/Containerfile . --tag=frappe-test:v1.0.0

Error log is:

39.16 Building wheels for collected packages: frappe, cairocffi, maxminddb-geolite2, PyPika, hiredis, premailer, PyQRCode, rauth, traceback-with-variables, zxcvbn, gunicorn, rq, docopt
39.16   Building editable for frappe (pyproject.toml): started
39.31   Building editable for frappe (pyproject.toml): finished with status 'done'
39.31   Created wheel for frappe: filename=frappe-14.95.2-py3-none-any.whl size=3895 sha256=73870680eba8c4e47b6911396bf6d7af5c6c4f9fea514e8c0b1cf63578742261
39.31   Stored in directory: /tmp/pip-ephem-wheel-cache-gsa130o1/wheels/e2/81/76/0652c196d53f0177ec1c164bac1bd36d81dcc65580cc1560ac
39.32   Building wheel for cairocffi (setup.py): started
40.00   Building wheel for cairocffi (setup.py): finished with status 'error'
40.00   error: subprocess-exited-with-error
40.00   
40.00   Γ— python setup.py bdist_wheel did not run successfully.
40.00   β”‚ exit code: 1
40.00   ╰─> [10 lines of output]
40.00       /home/frappe/frappe-bench/env/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
40.00         warnings.warn(msg, warning_class)
40.00       /home/frappe/frappe-bench/env/lib/python3.11/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
40.00         warnings.warn(
40.00       usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
40.00          or: setup.py --help [cmd1 cmd2 ...]
40.00          or: setup.py --help-commands
40.00          or: setup.py cmd --help
40.00       
40.00       error: invalid command 'bdist_wheel'
40.00       [end of output]
40.00   
40.00   note: This error originates from a subprocess, and is likely not a problem with pip.
40.00   ERROR: Failed building wheel for cairocffi
40.00   Running setup.py clean for cairocffi
40.75   Building wheel for maxminddb-geolite2 (setup.py): started
41.01   Building wheel for maxminddb-geolite2 (setup.py): finished with status 'error'
41.01   error: subprocess-exited-with-error
41.01   
41.01   Γ— python setup.py bdist_wheel did not run successfully.
41.01   β”‚ exit code: 1
41.01   ╰─> [8 lines of output]
41.01       /home/frappe/frappe-bench/env/lib/python3.11/site-packages/setuptools/dist.py:530: UserWarning: Normalizing '2018.0703' to '2018.703'
41.01         warnings.warn(tmpl.format(**locals()))
41.01       usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
41.01          or: setup.py --help [cmd1 cmd2 ...]
41.01          or: setup.py --help-commands
41.01          or: setup.py cmd --help
41.01       
41.01       error: invalid command 'bdist_wheel'
41.01       [end of output]
41.01   
41.01   note: This error originates from a subprocess, and is likely not a problem with pip.
41.01   ERROR: Failed building wheel for maxminddb-geolite2
41.01   Running setup.py clean for maxminddb-geolite2
41.27   Building wheel for PyPika (pyproject.toml): started
41.55   Building wheel for PyPika (pyproject.toml): finished with status 'done'
41.56   Created wheel for PyPika: filename=pypika-0.48.9-py2.py3-none-any.whl size=53800 sha256=6398c3fa04e316b161bc7875b1dfaf310401304445c5e07ce0681e4ff37c57c8
41.56   Stored in directory: /home/frappe/.cache/pip/wheels/a3/01/bd/4c40ceb9d5354160cb186dcc153360f4ab7eb23e2b24daf96d
41.56   Building wheel for hiredis (setup.py): started
41.82   Building wheel for hiredis (setup.py): finished with status 'error'
41.82   error: subprocess-exited-with-error
41.82   
41.82   Γ— python setup.py bdist_wheel did not run successfully.
41.82   β”‚ exit code: 1
41.82   ╰─> [10 lines of output]
41.82       /tmp/pip-install-gy6xjyvm/hiredis_d2de03c02f434a598747c9c11af50508/setup.py:7: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
41.82         import sys, imp, os, glob, io
41.82       /home/frappe/frappe-bench/env/lib/python3.11/site-packages/setuptools/dist.py:771: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
41.82         warnings.warn(
41.82       usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
41.82          or: setup.py --help [cmd1 cmd2 ...]
41.82          or: setup.py --help-commands
41.82          or: setup.py cmd --help
41.82       
41.82       error: invalid command 'bdist_wheel'
41.82       [end of output]
41.82   
41.82   note: This error originates from a subprocess, and is likely not a problem with pip.
41.82   ERROR: Failed building wheel for hiredis
41.82   Running setup.py clean for hiredis
42.08   Building wheel for premailer (setup.py): started
42.34   Building wheel for premailer (setup.py): finished with status 'error'
42.34   error: subprocess-exited-with-error
42.34   
42.34   Γ— python setup.py bdist_wheel did not run successfully.
42.34   β”‚ exit code: 1
42.34   ╰─> [6 lines of output]
42.34       usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
42.34          or: setup.py --help [cmd1 cmd2 ...]
42.34          or: setup.py --help-commands
42.34          or: setup.py cmd --help
42.34       
42.34       error: invalid command 'bdist_wheel'
42.34       [end of output]
42.34   
42.34   note: This error originates from a subprocess, and is likely not a problem with pip.
42.34   ERROR: Failed building wheel for premailer
42.34   Running setup.py clean for premailer
42.60   Building wheel for PyQRCode (setup.py): started
42.89   Building wheel for PyQRCode (setup.py): finished with status 'error'
42.89   error: subprocess-exited-with-error
42.89   
42.89   Γ— python setup.py bdist_wheel did not run successfully.
42.89   β”‚ exit code: 1
42.89   ╰─> [6 lines of output]
42.89       usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
42.89          or: setup.py --help [cmd1 cmd2 ...]
42.89          or: setup.py --help-commands
42.89          or: setup.py cmd --help
42.89       
42.89       error: invalid command 'bdist_wheel'
42.89       [end of output]
42.89   
42.89   note: This error originates from a subprocess, and is likely not a problem with pip.
42.89   ERROR: Failed building wheel for PyQRCode
42.89   Running setup.py clean for PyQRCode
43.16   Building wheel for rauth (setup.py): started
43.46   Building wheel for rauth (setup.py): finished with status 'error'
43.46   error: subprocess-exited-with-error
43.46   
43.46   Γ— python setup.py bdist_wheel did not run successfully.
43.46   β”‚ exit code: 1
43.46   ╰─> [6 lines of output]
43.46       usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
43.46          or: setup.py --help [cmd1 cmd2 ...]
43.46          or: setup.py --help-commands
43.46          or: setup.py cmd --help
43.46       
43.46       error: invalid command 'bdist_wheel'
43.46       [end of output]
43.46   
43.46   note: This error originates from a subprocess, and is likely not a problem with pip.
43.46   ERROR: Failed building wheel for rauth
43.46   Running setup.py clean for rauth
43.72   Building wheel for traceback-with-variables (setup.py): started
43.97   Building wheel for traceback-with-variables (setup.py): finished with status 'error'
43.98   error: subprocess-exited-with-error
43.98   
43.98   Γ— python setup.py bdist_wheel did not run successfully.
43.98   β”‚ exit code: 1
43.98   ╰─> [6 lines of output]
43.98       usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
43.98          or: setup.py --help [cmd1 cmd2 ...]
43.98          or: setup.py --help-commands
43.98          or: setup.py cmd --help
43.98       
43.98       error: invalid command 'bdist_wheel'
43.98       [end of output]
43.98   
43.98   note: This error originates from a subprocess, and is likely not a problem with pip.
43.98   ERROR: Failed building wheel for traceback-with-variables
43.98   Running setup.py clean for traceback-with-variables
44.26   Building wheel for zxcvbn (setup.py): started
44.52   Building wheel for zxcvbn (setup.py): finished with status 'error'
44.52   error: subprocess-exited-with-error
44.52   
44.52   Γ— python setup.py bdist_wheel did not run successfully.
44.52   β”‚ exit code: 1
44.52   ╰─> [6 lines of output]
44.52       usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
44.52          or: setup.py --help [cmd1 cmd2 ...]
44.52          or: setup.py --help-commands
44.52          or: setup.py cmd --help
44.52       
44.52       error: invalid command 'bdist_wheel'
44.52       [end of output]
44.52   
44.52   note: This error originates from a subprocess, and is likely not a problem with pip.
44.52   ERROR: Failed building wheel for zxcvbn
44.52   Running setup.py clean for zxcvbn
44.80   Building wheel for gunicorn (pyproject.toml): started
45.14   Building wheel for gunicorn (pyproject.toml): finished with status 'done'
45.14   Created wheel for gunicorn: filename=gunicorn-23.0.0-py3-none-any.whl size=85760 sha256=992fbbd6b74bbad267a904611efc260637476a3d3143e6224d6289f595895a81
45.14   Stored in directory: /home/frappe/.cache/pip/wheels/ea/a2/10/910a9735b9193b982dd609b69481d84948df74b795277d437a
45.14   Building wheel for rq (pyproject.toml): started
45.43   Building wheel for rq (pyproject.toml): finished with status 'done'
45.44   Created wheel for rq: filename=rq-1.14.1-py2.py3-none-any.whl size=85249 sha256=b040149fd009ab752e55b9b618925c8144e51184a0ae16d69acc10c585900f16
45.44   Stored in directory: /home/frappe/.cache/pip/wheels/c7/5f/57/463ce6e1e98a0e9f019bf00654459dfe5e4d94f08c00de754e
45.44   Building wheel for docopt (setup.py): started
45.69   Building wheel for docopt (setup.py): finished with status 'error'
45.69   error: subprocess-exited-with-error
45.69   
45.69   Γ— python setup.py bdist_wheel did not run successfully.
45.69   β”‚ exit code: 1
45.69   ╰─> [6 lines of output]
45.69       usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
45.69          or: setup.py --help [cmd1 cmd2 ...]
45.69          or: setup.py --help-commands
45.69          or: setup.py cmd --help
45.69       
45.69       error: invalid command 'bdist_wheel'
45.69       [end of output]
45.69   
45.69   note: This error originates from a subprocess, and is likely not a problem with pip.
45.69   ERROR: Failed building wheel for docopt
45.69   Running setup.py clean for docopt
45.95 Successfully built frappe PyPika gunicorn rq
45.95 Failed to build cairocffi maxminddb-geolite2 hiredis premailer PyQRCode rauth traceback-with-variables zxcvbn docopt
45.99 ERROR: Failed to build installable wheels for some pyproject.toml based projects (cairocffi, maxminddb-geolite2, hiredis, premailer, PyQRCode, rauth, traceback-with-variables, zxcvbn, docopt)
47.46 subprocess.CalledProcessError: Command '/home/frappe/frappe-bench/env/bin/python -m pip install  --upgrade -e /home/frappe/frappe-bench/apps/frappe ' returned non-zero exit status 1.
47.46 
47.46 The above exception was the direct cause of the following exception:
47.46 
47.46 Traceback (most recent call last):
47.46   File "/usr/local/lib/python3.11/site-packages/bench/commands/make.py", line 75, in init
47.46     init(
47.46   File "/usr/local/lib/python3.11/site-packages/bench/utils/render.py", line 105, in wrapper_fn
47.46     return fn(*args, **kwargs)
47.46            ^^^^^^^^^^^^^^^^^^^
47.46   File "/usr/local/lib/python3.11/site-packages/bench/utils/system.py", line 87, in init
47.46     get_app(
47.46   File "/usr/local/lib/python3.11/site-packages/bench/app.py", line 778, in get_app
47.46     app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
47.46   File "/usr/local/lib/python3.11/site-packages/bench/utils/render.py", line 126, in wrapper_fn
47.46     return fn(*args, **kwargs)
47.46            ^^^^^^^^^^^^^^^^^^^
47.46   File "/usr/local/lib/python3.11/site-packages/bench/app.py", line 253, in install
47.46     install_app(
47.46   File "/usr/local/lib/python3.11/site-packages/bench/app.py", line 912, in install_app
47.46     bench.run(
47.46   File "/usr/local/lib/python3.11/site-packages/bench/bench.py", line 48, in run
47.46     return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
47.46            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47.46   File "/usr/local/lib/python3.11/site-packages/bench/utils/__init__.py", line 181, in exec_cmd
47.46     raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
47.46 bench.exceptions.CommandFailedError: /home/frappe/frappe-bench/env/bin/python -m pip install  --upgrade -e /home/frappe/frappe-bench/apps/frappe 
47.46 
47.46 ERROR: There was a problem while creating /home/frappe/frappe-bench
47.46 Do you want to rollback these changes? [y/N]: Aborted!
1 Like

The same, any updates?

docker build --build-arg=FRAPPE_PATH=https://github.com/frappe/frappe --build-arg=FRAPPE_BRANCH=v13.58.21 --build-arg=PYTHON_VERSION=3.10.16 --build-arg=NODE_VERSION=18.20.7 --build-arg=APPS_JSON_BASE64=$APPS_JSON_BASE64 --tag=$IMAGE_TAG --file=images/custom/Containerfile .
Building wheel for future (setup.py): started
Building wheel for future (setup.py): finished with status 'error'
error: subprocess-exited-with-error
Γ— python setup.py bdist_wheel did not run successfully.
β”‚ exit code: 1
╰─> [8 lines of output]
/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for future
1 Like

This seems like to be an issue with maxminddb-geolite2 and maybe need to install wheel

pip install wheel

I still investigating because it was working for me until 10 minutes ago.

Update: pip install wheel did not solve the issue. I am out of ideas for now. I’ll check back tomorrow.

1 Like

Facing the same error as well.
@revant_one maybe you have a solution for this ?

same issue here @revant_one @ankush

@aldoblack @smalnajdi @anklav24 @MinHyeong-Lee
temporary fix switch python version in dockerfile to 3.11 it worked and builded on my device and all good

ARG PYTHON_VERSION=3.11
ARG DEBIAN_BASE=bookworm
FROM python:${PYTHON_VERSION}-slim-${DEBIAN_BASE} AS base

you can pass --build-arg=PYTHON_VERSION=3.11 and it will do the same. No need to change Dockerfile

I’m currently using PYTHON_VERSION 3.11.6, and it’s breaking.

@crazy-eight yes i was on 3.11.6 aswell just change to 3.11 and itll work

1 Like

@revant_one what if we are using the layered dockerfile

Don’t use layered build in case you want to customize, python, nodejs, frappe repo, frappe branch.

yes, we use layers as it is recommended for production and if we only want to add new / custom apps.

Now the python issue caused here violate such thing. So will there be a build of a docker image that fixes this issue ?

Somehow all the following commands worked for me locally,

docker build --build-arg=FRAPPE_BRANCH=version-15 --file=images/custom/Containerfile . --tag=frappe-test:v1.0.0
docker build --build-arg=FRAPPE_BRANCH=v15.63.1 --file=images/custom/Containerfile . --tag=frappe-test:v1.0.0  
docker build --build-arg=FRAPPE_BRANCH=develop --file=images/custom/Containerfile . --tag=frappe-test:v1.0.0  
docker build --file=images/custom/Containerfile . --tag=frappe-test:v1.0.0

my image builds running here: build (#9667962214) Β· Jobs Β· castlecraft / CEPL ERPNext Images Β· GitLab

RUN pip install --upgrade pip setuptools wheel

This worked for me

Anything that worked was a superstition. Simple retry of the same old thing started working. :man_shrugging:

2 Likes

things are working now without changing anything, what is going on.

3 Likes