Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cert-issuer failed while building docker image #176

Open
luiszaelot opened this issue Apr 29, 2020 · 4 comments
Open

cert-issuer failed while building docker image #176

luiszaelot opened this issue Apr 29, 2020 · 4 comments

Comments

@luiszaelot
Copy link

I followed cert-issuer guide to build my docker image but it fails with this error message:

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1_a8g47e/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1_a8g47e/lxml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9zkzurei/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.6m/lxml
         cwd: /tmp/pip-install-1_a8g47e/lxml/
    Complete output (96 lines):
    Building lxml version 4.5.0.
    Building without Cython.
    ERROR: b'/bin/sh: xslt-config: not found\n'
    ** make sure the development packages of libxml2 and libxslt are installed **
    
    Using build configuration of libxslt
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/sax.py -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/cssselect.py -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/ElementInclude.py -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/pyclasslookup.py -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/usedoctest.py -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/__init__.py -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/builder.py -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/_elementpath.py -> build/lib.linux-x86_64-3.6/lxml
    creating build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/__init__.py -> build/lib.linux-x86_64-3.6/lxml/includes
    creating build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/diff.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/ElementSoup.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/html5parser.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/_setmixin.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/_diffcommand.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/formfill.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/usedoctest.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/defs.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/__init__.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/builder.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/clean.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/soupparser.py -> build/lib.linux-x86_64-3.6/lxml/html
    copying src/lxml/html/_html5builder.py -> build/lib.linux-x86_64-3.6/lxml/html
    creating build/lib.linux-x86_64-3.6/lxml/isoschematron
    copying src/lxml/isoschematron/__init__.py -> build/lib.linux-x86_64-3.6/lxml/isoschematron
    copying src/lxml/etree.h -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/etree_api.h -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/lxml.etree.h -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/lxml.etree_api.h -> build/lib.linux-x86_64-3.6/lxml
    copying src/lxml/includes/c14n.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/relaxng.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/__init__.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/xpath.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/config.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/xinclude.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/uri.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/schematron.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/tree.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/xslt.pxd -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-3.6/lxml/includes
    copying src/lxml/includes/etree_defs.h -> build/lib.linux-x86_64-3.6/lxml/includes
    creating build/lib.linux-x86_64-3.6/lxml/isoschematron/resources
    creating build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/rng
    copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/rng
    creating build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/xsl
    copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/xsl
    copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/xsl
    creating build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-x86_64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    running build_ext
    building 'lxml.etree' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    creating build/temp.linux-x86_64-3.6/src/lxml
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/usr/include/python3.6m -c src/lxml/etree.c -o build/temp.linux-x86_64-3.6/src/lxml/etree.o -w
    In file included from src/lxml/etree.c:692:0:
    src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory
     #include "libxml/xmlversion.h"
                                   ^
    compilation terminated.
    Compile failed: command 'gcc' failed with exit status 1
    creating tmp
    cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitr6niuzrs.c -o tmp/xmlXPathInitr6niuzrs.o
    /tmp/xmlXPathInitr6niuzrs.c:1:26: fatal error: libxml/xpath.h: No such file or directory
     #include "libxml/xpath.h"
                              ^
    compilation terminated.
    *********************************************************************************
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
    *********************************************************************************
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1_a8g47e/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1_a8g47e/lxml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9zkzurei/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.6m/lxml Check the logs for full command output.

I tryed to fix it adding libxml to alpine and python requirements.txt but it does not solve the issue.

Thanks!!

@luiszaelot
Copy link
Author

Sorry, finally I fixed the problem. I'll create a pull request to solve this in the master branch.

Here is the patch if someone is getting the same error:

diff --git a/Dockerfile b/Dockerfile
index a48eb18..3462ab0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -5,6 +5,8 @@ COPY . /cert-issuer
 COPY conf_regtest.ini /etc/cert-issuer/conf.ini
 
 RUN apk add --update \
+       libxml2-dev \
+       libxslt-dev \
         bash \
         ca-certificates \
         curl \
diff --git a/requirements.txt b/requirements.txt
index e37c7d3..e132453 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,4 +10,5 @@ pyld>=1.0.3
 pysha3>=1.0.2
 python-bitcoinlib>=0.10.1
 tox>=3.0.0
-jsonschema<3.0.0
\ No newline at end of file
+jsonschema<3.0.0
+lxml

@luiszaelot
Copy link
Author

Sorry, I have not permissions to push to this repo. But here is the patch.
Please, validate the patch and add it to master branch.

@duartegarin
Copy link

Bumping into this as well.

@lemoustachiste
Copy link
Member

@llopezshaman you should be able to open PRs from a fork?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants