-
Notifications
You must be signed in to change notification settings - Fork 884
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
choco source priority is ignored #1541
Comments
Hi @daveschafer, very well documented. This was first discovered as #1190, and we verified what you are seeing back in September timeframe. We have this in the backlog to fix so it works as documented. It turns out it was a bug in NuGet.Core that wasn't respecting this setting correctly. |
Hi @ferventcoder |
@sudoturnkey i.e. move your source above: I could be wrong. Try it and see what results you get. |
This comment has been minimized.
This comment has been minimized.
as long as this issue persists, you could "automatically" fix the sources by doing something like
|
I am just getting into Chocolatey and bumped into this issue. After searching the net I found this report. Based on the info I found here I tried to work arround it by changing the Repo order in the chocolatey.config by removing the public Repo all together, adding my private repo's and then adding the public repo back again. As a result my private Repo's are positioned above the default chocolatey public repo in the chocolatey.config. I even gave my two private Repo's a priority of 1 and 2 and gave the public one a prio of 99. For some reason the Public repo still seems to take precedense over my privates. Am I doing something wrong or is this workarround not fixing the issue? Or could the fact that my privates are UNC based repo's have something to do with this? Thanks in advance.. |
@martinisoft1 No, this workaround never worked for me (or anyone else?) either. The priority and the order of repos does not seem to have an impact, Choco Repo gets choosen any way. When I find the time I will take a look into the code. |
@daveschafer I'm quite certain the workaround I've suggested above has been working for me in the past. edit: not so sure anymore..
|
@daveschafer @martinisoft1 @sudoturnkey currently the best way to handle this is to remove or disable the sources that don't apply. |
Well, the thing is that I do need the public repo for some standard applications. At the moment I am using a prefix for the packages in my private repo's to prevent duplicates, not ideal but good enough for now. The thing that I find strange about the behavior is that I don't see why Choco would even know that it deals with its own Public repo. Even when I change the Prio, the Order and even the name (and yes I checked the chocolatey.config) the issue persist. One would think that in this case Choco would handle it as just an other Repo but in some way it seems to recognizie it as its Public Repo and give it the highest priority. |
@martinisoft1 I don't think it is that. I think it is that it is checking all the repos instead of giving priority, I know it is in fact - I've seen the code in NuGet.Core that does this - it's a NuGet.Core code base bug. |
@ferventcoder Is this issue linked to this NuGet issues? I took a look into the code and played around with some choco commands, I think a good workaround for this problem, which I verified, is the use of the --source parameter. # list sources
choco source
chocolatey - https://chocolatey.org/api/v2/ | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.
bob - http://1.1.1.1/api/v2 | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.
-----
# to install a new package from YOUR source
choco install --source=bob packagexyz
#and to update only from YOUR repo
choco update --source=bob all/packagexyz What does not work is when you install "package X" from your source and run a "choco update" without specifying a source. The source with the newest packages gets chosen, priority does not matter here. So like in the NuGet issue mentioned, you would need like a 'source' or 'priority' tag for every choco package seperately, to distinguish from where it should get its updates, which is kinda overkill (but a possible solution). |
I hate to have this roll another release, but we have some fixes that need to get out soon and this may be a big undertaking on its own. This is something we want to get fixed sooner than later though! |
Are there any news about this topic? |
Maybe this will help someone who has the same issue: Maybe there are other issues with your source. You can check this using this command:
|
Hello, is there any status update on this? In my organization we really need the ability to have priority respected properly. We have the following use case: Computers on our internal network reach out to our hosted chocolatey source via our corporate proxy. |
There have been some performance related problems with the changes associated with this issue ( |
This commit re-adds the ability to order sources according to a specified priority. This ability seems to have been lost due to changes in the codebase in the past and thus needed to be re-implemented when the repository optimization is enabled.
This should have been included in the last commit where the associated PR was merged in.
This commit updates the the acquiring of package from prioritized aggregate repository to not add a package to the result list we iterate through when a package could not be found. This change was necessary in case an invalid identifier was used, or the package exist but is only available on a disabled source.
This commit updates the codebase to add support for ordering sources according to priority for install, upgrade and outdated command.
This commit updates the codebase to add support for ordering sources according to priority for install, upgrade and outdated command.
This commit updates the codebase to add support for ordering sources according to priority for install, upgrade and outdated command.
This commit updates the codebase to add support for ordering sources according to priority for install, upgrade and outdated command.
This commit updates the codebase to add support for ordering sources according to priority for install, upgrade and outdated command.
This commit updates the codebase to add support for ordering sources according to priority for install, upgrade and outdated command.
This should work around chocolatey/choco#1541, which causes priority to be ignored and our proxy cache to be skipped
This commit adds new tests for when we have support in Chocolatey CLI in either the 1.x support branch or in the develop vNext branch. These tests are mostly ignored for now but can be easily changed by updating the SourcePriorityAttribute in the tinyspec file to inherit from a CategoryAttribute to make these run.
This commit updates the tests to be valid for the next version of Chocolatey CLI
This commit updates the tests to be valid for the next version of Chocolatey CLI
This commit adds new tests for when we have support in Chocolatey CLI in either the 1.x support branch or in the develop vNext branch. These tests are mostly ignored for now but can be easily changed by updating the SourcePriorityAttribute in the tinyspec file to inherit from a CategoryAttribute to make these run.
This commit updates the tests to be valid for the next version of Chocolatey CLI
(#1541) Add tests for future implementation of source priority
What You Are Seeing?
If you have multiple chocolatey sources, the priority which you give them is not applied.
Quote from the Choco Wiki:
This issue happens if you have the default source set to 0 or to a higher number than your prefered source.
What is Expected?
The expectation is that every source with priority > 0 is prefered and that the lower the the priority number, the higher the priority. Nevertheless this does not seem to be the case.
Another Quote from Gary Ewan Parker regarding the default behaviour:
How Did You Get This To Happen? (Steps to Reproduce)
In this Example we have ccleaner 5.35.6210 on our own source, the public source provides the version 5.41.6446. Here you can see, that the "chocolatey" priority is set to 2 (same behaviour with 0) and our "tkcloud" source is set to 1 (lower so it should be prefered):
Nevertheless, the public version is selected.
If we disable the default repository, the correct version from our source is selected:
We could verify this faulty behaviour on multiple systems. Even a remove and readd of the sources does not resolve this
Output Log
On another note, the choco list commands provides the packages in the correct order:
The only problem seems to be the install commands.
The text was updated successfully, but these errors were encountered: