[GH-ISSUE #1431] Bug: Docker build failing #3878

Open
opened 2026-03-15 00:49:08 +03:00 by kerem · 4 comments
Owner

Originally created by @jamesob on GitHub (May 15, 2024).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1431

DOCKER_BUILDKIT=1 docker build . fails with the following:

...
#21 20.83       writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
#21 20.83       writing requirements to Lib/python_ldap.egg-info/requires.txt
#21 20.83       writing top-level names to Lib/python_ldap.egg-info/top_level.txt
#21 20.83       reading manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
#21 20.83       reading manifest template 'MANIFEST.in'
#21 20.83       no previously-included directories found matching 'Doc/.build'
#21 20.83       adding license file 'LICENCE'
#21 20.83       writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
#21 20.83       creating build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
#21 20.83       running build_ext
#21 20.83       building '_ldap' extension
#21 20.83       creating build/temp.linux-x86_64-cpython-311
#21 20.83       creating build/temp.linux-x86_64-cpython-311/Modules
#21 20.83       gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=3.4.4 "-DLDAPMODULE_AUTHOR=python-ldap project" "-DLDAPMODULE_LICENSE=Python style" -IModules -I/usr/local/include/python3.11 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-cpython-311/Modules/LDAPObject.o
#21 20.83       error: command 'gcc' failed: No such file or directory
#21 20.83       [end of output]
#21 20.83
#21 20.83   note: This error originates from a subprocess, and is likely not a problem with pip.
#21 20.84   ERROR: Failed building wheel for python-ldap
#21 20.84   Building wheel for sgmllib3k (setup.py): started
#21 21.15   Building wheel for sgmllib3k (setup.py): finished with status 'done'
#21 21.15   Created wheel for sgmllib3k: filename=sgmllib3k-1.0.0-py3-none-any.whl size=6047 sha256=820b7b408d8e5fc8b50e515a28378484da04cad5b03a42f31eb3eb19b91e6f09
#21 21.15   Stored in directory: /root/.cache/pip/wheels/3b/25/2a/105d6a15df6914f4d15047691c6c28f9052cc1173e40285d03
#21 21.16 Successfully built sgmllib3k
#21 21.16 Failed to build python-ldap
#21 21.16 ERROR: Could not build wheels for python-ldap, which is required to install pyproject.toml-based projects
------
executor failed running [/bin/bash -o pipefail -o errexit -o errtrace -o nounset -c echo "[+] Installing PIP ArchiveBox dependencies from requirements.txt for ${TARGETPLATFORM}..."     && apt-get update -qq     && apt-get install -qq -y -t bookworm-backports         libssl-dev libldap2-dev libsasl2-dev         python3-ldap python3-msgpack python3-mutagen python3-regex python3-pycryptodome procps     && pip install -r requirements.txt     && apt-get autoremove -y     && rm -rf /var/lib/apt/lists/*]: exit code: 1
Originally created by @jamesob on GitHub (May 15, 2024). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1431 `DOCKER_BUILDKIT=1 docker build .` fails with the following: ``` ... #21 20.83 writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt #21 20.83 writing requirements to Lib/python_ldap.egg-info/requires.txt #21 20.83 writing top-level names to Lib/python_ldap.egg-info/top_level.txt #21 20.83 reading manifest file 'Lib/python_ldap.egg-info/SOURCES.txt' #21 20.83 reading manifest template 'MANIFEST.in' #21 20.83 no previously-included directories found matching 'Doc/.build' #21 20.83 adding license file 'LICENCE' #21 20.83 writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt' #21 20.83 creating build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-cpython-311/slapdtest/certs #21 20.83 running build_ext #21 20.83 building '_ldap' extension #21 20.83 creating build/temp.linux-x86_64-cpython-311 #21 20.83 creating build/temp.linux-x86_64-cpython-311/Modules #21 20.83 gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=3.4.4 "-DLDAPMODULE_AUTHOR=python-ldap project" "-DLDAPMODULE_LICENSE=Python style" -IModules -I/usr/local/include/python3.11 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-cpython-311/Modules/LDAPObject.o #21 20.83 error: command 'gcc' failed: No such file or directory #21 20.83 [end of output] #21 20.83 #21 20.83 note: This error originates from a subprocess, and is likely not a problem with pip. #21 20.84 ERROR: Failed building wheel for python-ldap #21 20.84 Building wheel for sgmllib3k (setup.py): started #21 21.15 Building wheel for sgmllib3k (setup.py): finished with status 'done' #21 21.15 Created wheel for sgmllib3k: filename=sgmllib3k-1.0.0-py3-none-any.whl size=6047 sha256=820b7b408d8e5fc8b50e515a28378484da04cad5b03a42f31eb3eb19b91e6f09 #21 21.15 Stored in directory: /root/.cache/pip/wheels/3b/25/2a/105d6a15df6914f4d15047691c6c28f9052cc1173e40285d03 #21 21.16 Successfully built sgmllib3k #21 21.16 Failed to build python-ldap #21 21.16 ERROR: Could not build wheels for python-ldap, which is required to install pyproject.toml-based projects ------ executor failed running [/bin/bash -o pipefail -o errexit -o errtrace -o nounset -c echo "[+] Installing PIP ArchiveBox dependencies from requirements.txt for ${TARGETPLATFORM}..." && apt-get update -qq && apt-get install -qq -y -t bookworm-backports libssl-dev libldap2-dev libsasl2-dev python3-ldap python3-msgpack python3-mutagen python3-regex python3-pycryptodome procps && pip install -r requirements.txt && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*]: exit code: 1 ```
Author
Owner

@jamesob commented on GitHub (May 15, 2024):

$ uname -a
Linux zzz 6.1.0-16-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.67-1 (2023-12-12) x86_64 GNU/Linux
<!-- gh-comment-id:2113665832 --> @jamesob commented on GitHub (May 15, 2024): ``` $ uname -a Linux zzz 6.1.0-16-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.67-1 (2023-12-12) x86_64 GNU/Linux ```
Author
Owner

@jamesob commented on GitHub (May 16, 2024):

Applied this diff:

diff --git a/Dockerfile b/Dockerfile
index 8a537a88..e837acc9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -253,7 +253,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$T
     echo "[+] Installing PIP ArchiveBox dependencies from requirements.txt for ${TARGETPLATFORM}..." \
     && apt-get update -qq \
     && apt-get install -qq -y -t bookworm-backports \
-        # build-essential \
+        build-essential python3-dev slapd ldap-utils \
         libssl-dev libldap2-dev libsasl2-dev \
         python3-ldap python3-msgpack python3-mutagen python3-regex python3-pycryptodome procps \
     # && ln -s "$GLOBAL_VENV" "$APP_VENV" \

Got past the previous issue, onto a new error:

 > [stage-0 22/23] RUN "/app"/bin/docker_entrypoint.sh version 2>&1 | tee -a /VERSION.txt:
#26 2.209 Traceback (most recent call last):
#26 2.209   File "/usr/local/bin/archivebox", line 5, in <module>
#26 2.209     from archivebox.cli import main
#26 2.209   File "/app/archivebox/cli/__init__.py", line 83, in <module>
#26 2.209     SUBCOMMANDS = list_subcommands()
#26 2.209                   ^^^^^^^^^^^^^^^^^^
#26 2.209   File "/app/archivebox/cli/__init__.py", line 43, in list_subcommands
#26 2.209     module = import_module('.archivebox_{}'.format(subcommand), __package__)
#26 2.209              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#26 2.210   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
#26 2.210     return _bootstrap._gcd_import(name[level:], package, level)
#26 2.210            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#26 2.210   File "/app/archivebox/cli/archivebox_init.py", line 11, in <module>
#26 2.210     from ..main import init
#26 2.210   File "/app/archivebox/main.py", line 23, in <module>
#26 2.210     from .parsers import (
#26 2.210   File "/app/archivebox/parsers/__init__.py", line 16, in <module>
#26 2.210     from ..system import atomic_write
#26 2.210   File "/app/archivebox/system.py", line 14, in <module>
#26 2.210     from .vendor.atomicwrites import atomic_write as lib_atomic_write
#26 2.210 ModuleNotFoundError: No module named 'archivebox.vendor.atomicwrites'
------
executor failed running [/bin/bash -o pipefail -o errexit -o errtrace -o nounset -c "$CODE_DIR"/bin/docker_entrypoint.sh version 2>&1 | tee -a /VERSION.txt]: exit code: 1

<!-- gh-comment-id:2113670796 --> @jamesob commented on GitHub (May 16, 2024): Applied this diff: ``` diff --git a/Dockerfile b/Dockerfile index 8a537a88..e837acc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -253,7 +253,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$T echo "[+] Installing PIP ArchiveBox dependencies from requirements.txt for ${TARGETPLATFORM}..." \ && apt-get update -qq \ && apt-get install -qq -y -t bookworm-backports \ - # build-essential \ + build-essential python3-dev slapd ldap-utils \ libssl-dev libldap2-dev libsasl2-dev \ python3-ldap python3-msgpack python3-mutagen python3-regex python3-pycryptodome procps \ # && ln -s "$GLOBAL_VENV" "$APP_VENV" \ ``` Got past the previous issue, onto a new error: ``` > [stage-0 22/23] RUN "/app"/bin/docker_entrypoint.sh version 2>&1 | tee -a /VERSION.txt: #26 2.209 Traceback (most recent call last): #26 2.209 File "/usr/local/bin/archivebox", line 5, in <module> #26 2.209 from archivebox.cli import main #26 2.209 File "/app/archivebox/cli/__init__.py", line 83, in <module> #26 2.209 SUBCOMMANDS = list_subcommands() #26 2.209 ^^^^^^^^^^^^^^^^^^ #26 2.209 File "/app/archivebox/cli/__init__.py", line 43, in list_subcommands #26 2.209 module = import_module('.archivebox_{}'.format(subcommand), __package__) #26 2.209 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #26 2.210 File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module #26 2.210 return _bootstrap._gcd_import(name[level:], package, level) #26 2.210 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #26 2.210 File "/app/archivebox/cli/archivebox_init.py", line 11, in <module> #26 2.210 from ..main import init #26 2.210 File "/app/archivebox/main.py", line 23, in <module> #26 2.210 from .parsers import ( #26 2.210 File "/app/archivebox/parsers/__init__.py", line 16, in <module> #26 2.210 from ..system import atomic_write #26 2.210 File "/app/archivebox/system.py", line 14, in <module> #26 2.210 from .vendor.atomicwrites import atomic_write as lib_atomic_write #26 2.210 ModuleNotFoundError: No module named 'archivebox.vendor.atomicwrites' ------ executor failed running [/bin/bash -o pipefail -o errexit -o errtrace -o nounset -c "$CODE_DIR"/bin/docker_entrypoint.sh version 2>&1 | tee -a /VERSION.txt]: exit code: 1 ```
Author
Owner

@pirate commented on GitHub (May 16, 2024):

It's under active heavy development right now sorry, I am changing the primary keys of the core models to UUIDs/ a new system called ABIDs, so it's going to be on-and-off broken for at least a few weeks. Hang tight and use the tagged v0.8.0-rc pre-release or v0.7.2 for now!

<!-- gh-comment-id:2116216139 --> @pirate commented on GitHub (May 16, 2024): It's under active heavy development right now sorry, I am changing the primary keys of the core models to UUIDs/ a new system called ABIDs, so it's going to be on-and-off broken for at least a few weeks. Hang tight and use the tagged v0.8.0-rc pre-release or v0.7.2 for now!
Author
Owner

@jamesob commented on GitHub (May 17, 2024):

Definitely not trying to tell you how to run your show and very appreciative of the work here, but might be worth keeping build-breaking changes to some kind of dev branch. I'm sure you may have your reasons though.

<!-- gh-comment-id:2116435012 --> @jamesob commented on GitHub (May 17, 2024): Definitely not trying to tell you how to run your show and very appreciative of the work here, but might be worth keeping build-breaking changes to some kind of dev branch. I'm sure you may have your reasons though.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#3878
No description provided.