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

[bug] conan download with optional user/channel does not work #6009

Closed
theirix opened this issue Oct 31, 2019 · 7 comments · Fixed by #6010
Closed

[bug] conan download with optional user/channel does not work #6009

theirix opened this issue Oct 31, 2019 · 7 comments · Fixed by #6010

Comments

@theirix
Copy link
Contributor

theirix commented Oct 31, 2019

Summary

Downloading Conan packages without user/channel (i.e. zlib/1.2.11 instead of zlib/1.2.11@conan/stable) does not work. Such packages are built on CCI and it will be good to be able to download them for debugging.

Environment Details (include every applicable attribute)

  • Operating System+version: macOS 10.14.6
  • Conan version: conan 1.19.3
  • Python version: 3.7.4

Steps to reproduce (Include if Applicable)

  1. Run conan download 'zlib/1.2.11:76f87539fc90ff313e0b3182641a9bb558a717d2' to download a package without explicit user/channel
  2. Expected: package is downloaded
  3. Actual: got the error ERROR: Provide a valid full reference without wildcards

Thoughts

The syntax for a short reference was given from Conan docs and from conan-center-index docs.

Anyway I tried following commands with the same error:

  • conan download 'zlib/1.2.11@_/_#76f87539fc90ff313e0b3182641a9bb558a717d2'
  • conan download 'zlib/1.2.11@/:76f87539fc90ff313e0b3182641a9bb558a717d2'

And this command with a different error "ERROR: Recipe not found: 'zlib/1.2.11'":

  • conan download 'zlib/1.2.11@#76f87539fc90ff313e0b3182641a9bb558a717d2'

It is curious that if Conan is run with --package argument, it suggests to use the exactly failed command:

WARN: Usage of `--package` argument is deprecated. Use a full reference instead: `conan download [...] zlib/1.2.11:76f87539fc90ff313e0b3182641a9bb558a717d2`
ERROR: Provide a valid full reference without wildcards.

The same problem with upload command was fixed recently in #5822.

I suppose the check_valid_ref method should relax the requirements for short references..

@memsharded memsharded self-assigned this Oct 31, 2019
@memsharded
Copy link
Member

memsharded commented Oct 31, 2019

Reproduced.

Yes, the workaround is to use the deprecated way:

conan download zlib/1.2.11@ -p 76f87539fc90ff313e0b3182641a9bb558a717d2

I am going to check possible fixes

@memsharded
Copy link
Member

Submitted a possible fix, maybe for 1.20

@jwinkler2083233
Copy link

I ran into this same issue while trying to download the 7zip/19.00 package from conan-center.
I'm using version 1.29.0 of conan, with python3.6

@memsharded
Copy link
Member

memsharded commented Sep 4, 2020

Hi @jwinkler2083233

Can you please clarify exactly what command are you running, and the error message that you are getting? This was fixed and released, so it could be a regression or another bug, in that case it might be worth to create a new issue. Please tell the details and we will try to help. Thanks!

Edit: Just in case, this works fine here:

conan download 7zip/19.00@ -r=conan-center
WARN: Remotes registry file missing, creating default one in C:\Users\memsharded\.conan\remotes.json
Downloading conanmanifest.txt completed [0.10k]
Downloading conanfile.py completed [3.60k]
Downloading conan_export.tgz completed [0.23k]
Decompressing conan_export.tgz completed [0.00k]
7zip/19.00: Getting the complete package list from '7zip/19.00#0'...
7zip/19.00: Retrieving package 456f15897172eef340fcbac8a70811f2beb26a93 from remote 'conan-center'
Downloading conanmanifest.txt completed [0.82k]
Downloading conaninfo.txt completed [0.30k]
Downloading conan_package.tgz completed [4470.29k]
Decompressing conan_package.tgz completed [0.00k]
7zip/19.00: Package installed 456f15897172eef340fcbac8a70811f2beb26a93

@FunMiles
Copy link

I am also having this problem on Mac OS X with conan 1.34.0

michel@iMacGine ~ % conan download cgns/3.4.1 -r conan-center
ERROR: Provide a valid full reference without wildcards.

@memsharded can you reproduce it? Or is it only on MacOS?

@memsharded
Copy link
Member

$ conan download cgns/3.4.1@ -r conan-center

You need the @, to mark this is a package reference, even if it doesn't have user/channel. This will be changed in Conan 2.0, but at the moment it was necessary to not break.

@FunMiles
Copy link

With the @, it works. Thanks. But it's a lot of download. I'll try with just the recipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants