conda / conda-build

Commands and tools for building conda packages
https://docs.conda.io/projects/conda-build/
Other
381 stars 423 forks source link

conda build crashes on updating progress bar #224

Closed stephentu closed 9 years ago

stephentu commented 10 years ago
stephentu@fender conda-recipes(master)$ conda build picos
BUILD START: picos-1.0.1-np19py27_0
Fetching package metadata: ......
Solving package specifications: .
The following NEW packages will be INSTALLED:

    openssl:    1.0.1h-1  
    python:     2.7.8-1   
    readline:   6.2-2     
    setuptools: 5.8-py27_0
    sqlite:     3.8.4.1-0 
    system:     5.8-1     
    tk:         8.5.15-0  
    zlib:       1.2.7-0   

Linking packages ...
[      COMPLETE      ] |#########################################################################################################################################################################################################################################################| 100%
Source cache directory is: /home/stephentu/miniconda/conda-bld/src_cache
Downloading source to cache: PICOS-1.0.1.tar.gz
An unexpected error has occurred, please consider sending the
following traceback to the conda GitHub issue tracker at:

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

Include the output of the command 'conda info' in your report.

Traceback (most recent call last):######################################################################################################################################                                                                                    | ETA:  0:00:00 307.37 kB/s
  File "/home/stephentu/miniconda/bin/conda-build", line 5, in <module>
    sys.exit(main())
  File "/home/stephentu/miniconda/lib/python2.7/site-packages/conda_build/main_build.py", line 110, in main
    args_func(args, p)
  File "/home/stephentu/miniconda/lib/python2.7/site-packages/conda_build/main_build.py", line 308, in args_func
    args.func(args, p)
  File "/home/stephentu/miniconda/lib/python2.7/site-packages/conda_build/main_build.py", line 268, in execute
    build.build(m, verbose=not args.quiet, post=post)
  File "/home/stephentu/miniconda/lib/python2.7/site-packages/conda_build/build.py", line 304, in build
    source.provide(m.path, m.get_section('source'))
  File "/home/stephentu/miniconda/lib/python2.7/site-packages/conda_build/source.py", line 221, in provide
    unpack(meta)
  File "/home/stephentu/miniconda/lib/python2.7/site-packages/conda_build/source.py", line 60, in unpack
    src_path = download_to_cache(meta)
  File "/home/stephentu/miniconda/lib/python2.7/site-packages/conda_build/source.py", line 48, in download_to_cache
    download(meta['url'], path)
  File "/home/stephentu/miniconda/lib/python2.7/site-packages/conda/fetch.py", line 319, in download
    getLogger('fetch.update').info(n)
  File "/home/stephentu/miniconda/lib/python2.7/logging/__init__.py", line 1160, in info
    self._log(INFO, msg, args, **kwargs)
  File "/home/stephentu/miniconda/lib/python2.7/logging/__init__.py", line 1279, in _log
    self.handle(record)
  File "/home/stephentu/miniconda/lib/python2.7/logging/__init__.py", line 1289, in handle
    self.callHandlers(record)
  File "/home/stephentu/miniconda/lib/python2.7/logging/__init__.py", line 1329, in callHandlers
    hdlr.handle(record)
  File "/home/stephentu/miniconda/lib/python2.7/logging/__init__.py", line 757, in handle
    self.emit(record)
  File "/home/stephentu/miniconda/lib/python2.7/site-packages/conda/console.py", line 31, in emit
    fetch_progress.update(n)
  File "/home/stephentu/miniconda/lib/python2.7/site-packages/conda/progressbar/__init__.py", line 271, in update
    raise ValueError('Value out of range')
ValueError: Value out of range

output of conda info

stephentu@fender ~$ conda info
Current conda install:

             platform : linux-64
        conda version : 3.7.1
  conda-build version : 1.8.2
       python version : 2.7.8.final.0
     requests version : 2.4.3
     root environment : /home/stephentu/miniconda  (writable)
  default environment : /home/stephentu/miniconda
     envs directories : /home/stephentu/miniconda/envs
        package cache : /home/stephentu/miniconda/pkgs
         channel URLs : https://conda.binstar.org/t/<TOKEN>/datamicroscopes/linux-64/
                        https://conda.binstar.org/t/<TOKEN>/distributions/linux-64/
                        https://conda.binstar.org/t/<TOKEN>/stephentu/linux-64/
                        http://repo.continuum.io/pkgs/free/linux-64/
                        http://repo.continuum.io/pkgs/pro/linux-64/
          config file : /home/stephentu/.condarc
    is foreign system : False
stephentu commented 10 years ago

picos is a new package i'm trying to create. its meta.yaml looks like

package:
  name: picos
  version: !!str 1.0.1

source:
  fn: PICOS-1.0.1.tar.gz
  url: http://picos.zib.de/dist/PICOS-1.0.1.tar.gz
  md5: f499ca5ef81118a84ddf68eb4caf3547 

requirements:
  build:
    - python
    - setuptools

  run:
    - python
    - numpy
    - cvxopt

test:
  imports:
    - picos

about:
  home: http://picos.zib.de/index.html
  license: GPL
  summary: 'Python Interface for Conic Optimization Solvers'
asmeurer commented 9 years ago

I think this happens when the headers for the file give the wrong file size. We should probably protect against it.

bkreider commented 9 years ago

I can also recreate this problem. This is non-essential information that is breaking conda build. Perhaps we can ignore when we exceeding the limit and instead set the value to self.maxvalue when it is in violation? Perhaps a logging.WARN message when this happens so it is still noted?

https://github.com/conda/conda/blob/master/conda/progressbar/__init__.py#L268-L271

if (self.maxval is not UnknownLength
and not 0 <= value <= self.maxval):
    raise ValueError('Value out of range')

@stephentu The current workaround is to use conda build --quiet <recipe> to disable the progressbar output.

minrk commented 9 years ago

For reference, this is coming up for mpc, at the URL http://www.multiprecision.org/mpc/download/mpc-1.0.1.tar.gz, which has the headers:

{
 'Content-Encoding': 'gzip',
 'Content-Length': '624125',
 'Content-Type': 'application/x-tar',
}

The length is correct, but it's the gzipped bytes, and requests is helpfully unzipping them. So the content size is the gzipped size, but the counter is updating the tar size, which is the actual file conda is downloading.

github-actions[bot] commented 2 years ago

Hi there, thank you for your contribution!

This issue has been automatically locked because it has not had recent activity after being closed.

Please open a new issue if needed.

Thanks!