Unable to execute chef client command "knife" as a build step in teamcity

Hi all,
  We've created a set of knife plugins that we use in our build environemnt to deploy and managed our test systems.  One of our build steps to running integration testing is to start our test environment using this command.

/usr/bin/knife st test start


And to stop it using

/usr/bin/knife st test stop.

However, whenever I execute either of these commands on my agent, they fail.  My agent runs on an Ubuntu 10.10 server.  The user my agent runs as is "teamcity".  If I log in to the shell as the user "teamcity", and execute the command "/usr/bin/knife st test stop", my knife plugins work properly.  I have a feeling this is an issue with ssh keys.  The knife plugin uses a ruby SSH wrapper to ssh into all our test nodes and gracefully shut them down.  Here is the output from teamcity-agent.log.


Found runner simpleRunner for 4271
[2012-01-10 08:25:49,802]   INFO - erStages.start.CallRunnerStage - Found runner simpleRunner for 4271
[2012-01-10 08:25:49,802]   INFO - erStages.start.CallRunnerStage - Start build runner for build 4271 simpleRunner
[2012-01-10 08:25:49,802]   INFO - erStages.start.CallRunnerStage - ----------------------------------------- [ Operations::Stop Test2 #11 (buildId = 4271) ] -----------------------------------------
[2012-01-10 08:25:49,840]   WARN - r.AnyCommandLineServiceWindows - Failed to set executable attribute for /usr/bin/knife: chmod +x exit code is 1
[2012-01-10 08:25:49,896]   INFO - nner2.OsProcessHandlerListener - /usr/bin/knife st test stop
[2012-01-10 08:25:53,774]   INFO - ernalArtifactsProcessingLogger - Start: Sending files
[2012-01-10 08:25:53,810]   INFO - ernalArtifactsProcessingLogger - Done publishing artifacts to .teamcity/properties, total files published: 1
[2012-01-10 08:25:53,810]   INFO - ernalArtifactsProcessingLogger - Done: Sending files
[2012-01-10 08:25:53,869]   INFO - ernalArtifactsProcessingLogger - Publishing artifacts process finished




Any ideas why this isn't working?
1 comment
Comment actions Permalink

Todd,

Could you please attach your runner settings.
Is /usr/bin in teamcity user's PATH?

0

Please sign in to leave a comment.