Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot git-clone an OpenShift application

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://[email protected]/~/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://[email protected]/~/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:     [email protected]
  Git remote: ssh://[email protected]/~/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://[email protected]/~/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.
like image 395
Erel Segal-Halevi Avatar asked Sep 08 '13 14:09

Erel Segal-Halevi


4 Answers

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.

like image 191
Jérôme Verstrynge Avatar answered Sep 28 '22 07:09

Jérôme Verstrynge


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://[email protected]/~/git/mynode.git/

and if you have any changes in repository:

git commit -a
git push
like image 25
Reza Ebrahimi Avatar answered Sep 28 '22 09:09

Reza Ebrahimi


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.

like image 21
joshua-anderson Avatar answered Sep 28 '22 07:09

joshua-anderson


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

like image 24
Suseendran Kandasamy Avatar answered Sep 28 '22 08:09

Suseendran Kandasamy