-
Notifications
You must be signed in to change notification settings - Fork 993
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 install --update should fail if package isn't found on remote #11022
Comments
Failing a --update because some package doesn't exist in a remote is unfeasible. Many times, such packages will not exist in the remotes, when developing new packages locally, or simply because the remote it came from is temporarily disabled. There can be multiple remotes too, so it is not enough that it doesn't exist in 1 remote to fail. So Conan will not fail if it requests its defined and enabled remotes if there are updates and the servers respond with 404s, because those packages doesn't exist in the servers. The UX for that will be quite bad for a large number of users, even make the --update impractical. Now, if the security configuration makes a server return a 404 even when the package exists, but the user doesn't have enough privileges to see it, is a different story. Good security practices says that in general it is better to return 404 rather than return other thing that will provide information of the existence of a given resource. There is little we can do here. So, as a result, this doesn't look like a bug, but the expected behavior, I don't think we want to change this behavior. If servers require auth for "read" permissions over packages, and the |
Thanks @memsharded for your thoughtful reply :-).
Understood. I think there are valid use cases for both behaviours though. The current behaviour of "assume 404 is fine" isn't very useful for the simplest enterprise use case of a single Artifactory remote hosting all packages. I see that there are more complex configurations where you'd want to allow it to fail silently, but I'd have thought "tell me if it fails" would be a pretty common expectation.
That sounds fair. However it would still be useful to have some way of knowing that the
No, I think this is primarily an issue for end-users using a conanfile.txt to maintain the dependencies of a project. Currently we use The CI case is more straightforward, since you can just explicitly log in before running
This sounds promising. Is there a way to run a |
This sounds promising. Is there a way to run a conan user command to determine whether the user is currently authenticated? I couldn't find a way, but perhaps I missed something. You are right, there is no way that a stored token could be validated without requiring entering credentials again. |
Closed by #13180 |
#13180 is proposing a new command This is the best that the client can do, it is a responsibility of the server to return 404 not found for queries if not authenticated, without raising an auth challenge if they activate anonymous usage. And it doesn't make sense that the client is continuously authenticating in the servers just in case, so the best is a explicit user command that does this task. |
Sounds perfect, thanks. We've worked around this for 1.x by searching for a package known to always be on the remote and raising a "not authenticated" error message if the package can't be found. But an explicit command is much better 👍 . |
@memsharded, @czoido, the No problems here:
But I can't find any packages:
Try re-authenticating:
Now I can see packages:
But
Is this working as expected? I can't use |
Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
Logs (Executed commands with output) (Include/Attach if Applicable)
Expected Behaviour
conan install --update
command should fail if the package isn't found on the remote, as there may be a more recent revision available.Actual Behaviour
Command succeeds.
Comments
The response to #10918 (comment) concluded that
conan install --update
should hard-fail if the remote can't be reached, since otherwise "this behavior can easily hide network failures, configuration errors, and other problems, silently producing unexpected results".In this case, if the user unexpectedly becomes unauthenticated (either explicitly or due to a credential timeout), Artifactory returns a 404 for all package operations. That causes
conan install --update
to "silently produce unexpected results" and the user needs to look carefully at the logs to notice that there was an authentication error.See #4930 and #8127 for more details on how Artifactory behaves when the user is not properly authenticated.
The text was updated successfully, but these errors were encountered: