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

Docker Build Failure #73

Closed
strixcuriosus opened this issue Apr 16, 2019 · 5 comments
Closed

Docker Build Failure #73

strixcuriosus opened this issue Apr 16, 2019 · 5 comments

Comments

@strixcuriosus
Copy link
Contributor

The docker build is failing on the conda install:

Sending build context to Docker daemon   5.12kB
Step 1/12 : FROM jupyter/minimal-notebook:2c80cf3537ca
 ---> db464e6587fb
Step 2/12 : RUN conda install -y -c conda-forge gdal=2.4.0
 ---> Running in 2a389bdcb711
Fetching package metadata ...An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Current conda install:

               platform : linux-64
          conda version : 4.3.29
       conda is private : False
      conda-env version : 4.3.29
    conda-build version : not installed
         python version : 3.6.3.final.0
       requests version : 2.18.4
       root environment : /opt/conda  (writable)
    default environment : /opt/conda
       envs directories : /opt/conda/envs
                          /home/jovyan/.conda/envs
          package cache : /opt/conda/pkgs
                          /home/jovyan/.conda/pkgs
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : /opt/conda/.condarc
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.29 requests/2.18.4 CPython/3.6.3 Linux/4.9.125-linuxkit debian/stretch/sid glibc/2.23
                UID:GID : 1000:100

`$ /opt/conda/bin/conda install -y -c conda-forge gdal=2.4.0`




    Traceback (most recent call last):
      File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 640, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "/opt/conda/lib/python3.6/site-packages/conda/cli/main.py", line 140, in _main
        exit_code = args.func(args, p)
      File "/opt/conda/lib/python3.6/site-packages/conda/cli/main_install.py", line 80, in execute
        install(args, parser, 'install')
      File "/opt/conda/lib/python3.6/site-packages/conda/cli/install.py", line 231, in install
        unknown=index_args['unknown'], prefix=prefix)
      File "/opt/conda/lib/python3.6/site-packages/conda/core/index.py", line 101, in get_index
        index = fetch_index(channel_priority_map, use_cache=use_cache)
      File "/opt/conda/lib/python3.6/site-packages/conda/core/index.py", line 120, in fetch_index
        repodatas = collect_all_repodata(use_cache, tasks)
      File "/opt/conda/lib/python3.6/site-packages/conda/core/repodata.py", line 75, in collect_all_repodata
        repodatas = _collect_repodatas_serial(use_cache, tasks)
      File "/opt/conda/lib/python3.6/site-packages/conda/core/repodata.py", line 485, in _collect_repodatas_serial
        for url, schan, pri in tasks]
      File "/opt/conda/lib/python3.6/site-packages/conda/core/repodata.py", line 485, in <listcomp>
        for url, schan, pri in tasks]
      File "/opt/conda/lib/python3.6/site-packages/conda/core/repodata.py", line 115, in func
        res = f(*args, **kwargs)
      File "/opt/conda/lib/python3.6/site-packages/conda/core/repodata.py", line 473, in fetch_repodata
        with open(cache_path, 'w') as fo:
    FileNotFoundError: [Errno 2] No such file or directory: '/opt/conda/pkgs/cache/497deca9.json'

The command '/bin/sh -c conda install -y -c conda-forge gdal=2.4.0' returned a non-zero code: 1

This looks closely related to the recent gdal version issue mentioned in #71
which inspired the upgrade of gdal in
#72

@strixcuriosus
Copy link
Contributor Author

for debugging purposes, the install issue can be reproduced in a jupyter/minimal-notebook:2c80cf3537ca container like so:

