Closed garethrepton closed 10 years ago
What version of Chocolatey are you using? Is Chocolatey already installed on the machine when you run the build on the TeamCity Build Agent, or are you installing it as part of the build?
I'm using the Latest version available using the easy install method. I think its v0.9.8.23 although I can't find a version number anywhere.
I have already installed chocolatey on the buildagent, but I do run a chocolatey install script as the first item as well to ensure new agents get it if they need it.
On the Build Agent, open PowerShell and type
choco
This will output the current version number.
So, to confirm, although you have chocolatey installed on the Build Agent, you are running the Chocolatey installation script again as part of the TeamCity build, is that correct?
If so, then I think this is the issue. There is a known issue in 0.9.8.23 where after installing, you have to close and re-open the PowerShell window before running a cinst, otherwise, you get the issue you are seeing. Can you try taking out the Chocolatey install script just now?
This issue is fixed, and will be included in the next release.
FIXED using gep13's information :)
I can confirm I'm using v0.9.8.23
Thank you gep13, you're absolutely right. For completeness in case anyone finds themselves here, I had to:
Glad to hear that you got it working! :+1:
Thanks for the help.
That is fixed in vNext which we should have a beta coming out soon for
I'm having a persistent issue with chocolatey and Team City.
Using a TeamCity commandline build step, running a very simple chocolatey package restore command:
C:\Chocolatey\bin\cinst .nuget\ChocolateyPackages.config And a simple package file that looks like:
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="pstools" /> </packages>
I consistently get, the package restore failed and the message "Cannot bind argument to parameter 'Path' because it is an empty string".
If I run this locally as the same user on the machine, the package restore succeeds.
I think this is something to do with TeamCity and the Path variable conflicting with chocolatey as it does add a BuildParameter called "Path" and "SystemDrive" when I added the commandline task to run Chocolatey.
I have tried setting the Path variable to %env.Path%, but this doesn't help.