question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation Build From Source Not reflective of steps.

See original GitHub issue

Describe the bug When following the build from source steps. During the docker build you are faced with

"RUN pipenv run python install_nlp_models.py --conf_file conf/default.yaml:
#29 3.271 Installing models from configuration: {'nlp_engine_name': 'spacy', 'models': [{'lang_code': 'en', 'model_name': 'en_core_web_sm'}]}
#29 3.356 Traceback (most recent call last):
#29 3.356   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
#29 3.359     httplib_response = self._make_request(
#29 3.359   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
#29 3.359     self._validate_conn(conn)
#29 3.359   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
#29 3.360     conn.connect()
#29 3.360   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/connection.py", line 411, in connect
#29 3.361     self.sock = ssl_wrap_socket(
#29 3.361   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
#29 3.362     ssl_sock = _ssl_wrap_socket_impl(
#29 3.362   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
#29 3.363     return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
#29 3.363   File "/usr/local/lib/python3.9/ssl.py", line 500, in wrap_socket
#29 3.365     return self.sslsocket_class._create(
#29 3.365   File "/usr/local/lib/python3.9/ssl.py", line 1040, in _create
#29 3.366     self.do_handshake()
#29 3.366   File "/usr/local/lib/python3.9/ssl.py", line 1309, in do_handshake
#29 3.368     self._sslobj.do_handshake()
#29 3.368 ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)
#29 3.368
#29 3.368 During handling of the above exception, another exception occurred:
#29 3.368
#29 3.368 Traceback (most recent call last):
#29 3.368   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
#29 3.369     resp = conn.urlopen(
#29 3.370   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
#29 3.371     retries = retries.increment(
#29 3.371   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
#29 3.373     raise MaxRetryError(_pool, url, error or ResponseError(cause))
#29 3.373 urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /explosion/spacy-models/master/compatibility.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))
#29 3.373
#29 3.373 During handling of the above exception, another exception occurred:
#29 3.373
#29 3.374 Traceback (most recent call last):
#29 3.374   File "/usr/bin/presidio-analyzer/install_nlp_models.py", line 64, in <module>
#29 3.376     install_models(conf_file=args.conf_file)
#29 3.376   File "/usr/bin/presidio-analyzer/install_nlp_models.py", line 34, in install_models
#29 3.377     _download_model(engine_name, model_name)
#29 3.377   File "/usr/bin/presidio-analyzer/install_nlp_models.py", line 44, in _download_model
#29 3.377     spacy.cli.download(model_name)
#29 3.377   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/spacy/cli/download.py", line 67, in download
#29 3.378     compatibility = get_compatibility()
#29 3.378   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/spacy/cli/download.py", line 78, in get_compatibility
#29 3.378     r = requests.get(about.__compatibility__)
#29 3.378   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/api.py", line 76, in get
#29 3.379     return request('get', url, params=params, **kwargs)
#29 3.379   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/api.py", line 61, in request
#29 3.379     return session.request(method=method, url=url, **kwargs)
#29 3.379   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
#29 3.381     resp = self.send(prep, **send_kwargs)
#29 3.381   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
#29 3.381     r = adapter.send(request, **kwargs)
#29 3.381   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/adapters.py", line 514, in send
#29 3.382     raise SSLError(e, request=request)
#29 3.382 requests.exceptions.SSLError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /explosion/spacy-models/master/compatibility.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))
```"


**To Reproduce**
Follow the steps verbatim for the "Build from Source" issue.

**Expected behavior**
When following the build from source there should be something within the section/dev setup section that denotes the requires to build an SSL ceritificate to be provided to the docker file.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jbullen94commented, Sep 2, 2021

I’ve run solely the analyzer. (I modified the docker-compose file) and this was the result. It looks like the issue lays with the spacy library? EDIT: I downloaded the presidio docker image and tried to install spacy following these the steps here: https://spacy.io/usage I still got the same validation error, so its not the presidio.

docker-compose up --build -d
[+] Building 9.8s (15/16)
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 32B                                                                                0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/python:3.9-slim                                                 4.1s
 => [auth] library/python:pull token for registry-1.docker.io                                                      0.0s
 => [ 1/11] FROM docker.io/library/python:3.9-slim@sha256:8402d0ea6e4eaeba7b390dfe522496e365334daaeb05361b24636f2  0.0s
 => [internal] load build context                                                                                  0.1s
 => => transferring context: 6.08kB                                                                                0.1s
 => CACHED [ 2/11] WORKDIR /usr/bin/presidio-analyzer                                                              0.0s
 => CACHED [ 3/11] COPY ./Pipfile* /usr/bin/presidio-analyzer/                                                     0.0s
 => CACHED [ 4/11] COPY ./cacert.crt /usr/local/share/ca-certificates/cacert.crt                                   0.0s
 => CACHED [ 5/11] RUN pip install pipenv                                                                          0.0s
 => CACHED [ 6/11] RUN pipenv sync                                                                                 0.0s
 => CACHED [ 7/11] RUN update-ca-certificates                                                                      0.0s
 => CACHED [ 8/11] COPY ./install_nlp_models.py /usr/bin/presidio-analyzer/                                        0.0s
 => CACHED [ 9/11] COPY conf/default.yaml /usr/bin/presidio-analyzer/conf/default.yaml                             0.0s
 => ERROR [10/11] RUN pipenv run python install_nlp_models.py --conf_file conf/default.yaml                        5.3s
------
 > [10/11] RUN pipenv run python install_nlp_models.py --conf_file conf/default.yaml:
#15 4.978 Installing models from configuration: {'nlp_engine_name': 'spacy', 'models': [{'lang_code': 'en', 'model_name': 'en_core_web_lg'}]}
#15 5.057 Traceback (most recent call last):
#15 5.057   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
#15 5.061     httplib_response = self._make_request(
#15 5.061   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
#15 5.062     self._validate_conn(conn)
#15 5.062   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
#15 5.063     conn.connect()
#15 5.063   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/connection.py", line 411, in connect
#15 5.065     self.sock = ssl_wrap_socket(
#15 5.065   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
#15 5.067     ssl_sock = _ssl_wrap_socket_impl(
#15 5.068   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
#15 5.069     return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
#15 5.069   File "/usr/local/lib/python3.9/ssl.py", line 500, in wrap_socket
#15 5.070     return self.sslsocket_class._create(
#15 5.070   File "/usr/local/lib/python3.9/ssl.py", line 1040, in _create
#15 5.071     self.do_handshake()
#15 5.071   File "/usr/local/lib/python3.9/ssl.py", line 1309, in do_handshake
#15 5.072     self._sslobj.do_handshake()
#15 5.072 ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)
#15 5.072
#15 5.072 During handling of the above exception, another exception occurred:
#15 5.072
#15 5.072 Traceback (most recent call last):
#15 5.072   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
#15 5.077     resp = conn.urlopen(
#15 5.078   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
#15 5.079     retries = retries.increment(
#15 5.079   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
#15 5.080     raise MaxRetryError(_pool, url, error or ResponseError(cause))
#15 5.080 urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /explosion/spacy-models/master/compatibility.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))
#15 5.080
#15 5.080 During handling of the above exception, another exception occurred:
#15 5.080
#15 5.080 Traceback (most recent call last):
#15 5.080   File "/usr/bin/presidio-analyzer/install_nlp_models.py", line 64, in <module>
#15 5.081     install_models(conf_file=args.conf_file)
#15 5.081   File "/usr/bin/presidio-analyzer/install_nlp_models.py", line 34, in install_models
#15 5.082     _download_model(engine_name, model_name)
#15 5.082   File "/usr/bin/presidio-analyzer/install_nlp_models.py", line 44, in _download_model
#15 5.082     spacy.cli.download(model_name)
#15 5.082   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/spacy/cli/download.py", line 67, in download
#15 5.083     compatibility = get_compatibility()
#15 5.083   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/spacy/cli/download.py", line 78, in get_compatibility
#15 5.084     r = requests.get(about.__compatibility__)
#15 5.084   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/api.py", line 76, in get
#15 5.085     return request('get', url, params=params, **kwargs)
#15 5.085   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/api.py", line 61, in request
#15 5.085     return session.request(method=method, url=url, **kwargs)
#15 5.085   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
#15 5.086     resp = self.send(prep, **send_kwargs)
#15 5.086   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
#15 5.087     r = adapter.send(request, **kwargs)
#15 5.087   File "/usr/bin/presidio-analyzer/.venv/lib/python3.9/site-packages/requests/adapters.py", line 514, in send
#15 5.087     raise SSLError(e, request=request)
#15 5.087 requests.exceptions.SSLError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /explosion/spacy-models/master/compatibility.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c pipenv run python install_nlp_models.py --conf_file ${NLP_CONF_FILE}]: exit code: 1

Module from within Docker container.

python -m spacy download en_core_web_sm
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 411, in connect
    self.sock = ssl_wrap_socket(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/local/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/local/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/local/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /explosion/spacy-models/master/compatibility.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/site-packages/spacy/__main__.py", line 4, in <module>
    setup_cli()
  File "/usr/local/lib/python3.9/site-packages/spacy/cli/_util.py", line 69, in setup_cli
    command(prog_name=COMMAND)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/typer/main.py", line 497, in wrapper
    return callback(**use_params)  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/spacy/cli/download.py", line 35, in download_cli
    download(model, direct, sdist, *ctx.args)
  File "/usr/local/lib/python3.9/site-packages/spacy/cli/download.py", line 67, in download
    compatibility = get_compatibility()
  File "/usr/local/lib/python3.9/site-packages/spacy/cli/download.py", line 78, in get_compatibility
    r = requests.get(about.__compatibility__)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /explosion/spacy-models/master/compatibility.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))
0reactions
SharonHartcommented, Sep 2, 2021

I found a few options that could help: First is to add a direct flag to the spacy download command: python -m spacy download en_core_web_sm --direct Second is to use wget or curl to download it manually (maybe disable ssl verification for insecure download) and install using pip python -m pip install en_core_web_sm-3.0.0.tar.gz A third option, valid only if you were able to download locally outside of the container, is to define docker network mode to be ‘host’ when building

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building Unreal Engine from Source
From your first steps to complete mastery of Unreal Engine, we've got you covered. ... Share, inspire, and connect with creators across industries...
Read more >
Build settings reference | Apple Developer Documentation
A detailed list of individual Xcode build settings that control or change the way a target is built.
Read more >
Reflective Listening
A door opener is usually a reflection of only the behavior your see because often no words are expressed. Door openers involve four...
Read more >
Transition from Java 8 to Java 11 - Azure - Microsoft Learn
What jdeprscan and jdeps cannot do is warn about the use of reflection to access encapsulated API. Reflective access is checked at runtime....
Read more >
Build System (CMake) - Zephyr Project Documentation
All source code that goes into a Zephyr build does so by being included in a library ... and this step is skipped...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found