Closed fuJiin closed 11 years ago
Is the ssh key added to the root user or regular user?
About the cannot run /tmp/ssh.key.sh
:
/tmp/ssh.key.sh is created when the repo_git provider is called with a :pull action: it calls the create definition in the repogit helper and that creates the .sh file and sets "GITSSH" environmental variable to it's path. Check that the file actually gets created.
@arangamani:
The key is added to ~root/.ssh/
in a custom RightScript. There's also a line in the script that adds IdentifyFile ~root/.ssh/<key-name>
to ~root/.ssh/config
. This works if the git clone
command is run independently.
@mrusan: I see the create definition being called, but it also looks like the key is removed after repo_git:pull (see code). The error occurs in _app_passenger:install_required_appgems, by which time it looks like the key file has been deleted.
I think we have 2 options:
/tmp/ssh.key.sh
. Not sure where it's calling for this in the first place, and bundler should be able to use SSH settings from ~root/.ssh/config
Any thoughts?
Not sure what your custom RightScript is used for but this shouldn't be the case: ensure that the ssh key is provided via input or the repo_git provider is been called from another location with the right key set up or make sure node[:repo][:default][:credential]
is set to the ssh key. You can also comment out the code you linked to (the one that removes the ssh.key.sh) and see that the file actually gets created, has the right permissions and contains the key.
@fuJiin: It looks like this problem is due to an ENV variable left around from the app::do_update_code recipe, which calls the repo LWRP. This line is the culprit:
...which sets up the GIT_SSH environment variable that prompts git to run /tmp/ssh.key.sh. This is a bug as the git_repo provider should clear this value when it is done with the "pull" action.
You should be able to work around this issue by clearing GIT_SSH before running your command. For example:
sh(export GIT_SSH=; /usr/bin/bundle install --gemfile=***/Gemfile)
hope that helps! Thanks for reporting the issue!!
@caryp - that works thanks!
Since the solution given by @caryp worked, closing this issue now.
Hey guys,
Having some issues installing a gem from a private repo. The error I get is attached below. Any help here is appreciated.
Thanks!
Notes:
• Using a custom clone of Apache-Rails-Passenger ServerTemplate
• SSH-key has been added to the machine prior to this step
• I can SSH into the machine, and run
bundle install
, andgit clone <repo-path>
, so it doesn't seem to be a SSH issue• Not sure where the
cannot run /tmp/ssh.key.sh
comes fromError: