After upgrading to 0.10.12 and 0.10.13, choco install [package] can no longer connect to our local LaGet server. --verbose --trace shows that we are receiving an error 500.
choco install [package] should connect to our server, download the package, and complete.
1) Start with choco version 0.10.11.
2) Install a package in our local source
3) Uninstall that package
4) Upgrade choco to version 0.10.13
5) Try to install package
Please see this gist
I have included the full log, but I have also separated out the verbose logs for the 0.10.13 and 0.10.11 attempts.
NOTE: Added by admin
Caused by #1397 optimizations
In Chocolatey 0.10.14, you should run choco feature disable -n usePackageRepositoryOptimizations - this will set Chocolatey back to the older methods it used for package install/upgrade queries. Keep in mind those are horribly inefficient. It would be good to also let the folks who create that repo know they should implement fixes that work appropriately with filtering on Packages() url.
The issue seems to be in how packages are requested.
0.10.11 uses
System.Net Information: 0 : [3084] HttpWebRequest#31334997 - Request: GET /api/v2/FindPackagesById()?id='jre6' HTTP/1.1
While 0.10.13 does
System.Net Information: 0 : [5912] HttpWebRequest#6471942 - Request: GET /api/v2/Packages()?$filter=(tolower(Id)%20eq%20'jre6')%20and%20IsLatestVersion HTTP/1.1
@godofgrunts thanks for logging this.
Can I ask what you get when you go to <your url>/api/v2/$metadata - It should look something like https://chocolatey.org/api/v2/$metadata (but obviously not exactly like that as it doesn't support data service packages)
I see this in the logs:
~~~
@godofgrunts That second part, Is Service Based - True means it should support queries with the filter, otherwise it should continue to use the old method. Once you get me that $metadata output, we can see what the issue is.
If it doesn't have a $metadata resource hanging off of it, it should be determined as NOT service-based IIRC.
Sorry for the delay, here is the $metadata from my server.
In working on #1771, we found a few things. For what you are experiencing, we've added a feature that you can disable so that Chocolatey queries in the old inefficient method it did in 0.10.11 and before. I'd recommend reading over #1397 (which caused this issue) to understand why we went this route in the first place.
In the meantime, this is fixed for Chocolatey 0.10.14, where you can simply turn off the feature with choco feature disable -n usePackageRepositoryOptimizations - this will set Chocolatey back to the older methods it used for package install/upgrade queries. There should be a beta available in a little while.
It would be good to also let the folks who work on LaGet know they might want to implement fixes that work appropriately with filtering on Packages() url.
BTW @godofgrunts the metadata looks pretty standard.
Thanks for the info. LaGet hasn't been updated in a long time so maybe it's time I find an alternative NuGet server.
I appreciate your time and providing a work around.
Related to #1775 - it appears Simple NuGet Server (PHP) is also affected by these optimizations.
It's been noted that Gemfury also has issues with the repository optimizations.
Since this breaks compatibility, maybe you should add something to the metadata on the server end that will tell the client that it accepts the new optimized way of searching so this is seemless for end users.
@godofgrunts that's not a bad idea - like an opt-in kind of scenario.
Tried with PHPNuget (last git version/master) and choco 0.10.15, seems working!
C:\windows\system32>choco install putty.install --source http://localhost:9999/api/v2/
Chocolatey v0.10.15
Installing the following packages:
putty.install
By installing you accept licenses for the packages.
putty.install v0.71
putty.install package files install completed. Performing other installation steps.
The package putty.install wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): A
Installing 64-bit putty.install...
putty.install has been installed.
putty.install may be able to be automatically uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
see the changes (or in powershell/cmd.exe just type refreshenv).
The install of putty.install was successful.
Software installed as 'msi', install location is likely default.
Chocolatey installed 1/1 packages.
See the log for details (C:\ProgramDatachocolatey\logschocolatey.log).
Same here (i.e. 0.10.15 works fine now), thanks guys!
We just updated to 0.10.15 and it's working fine (just to confirm with you). Thank you for the assistance!