7

I just opened an OpenShift account, and went through this tutorial:

https://www.openshift.com/blogs/any-version-of-nodejs-you-want-in-the-cloud-openshift-does-it-paas-style

When I got to creating the app, I got the following error:

erelsgl@erelsgl-H61MLC:~/mynode$ sudo rhc create-app mynode nodejs-0.6
Application Options
-------------------
  Namespace:  erel
  Cartridges: nodejs-0.6
  Gear Size:  default
  Scaling:    no

Creating application 'mynode' ... done


Waiting for your DNS name to be available ... done

Cloning into 'mynode'...
Warning: Permanently added the RSA host key for IP address '23.22.156.99' to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: The remote end hung up unexpectedly
Unable to clone your repository. Called Git with: git clone
ssh://522c....@mynode-erel.rhcloud.com/~/git/mynode.git/ "mynode"

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING:  Your application was created successfully but had problems during
          configuration. Below is a list of the issues and steps you can
          take to complete the configuration of your application.

  Application URL: http://mynode-erel.rhcloud.com/

  Issues:
    1. We were unable to clone your application's git repo - Unable to clone your repository.
Called Git with: git clone
ssh://522c...@mynode-erel.rhcloud.com/~/git/mynode.git/ "mynode"

  Steps to complete your configuration:
    1. Clone your git repo
      $ rhc git-clone mynode

  If you continue to experience problems after completing these steps,
  you can try destroying and recreating the application:

    $ rhc app delete mynode --confirm

  Please contact us if you are unable to successfully create your
  application:

    Support - https://www.openshift.com/support

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



Your application 'mynode' is now available.

  URL:        http://mynode-erel.rhcloud.com/
  SSH to:     522c....@mynode-erel.rhcloud.com
  Git remote: ssh://522c....@mynode-erel.rhcloud.com/~/git/mynode.git/

Run 'rhc show-app mynode' for more details about your app.

I tried to clone, and got this:

erelsgl@erelsgl-H61MLC:~/mynode$ sudo rhc git-clone mynode
Cloning into 'mynode'...
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: The remote end hung up unexpectedly
Unable to clone your repository. Called Git with: git clone
ssh://522c....@mynode-erel.rhcloud.com/~/git/mynode.git/ "mynode"

EDIT: I have an ssh key:

erelsgl@erelsgl-H61MLC:~/mynode$ sudo rhc sshkey list
default (type: ssh-rsa)
-----------------------
Fingerprint: 62:...

You have 1 SSH keys associated with your account.
timo.rieber
  • 3,727
  • 3
  • 32
  • 47
Erel Segal-Halevi
  • 33,955
  • 36
  • 114
  • 183

7 Answers7

6

I got exactly the same issue and found the solution, under windows. It seems you are under Linux, but may be this will give you ideas.

First you need to make sure your SSL keys have been created properly for Git (check this post on my blog for instructions).

Then, using Git for Windows, right click on the folder to clone the project and enter the SSL URL:

enter image description here

Make sure you check Load Putty Key and select the path to your .ppk file. This worked like a charm for me.

May be you need to specify the path to your private key file under Linux when cloning from the command line.

Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
  • Strange thing, I do not want to install another program (here Tortoise) on windows.It should work on the cmd, git should find the .ssh folder and should look up automatically the ppk or private key or whatever. – Timo Feb 12 '14 at 09:51
  • again me.In the webconsole my key name is "tommueller" and not "default". Could this be an issue? BTW, the ppk file used while git makes sense because you need a ppk while "ssh"ing (ssh works for me) – Timo Feb 12 '14 at 10:08
  • I tried to use the git clone cmd when right clicking the folder for tortoise git. But there is no git clone , but many others. Furthermore, does tortoise also provide the "load putty key" when I commit? – Timo Feb 12 '14 at 10:49
  • Git Friends, this might help us!!https://www.openshift.com/blogs/accessing-your-code-for-your-openshift-application-via-windows-explorer-using-tortoisegit – Timo Feb 12 '14 at 11:06
