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

Failed to upload to Anaconda Cloud #473

Open
hans-permana opened this issue May 16, 2018 · 6 comments
Open

Failed to upload to Anaconda Cloud #473

hans-permana opened this issue May 16, 2018 · 6 comments

Comments

@hans-permana
Copy link

I was initially made aware of this issue when the Travis build of this project failed because the upload to Anaconda Cloud failed.

And then, I tried it manually in my Ubuntu VM to first build the conda package, and then upload it using anaconda upload.

$ anaconda -v -t <anaconda_token> upload ~/miniconda3/conda-bld/linux-64/cate-cli-2.0.0.dev10-py36_0.tar.bz2 -u ccitools
Using Anaconda API: https://api.anaconda.org
[DEBUG] Using token from command line args
Using "ccitools" as upload username
Detecting file type...
[DEBUG] Testing if conda package ..
[DEBUG] This is a conda package
File type is "conda"
Extracting package attributes for upload
Creating package "cate-cli"
Creating release "2.0.0.dev10"
Uploading file "ccitools/cate-cli/2.0.0.dev10/linux-64/cate-cli-2.0.0.dev10-py36_0.tar.bz2"

At a glance it looked as if it was successful (no errors or warnings). However, the package was not really uploaded. I could not find it in Anaconda Cloud.

Any idea what is happening here?

@hans-permana
Copy link
Author

After a bit more digging and putting more debugging, we found out that the actual exception is

Traceback (most recent call last):
  File "/home/hans/miniconda3/lib/python3.6/site-packages/anaconda_client-1.6.13+5.g0f7a39c.dirty-py3.6.egg/binstar_client/commands/upload.py", line 242, in upload_package
    channels=args.labels, callback=upload_print_callback(args))
  File "/home/hans/miniconda3/lib/python3.6/site-packages/anaconda_client-1.6.13+5.g0f7a39c.dirty-py3.6.egg/binstar_client/__init__.py", line 533, in upload
    self._check_response(res)
  File "/home/hans/miniconda3/lib/python3.6/site-packages/anaconda_client-1.6.13+5.g0f7a39c.dirty-py3.6.egg/binstar_client/__init__.py", line 230, in _check_response
    raise ErrCls(msg, res.status_code)
binstar_client.errors.BinstarError: ('Forbidden: Request forbidden -- authorization will not help ([POST] https://api.anaconda.org/stage/ccitools/cate-cli/2.0.0.dev11/linux-64/cate-cli-2.0.0.dev11-py36_0.tar.bz2 -> 403)', 403)

Actually we have two problems here:

  1. That Anaconda silently fails without handling the error correctly by showing the error message to users
  2. The error Forbidden: Request forbidden -- authorization will not help ([POST] https://api.anaconda.org/stage/ccitools/cate-cli/2.0.0.dev11/linux-64/cate-cli-2.0.0.dev11-py36_0.tar.bz2 -> 403 which we don't know what causes this. Note: this is reproducible on MacOS and Linux. On Windows (based on our AppVeyor build), we don't seem to have this issue.

@hans-permana
Copy link
Author

I used the following dependencies:

conda: 4.5.3
conda-build: 3.10.2
anaconda-client: 1.6.14
python: 3.6.4

@hans-permana
Copy link
Author

the second issue was solved by removing the app section in the recipe. It would be nice if an explicit message is returned instead of just 403 error.

@hdoupe
Copy link

hdoupe commented May 31, 2018

@hans-permana I'm running into a similar issue. How did you get the stack-trace you give in this comment?

@hans-permana
Copy link
Author

@hdoupe , I modified the try-except block in binstar_client/commands/upload.py line 236:

        try:
            upload_info = aserver_api.upload(username, package_name, version, file_attrs['basename'], fd,
                                             binstar_package_type, args.description,
                                             dependencies=file_attrs.get('dependencies'), attrs=file_attrs['attrs'],
                                             channels=args.labels, callback=upload_print_callback(args))
        except BaseException:
            # logger.info('Distribution already exists. Please use the -i/--interactive or --force options or `anaconda '
            #             'remove %s/%s/%s/%s', username, package_name, version, file_attrs['basename'])
            # logger.info('error uploading: ', errors)
            import sys
            logger.error('error uploading: ', exc_info=sys.exc_info())

            raise

@hdoupe
Copy link

hdoupe commented Jun 1, 2018

Nice, thanks!

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

2 participants