OSError: Could not find a suitable TLS CA certificate bundle, invalid path

Hi,

I’m new to streamlit, love the idea and am looking to deploy my first app but have hit the following error when creating the environment. I can successfully deploy this locally so I think it might be a machine-specific issue but any tips or advice would be gratefully received.

Many thanks in advance,

Duncan

...
done
#
# To activate this environment, use
#
#     $ conda activate base
#
# To deactivate an active environment, use
#
#     $ conda deactivate
Retrieving notices: ...working... [2022-09-26 12:08:21.975196] failed
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
    Traceback (most recent call last):
      File "/home/appuser/.conda/lib/python3.9/site-packages/conda/exceptions.py", line 1125, in __call__
        return func(*args, **kwargs)
      File "/home/appuser/.conda/lib/python3.9/site-packages/conda_env/cli/main.py", line 80, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "/home/appuser/.conda/lib/python3.9/site-packages/conda/notices/core.py", line 75, in wrapper
        display_notices(
      File "/home/appuser/.conda/lib/python3.9/site-packages/conda/notices/core.py", line 39, in display_notices
        channel_notice_responses = http.get_notice_responses(channel_name_urls, silent=silent)
      File "/home/appuser/.conda/lib/python3.9/site-packages/conda/notices/http.py", line 36, in get_notice_responses
        return tuple(
      File "/home/appuser/.conda/lib/python3.9/site-packages/conda/notices/http.py", line 39, in <genexpr>
        (
      File "/home/appuser/.conda/lib/python3.9/concurrent/futures/_base.py", line 609, in result_iterator
        yield fs.pop().result()
      File "/home/appuser/.conda/lib/python3.9/concurrent/futures/_base.py", line 439, in result
        return self.__get_result()
      File "/home/appuser/.conda/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
        raise self._exception
      File "/home/appuser/.conda/lib/python3.9/concurrent/futures/thread.py", line 58, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/home/appuser/.conda/lib/python3.9/site-packages/conda/notices/http.py", line 42, in <lambda>
        lambda args: get_channel_notice_response(*args), url_and_names
      File "/home/appuser/.conda/lib/python3.9/site-packages/conda/notices/cache.py", line 37, in wrapper
        return_value = func(url, name)
      File "/home/appuser/.conda/lib/python3.9/site-packages/conda/notices/http.py", line 58, in get_channel_notice_response
        resp = session.get(url, allow_redirects=False, timeout=5)  # timeout: connect, read
      File "/home/appuser/.conda/lib/python3.9/site-packages/requests/sessions.py", line 600, in get
        return self.request("GET", url, **kwargs)
      File "/home/appuser/.conda/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
        resp = self.send(prep, **send_kwargs)
      File "/home/appuser/.conda/lib/python3.9/site-packages/requests/sessions.py", line 701, in send
        r = adapter.send(request, **kwargs)
      File "/home/appuser/.conda/lib/python3.9/site-packages/requests/adapters.py", line 460, in send
        self.cert_verify(conn, request.url, verify, cert)
      File "/home/appuser/.conda/lib/python3.9/site-packages/requests/adapters.py", line 263, in cert_verify
        raise OSError(
    OSError: Could not find a suitable TLS CA certificate bundle, invalid path: /home/appuser/.local/lib/python3.9/site-packages/certifi/cacert.pem
`$ /home/appuser/.conda/bin/conda-env update -n base --file environment.yml`
  environment variables:
                 CIO_TEST=<not set>
  CONDA_AUTO_UPDATE_CONDA=false
               CONDA_ROOT=/home/appuser/.conda
           CURL_CA_BUNDLE=<not set>
                     PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
                          :/bin
    PYTHON_GET_PIP_SHA256=5aefe6ade911d997af080b315ebcb7f882212d070465df544e1175ac2be519b4
       PYTHON_GET_PIP_URL=https://github.com/pypa/get-
                          pip/raw/5eaac1050023df1f5c98b173b248c260023f2278/public/get-pip.py
       PYTHON_PIP_VERSION=22.0.4
PYTHON_SETUPTOOLS_VERSION=58.1.0
           PYTHON_VERSION=3.9.14
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>
     active environment : None
       user config file : /home/appuser/.condarc
 populated config files : /home/appuser/.condarc
          conda version : 4.14.0
    conda-build version : not installed
         python version : 3.9.12.final.0
       virtual packages : __linux=5.4.170=0
                          __glibc=2.31=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/appuser/.conda  (writable)
      conda av data dir : /home/appuser/.conda/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/appuser/.conda/pkgs
       envs directories : /home/appuser/.conda/envs
               platform : linux-64
             user-agent : conda/4.14.0 requests/2.28.1 CPython/3.9.12 Linux/5.4.170+ debian/11 glibc/2.31
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False
An unexpected error has occurred. Conda has prepared the above report.
[12:08:28] ❗️ installer returned a non-zero exit code
[12:08:28] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.

Does anyone have any ideas? I’ve simplifying the conda requirements yml but now the process just gets killed when solving the environment:

Collecting package metadata (repodata.json): ...working... [2022-10-04 16:25:50.639906] done
Solving environment: ...working... [2022-10-04 16:29:50.497983] bash: line 3:    15 Killed                  /home/appuser/.conda/bin/conda env update -n base --file environment.yml
[16:29:51] ❗️ installer returned a non-zero exit code
[16:29:51] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.
[16:31:30] ❗️ Streamlit server consistently failed status checks

I’ve made the repo public and would love any advice: climatebench-app/environment.yml at main · duncanwp/climatebench-app · GitHub

Hi Duncan,

I posted an explanation of the killed here Error during processing dependencies using environment.yml file - #7 by willhuang. If you don’t use conda-forge channel, or you have a way of going around it, removing it should let you move forward.

Best,
George

Hi George,

Many thanks for taking a look at this. I’ve now removed the conda-forge channel requirement and the build definitely progresses quicker but I now hit the initial TLS error (see above). Do you have any ideas what might be causing that?

Thanks again,

Duncan

Hi Dunacan,

I will have a look on a fork of your repo and will get back to you.

Best,
George

Wonderful, many thanks!

Duncan

Hi Duncan!

I found the issue but there is not an easy fix on our side. However, I found also a workaround. When you deploy the application, click on “Advanced settings” and select 3.10 as python version. When you do that, the won’t appear anymore.

Best,
George

Thanks George, that seemed to work!

Unfortunately I’ve now hit a new error, I think when rendering the holoviews map as a bokeh_chart - but I don’t get any error message, it just dies… I could open a new issue but if you have a second to maybe pull out the underlying stack trace that would be much appreciated.

Duncan

Hi Duncan!

Apologises for the late reply, I missed you response.

Please open a separate issue for the new error if it’s not related to the TLS CA. This will help keeping things separated.

Best,
George

1 Like