5

Your mistake is you are clone the repository inside app's host, this goes to clone your repository inside your application host on openshift, then it gives you a permission denied to write access on host, you must close it in your local.

First Open a Command Prompt, then type:

mkdir apprepo
cd /d apprepo
git clone ssh://522c....@mynode-erel.rhcloud.com/~/git/mynode.git/

and if you have any changes in repository:

git commit -a
git push
Reza Ebrahimi
  • 3,623
  • 2
  • 27
  • 41
3

It looks like you are having issues with your ssh key. Have you added one to openshift? You can run rhc sshkey list to check. Make sure that one of these private keys is in your ssh folder, C:\user\\[username]\\.ssh\ for windows and ~/.ssh on linux (Note that on both os's they are hidden folders). Openshift refuses to let you do anything with the git repo unless it can verify your ssh key. Take a look at this Openshift SSH Documentation for more details.

Joshua Merriman
  • 925
  • 1
  • 8
  • 13
joshua-anderson
  • 4,458
  • 5
  • 35
  • 56
  • I have a single ssh key (see the edit to my question). How can I check if it is in my ssh folder? My ssh folder (on Linux) contains 3 files: id_rsa, id_rsa.pub, and known_hosts. Non of them contains a fingerprint.. – Erel Segal-Halevi Sep 11 '13 at 18:48
  • try *rhc sshkey add*. If you still are getting errors after trying this, open up your id_rsa.pub file and copy it. Paste it into the public key section of https://openshift.redhat.com/app/console/keys/new to add your current public ssh key into openshift. – joshua-anderson Sep 11 '13 at 23:32
  • I opened the console, and found out that my public key is already there (under the name "default")... probably there is some other problem. – Erel Segal-Halevi Sep 13 '13 at 13:36
  • I still think it is ssh problem. The fact that the server denied your git push means that something ssh related is not lining up. Here is a openshift documentation page for your permission denied error that I found. https://www.openshift.com/kb/kb-e1015-how-to-resolve-permission-denied-errors-permission-denied-publickeygssapi-keyexgssapi-wi – joshua-anderson Sep 14 '13 at 00:17
1

go to preference in eclipse and in ssh key menu, click KEY MANAGEMENT and ther is a rsa key tab click that and copy your public key and click the button save as private key... then go to your open shift application and paste your public key and work on it... i hope it working

0

Don't use sudo when creating your app or when using rhc

ʀɣαɳĵ
  • 1,992
  • 1
  • 15
  • 20
  • try creating the app inside a folder where you have write permissions. The `rhc` command will attempt to create a local git repository for you to work with. You can disable this behavior by using the `--no-git` flag. – ʀɣαɳĵ Sep 27 '13 at 21:44
0

This seems to be the thread for answering SSH key related issues, even if the answer relating to not cloning on the host machine seems to make the most sense.

Regarding the configured keys being good for opening an SSH connection but not for git cloning, I tried everything in this thread and on the OpenShift site and eventually discovered that Git for Windows wasn't using the SSH keys managed by Pageant; the only way for me to clone my repository was to have the Git GUI generate a new key for me and then add that one's public key to my OpenShift application as well.

I'm posting this answer here because I don't know where else I should, I hope it's helpful!

therightstuff
  • 833
  • 1
  • 16
  • 21
0

I have the same problem as you, and got an idea based on ʀɣαɳĵ answer

Don't use sudo when creating your app or when using rhc

Considering this recommendation I tried deleting my app and re-creating it using my user without using sudo, but I received some permission errors indicating problems accessing:
- .openshift folder under my user home folder
- .ssh/rsa* documents under my user home folder also
- My actual directory where a new directory would be created as part of the app creation

After granting access to those resources using chmod:
- chmod 755 for both .openshift and .ssh/rsa*
- chmod -R 777 mydir in my actual directory

I re created the app (rhc create app yourAppName platform ) and everything is working fine now!

Hope it helps you.