docker run --rm -it jupyter/minimal-notebook:2c80cf3537ca  /bin/bash
jovyan@c783b1710647:~$
jovyan@c783b1710647:~$  conda install -y -c conda-forge gdal=2.4.0
Fetching package metadata ...An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Current conda install:

               platform : linux-64
          conda version : 4.3.29
       conda is private : False
      conda-env version : 4.3.29
    conda-build version : not installed
         python version : 3.6.3.final.0
       requests version : 2.18.4
       root environment : /opt/conda  (writable)
    default environment : /opt/conda
       envs directories : /opt/conda/envs
                          /home/jovyan/.conda/envs
          package cache : /opt/conda/pkgs
                          /home/jovyan/.conda/pkgs
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : /opt/conda/.condarc
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.29 requests/2.18.4 CPython/3.6.3 Linux/4.9.125-linuxkit debian/stretch/sid glibc/2.23
                UID:GID : 1000:100

`$ /opt/conda/bin/conda install -y -c conda-forge gdal=2.4.0`




    Traceback (most recent call last):
      File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 640, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "/opt/conda/lib/python3.6/site-packages/conda/cli/main.py", line 140, in _main
        exit_code = args.func(args, p)
      File "/opt/conda/lib/python3.6/site-packages/conda/cli/main_install.py", line 80, in execute
        install(args, parser, 'install')
      File "/opt/conda/lib/python3.6/site-packages/conda/cli/install.py", line 231, in install
        unknown=index_args['unknown'], prefix=prefix)
      File "/opt/conda/lib/python3.6/site-packages/conda/core/index.py", line 101, in get_index
        index = fetch_index(channel_priority_map, use_cache=use_cache)
      File "/opt/conda/lib/python3.6/site-packages/conda/core/index.py", line 120, in fetch_index
        repodatas = collect_all_repodata(use_cache, tasks)
      File "/opt/conda/lib/python3.6/site-packages/conda/core/repodata.py", line 75, in collect_all_repodata
        repodatas = _collect_repodatas_serial(use_cache, tasks)
      File "/opt/conda/lib/python3.6/site-packages/conda/core/repodata.py", line 485, in _collect_repodatas_serial
        for url, schan, pri in tasks]
      File "/opt/conda/lib/python3.6/site-packages/conda/core/repodata.py", line 485, in <listcomp>
        for url, schan, pri in tasks]
      File "/opt/conda/lib/python3.6/site-packages/conda/core/repodata.py", line 115, in func
        res = f(*args, **kwargs)
      File "/opt/conda/lib/python3.6/site-packages/conda/core/repodata.py", line 473, in fetch_repodata
        with open(cache_path, 'w') as fo:
    FileNotFoundError: [Errno 2] No such file or directory: '/opt/conda/pkgs/cache/497deca9.json'

@sarasafavi
Copy link
Contributor

For an undetermined reason, older tags of the minimal-notebook image appear to throw this error. Workaround for now is to remove your local instance of that image and then re-build Notebooks; e.g.,

$ docker images
<take note of the ID for jupyter/minimal-notebook>
$ docker rmi <ID noted above>
$ docker build --rm -t planet-notebooks .

A longer-term fix is that we use our own docker image; I'll create a new issue for that.

@strixcuriosus
Copy link
Contributor Author

Thanks for the suggestion @sarasafavi!
I was able to get a successful build after removing the jupyter/minimal-notebook image and cache layers. I took the rather zealous approach of doing a docker image prune -a

@manivasaganrama
Copy link

manivasaganrama commented Aug 7, 2019

When I am trying to execute this command in terminal:

@sarasafavi
@jreiberkyle
@danabauer
@nateweisiger
@MattFerraro
@theTechie
@geowurster
@spencermathews
@jakedahn
@gitter-badger

docker rmi

I am getting:

Error response from daemon: conflict: unable to delete db464e6587fb (must be forced) - image is being used by stopped container 048ff8c32674

Need help

@strixcuriosus
Copy link
Contributor Author

For anyone else who hits the problem @manivasaganrama found, you can remove containers with docker rm
https://docs.docker.com/engine/reference/commandline/rm/#remove-all-stopped-containers
e.g. docker rm 048ff8c32674

You may also find docker system prune to be helpful
https://docs.docker.com/engine/reference/commandline/system_prune/

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