cj2001 / nodes2021_kg_workshop

168 stars 116 forks source link

Error on HTTPS connection during docker-compose build #4

Closed JimBeam2019 closed 3 years ago

JimBeam2019 commented 3 years ago

Hi there,

I'm having an issue when running docker-compose build. It seems to fail to build the HTTPS connection with pip (Error messages shown as below). May I ask how to fix it? Thanks.

$ docker-compose build          
neo4j uses an image, skipping
Building jupyterlab
Step 1/9 : FROM jupyter/datascience-notebook
latest: Pulling from jupyter/datascience-notebook
345e3491a907: Already exists
57671312ef6f: Already exists
5e9250ddb7d0: Already exists
e1fadee31091: Pull complete
70fa05f53554: Pull complete
4f4fb700ef54: Pull complete
80d0a768e52d: Pull complete
b8e1ae373de6: Pull complete
c13247cfb65f: Pull complete
eddf77815124: Pull complete
35ffc5e5dc79: Pull complete
97e18716b9a2: Pull complete
cdca71acba1b: Pull complete
c8469b528abe: Pull complete
fa53d08fc996: Pull complete
99cac836faeb: Pull complete
5f8cc05626db: Pull complete
c40336035c20: Pull complete
e03bfd4d9306: Pull complete
24020b1ee2d6: Pull complete
c3cb449385b7: Pull complete
b076937755be: Pull complete
79984f9899a9: Pull complete
8743f31903ec: Pull complete
2f8714978f8d: Pull complete
Digest: sha256:b3481a4592d1ff9ed6900c70b92f7541bd29bd38e4fa2070957696ae8070c458
Status: Downloaded newer image for jupyter/datascience-notebook:latest
 ---> 191e0ba7afe5
Step 2/9 : COPY requirements.txt ./
 ---> 4efa5f805571
Step 3/9 : RUN pip install -U pip
 ---> Running in 5a62b7779f5a
Requirement already satisfied: pip in /opt/conda/lib/python3.9/site-packages (21.1.2)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f36767378b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f3676737820>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f3676737460>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f36767440a0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f3676744310>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pip/
Removing intermediate container 5a62b7779f5a
 ---> 38bcb16be001
Step 4/9 : RUN pip install --no-cache-dir -r requirements.txt
 ---> Running in 32f103bc8548
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8521ca61f0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/jupyterlab/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8521c92760>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/jupyterlab/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8521c92580>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/jupyterlab/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8521c92310>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/jupyterlab/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8521c92400>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/jupyterlab/
ERROR: Could not find a version that satisfies the requirement jupyterlab==3.0.7 (from versions: none)
ERROR: No matching distribution found for jupyterlab==3.0.7
ERROR: Service 'jupyterlab' failed to build: The command '/bin/bash -o pipefail -c pip install --no-cache-dir -r requirements.txt' returned a non-zero code: 1
cj2001 commented 3 years ago

Well that is a strange one!

Here is what I get when I run docker-compose build:

neo4j uses an image, skipping
Building jupyterlab
Step 1/9 : FROM jupyter/datascience-notebook
 ---> 53a378c64e80
Step 2/9 : COPY requirements.txt ./
 ---> Using cache
 ---> 32047d06933d
Step 3/9 : RUN pip install -U pip
 ---> Using cache
 ---> 0b6c2fea69c3
Step 4/9 : RUN pip install --no-cache-dir -r requirements.txt
 ---> Using cache
 ---> e8c6db202a5f
Step 5/9 : ENV JUPYTER_ENABLE_LAB=yes
 ---> Using cache
 ---> 43dbcc9803e0
Step 6/9 : COPY --chown=${NB_UID}:${NB_GID} . /home/jovyan/work
 ---> 7d9ecc4756f5
Step 7/9 : WORKDIR /home/jovyan/work
 ---> Running in ff9640204af1
Removing intermediate container ff9640204af1
 ---> 0f9e017434bc
Step 8/9 : RUN python3 -m spacy download en_core_web_md
 ---> Running in 6743817fb9d9
Collecting en-core-web-md==3.0.0
  Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.0.0/en_core_web_md-3.0.0-py3-none-any.whl (47.1 MB)
