I'm getting error "Permission denied (publickey)." when I'm doing shell command in jenkins:

export PATH="/usr/local/bin:$PATH"
echo $PATH

npm install
bower cache clean
bower install

I'm connecting through SSH to private git repo in STASH. My code is failing on random custom dependencies in "bower install". I did all jenkins-stash ssh configuration like https://wiki.csiro.au/display/ASC/Connecting+Jenkins+to+Stash

Here is exact error what I'm getting:

.
bower bootstrap#~3.3.4                                                  extract  archive.tar.gz
bower bootstrap#~3.3.4                                              resolved git://github.com/twbs/bootstrap.git#3.3.5
bower backbone#~1.2.0                                                extract archive.tar.gz
bower backbone#~1.2.0                                               resolved git://github.com/jashkenas/backbone.git#1.2.3
bower custom-theme#*                                     ECMDERR Failed to execute "git ls-remote --tags --heads ssh://[email protected]:7999/cpui/custom-theme.git", exit code of #128 Permission denied (publickey). fatal: Could not read from remote repository.  Please make sure you have the correct access rights and the repository exists.

Additional error details:
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `bower cache clean && bower install && grunt copy:hooks`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'bower cache clean && bower install && grunt copy:hooks'.
npm ERR! This is most likely a problem with the another-custom-theme package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     bower cache clean && bower install && grunt copy:hooks
npm ERR! You can get their info via:
npm ERR!     npm owner ls another-custom-theme
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Shared/Jenkins/Home/jobs/CUSTOM_TEST/workspace/npm-debug.log
Build step 'Execute shell' marked build as failure
Finished: FAILURE

The only notice, that everything is OK if I'm running all that commands from command line directly.

Thanks!

0 Answers