Requirement already satisfied: spacy<3.1.0,>=3.0.0 in /opt/conda/lib/python3.8/site-packages (from en-core-web-md==3.0.0) (3.0.3)
Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (4.58.0)
Requirement already satisfied: pathy in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (0.5.2)
Requirement already satisfied: packaging>=20.0 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (20.9)
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (1.0.5)
Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.0 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (3.0.5)
Requirement already satisfied: typer<0.4.0,>=0.3.0 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (0.3.2)
Requirement already satisfied: blis<0.8.0,>=0.4.0 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (0.7.4)
Requirement already satisfied: setuptools in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (49.6.0.post20210108)
Requirement already satisfied: numpy>=1.15.0 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (1.20.1)
Requirement already satisfied: thinc<8.1.0,>=8.0.0 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (8.0.3)
Requirement already satisfied: srsly<3.0.0,>=2.4.0 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (2.4.1)
Requirement already satisfied: catalogue<2.1.0,>=2.0.1 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (2.0.4)
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (2.0.5)
Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (3.0.5)
Requirement already satisfied: requests<3.0.0,>=2.13.0 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (2.25.1)
Requirement already satisfied: wasabi<1.1.0,>=0.8.1 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (0.8.2)
Requirement already satisfied: pydantic<1.8.0,>=1.7.1 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (1.7.3)
Requirement already satisfied: jinja2 in /opt/conda/lib/python3.8/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (2.11.3)
Requirement already satisfied: pyparsing>=2.0.2 in /opt/conda/lib/python3.8/site-packages (from packaging>=20.0->spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (2.4.7)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (1.26.3)
Requirement already satisfied: idna<3,>=2.5 in /opt/conda/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in /opt/conda/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (4.0.0)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (2020.12.5)
Requirement already satisfied: click<7.2.0,>=7.1.1 in /opt/conda/lib/python3.8/site-packages (from typer<0.4.0,>=0.3.0->spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (7.1.2)
Requirement already satisfied: MarkupSafe>=0.23 in /opt/conda/lib/python3.8/site-packages (from jinja2->spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (1.1.1)
Requirement already satisfied: smart-open<4.0.0,>=2.2.0 in /opt/conda/lib/python3.8/site-packages (from pathy->spacy<3.1.0,>=3.0.0->en-core-web-md==3.0.0) (3.0.0)
Installing collected packages: en-core-web-md
Successfully installed en-core-web-md-3.0.0
WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available.
You should consider upgrading via the '/opt/conda/bin/python3 -m pip install --upgrade pip' command.
✔ Download and installation successful
You can now load the package via spacy.load('en_core_web_md')
Removing intermediate container 6743817fb9d9
 ---> af84f050a06f
Step 9/9 : CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--notebook-dir=/home/jovyan/work", "--allow-root"]
 ---> Running in 23f9f3ccb9fc
Removing intermediate container 23f9f3ccb9fc
 ---> 78cec5ef7dac

Successfully built 78cec5ef7dac

It is interesting to me that in step 3 it is looking for conda while pip installing things. Mine doesn't do that at Step3, but I don't use conda and I do know that sometimes conda and pip do not play nicely with each other. Out of curiousity, do you use conda instead of pip as part of your daily workflow? If so, maybe can you try running this in a virtual environment that does not use conda and tell me what you get?

Thanks for raising this issue!

cj2001 commented 3 years ago

Also, can you maybe try commenting out line 4 of Dockerfile (the one that updates pip)?

JimBeam2019 commented 3 years ago

Hi @cj2001 , thank you very much for your comments, which help me fix the issue. I was running the project in the terminal of VS Code, and I spotted it ran a couple of command line as below, since you mentioned the unfriendly collaboration between conda and pip.

source /home/jimbeam/anaconda3/bin/activate
conda activate base

So, before docker-compose build, I ran conda deactivate and it worked smoothly without commenting out the pip update.

I can't thank you enough. Such a life saver. :D

cj2001 commented 3 years ago

I am so very glad to hear that, @JimBeam2019! Good luck with it and please reach out if you need anything else!