9

I have been trying to connect to my application via Openshift for days and still have no luck.

I am no certain of which forum to go at this point because I am not getting help anywhere.

1) I am going via terminal and running sudo rhc setup (the reason why I am using sudo is because without it, it did not go to the next step)

2) I am then prompted to do the following:

This wizard will help you upload your SSH keys, set your application namespace, and check
that other programs like Git are properly installed.

Using an existing token for myemail@gmail.com to login to openshift.redhat.com

Saving configuration to /Users/myuser/.openshift/express.conf ... done

Checking for git ... found git version 1.9.2

Checking common problems .Enter passphrase for /Users/myuser/.ssh/id_rsa: 
Enter passphrase for /Users/myuser/.ssh/id_rsa: 
Enter passphrase for /Users/myuser/.ssh/id_rsa: 

3) I created this SSH key twice and it will never accept my password giving me the following error:

An SSH connection could not be established to ghost-mydomain.rhcloud.com. Your SSH
configuration may not be correct, or the application may not be responding. Could not    parse
PKey: no start line (ArgumentError)

4) Yet confusingly it gives me the following result

Checking for a domain ... mydomain

Checking for applications ... found 1

ghost http://ghost-mydomain.rhcloud.com/

You are using 1 of 3 total gears
The following gear sizes are available to you: small

Your client tools are now configured.

5) I then use the access command given on my application page:

ssh 5394cd33e0b8cde6ce000132@ghost-mydomain.rhcloud.com

It prompts me to type in my password and no matter how many times I enter it, it fails: Saving password to keychain failed

What am I doing wrong? How can I simply login to openShift and use my application?

timo.rieber
  • 3,727
  • 3
  • 32
  • 47
HGB
  • 2,157
  • 8
  • 43
  • 74
  • Your app is being created. You just can't ssh to it. This can happen for a variety of reasons and is something that can be fixed later, so OpenShift proceeds to give you information about your app in step 4. You can access your application at http://ghost-mydomain.rhcloud.com/ but chances are you'll want to modify the code, which will require ssh. – sosiouxme Jun 18 '14 at 03:17

9 Answers9

4

When your got

SSH connection could not be established to myapp-mydomain.rhcloud.com. Your SSH configuration may not be correct, or the application may not be responding. Could not parse PKey: no start line (ArgumentError)

just delete ssh keys id_rsa from .ssh directory and than run rhc setup it will create new one for you with the same name.

njjnex
  • 1,490
  • 13
  • 23
4

The similar problem was solved by changing the net-ssh gem

 gem uninstall net-ssh

and then install a stable version. I would suggest to avoid beta versions. because 2.9.3.beta was giving me this problem and now 2.9.2 working just fine.

gem install net-ssh -v 2.9.2

and also try to remove the old key, because there could be a possibility that public key is modified by another application or account.

Saif
  • 6,804
  • 8
  • 40
  • 61
  • @Saif, I've followed this solution and when I've uninstalled *net-ssh 2.9.3-beta1* now I can't call `C:\Users\Igor\laravel5>rhc ssh` the error is: `C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- dl/impo rt (LoadError) ...`. How to fix it? – Igor Savinkin Oct 19 '16 at 11:48
1

I can solve removing /Users/myuser/.ssh/id_rsa directory and running rhc setup

Rene Enriquez
  • 1,418
  • 1
  • 13
  • 33
1

Had the same problem as described by OP. Interestingly, at first everything worked (git, rhc ssh, putty). And from one day to another the problem occured.

Neither creating new rsa keys nor installing another net-ssh version as described in one of the answers helped.

Finally I removed my application with help of the openshift web console and created it new. Now (using the rsa keys that didn't work before) git and putty work fine while rhc ssh still yields the error message "The server did not respond correctly."

user120513
  • 531
  • 4
  • 12
0
rhc ssh yourapplicationname

instead.

mpm
  • 20,148
  • 7
  • 50
  • 55
  • This is really weird. After switching off my machine and reopening terminal I am now unable to find rhc: `sudo rhc setup /Users/myuser/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in `to_specs': Could not find 'rhc' (>= 0) among 6 total gem(s) (Gem::LoadError) ` – HGB Jun 15 '14 at 10:06
  • when i do rhc --version I get: `rhc 1.25.3` What on earth is going on? – HGB Jun 15 '14 at 10:12
  • I reinstalled everything,deleted and recreated rsa keys with and without password. I am getting the same `An SSH connection could not be established to myapp-mydomain.rhcloud.com. Your SSH configuration may not be correct, or the application may not be responding. Could not parse PKey: no start line (ArgumentError)` as in number 3) above. This is a nightmare. – HGB Jun 15 '14 at 10:31
  • mpm I tried your solution and got the following: `Connecting to 539c67465973ca046200033b@myapp-mydomain.rhcloud.com ... The authenticity of host 'myapp-mydomain.rhcloud.com (54.205.138.92)' can't be established. RSA key fingerprint is cf:ee:77:cb:0e:fc:02:d7:72:7e:ae:80:c0:90:88:a7. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'myapp-mydomain.rhcloud.com,54.205.138.92' (RSA) to the list of known hosts. Permission denied (publickey,gssapi-keyex,gssapi-with-mic).` – HGB Jun 15 '14 at 10:34
  • When you `sudo gem install rhc`, this actually installs two things: the executable `rhc`, and the ruby gem `rhc` (and its dependencies). The executable is really just a shell that delegates most of the work to the gem. But it has to be able to load the gem to do much. It looks like you're using rvm, which is likely not using the same ruby and gemset as you installed with. Probably `sudo gem install` installs the gem under the system ruby. Try `rvm use system` and run rhc as your user; there should be no need for `sudo` after install. The install directions assume system ruby, not rvm. – sosiouxme Jun 18 '14 at 03:26
0

It is asking for the password that you created for you SSH Private Key file, not your openshift password. Either make sure that you are entering that password, or create a private key file that does NOT use a password.

  • I know. I have created a ssh with and without a password. Nothing works, please see below. – HGB Jun 15 '14 at 10:36
0

The only way that this worked for me was to actually create a SSH key locally with ssh-keygen -p without rhc setup and "not" giving it a password. I then went back to OpenShift clicked add a key and pasted the contents of my rsa file.

There is obviously some kind of bug with authentication on Openshift or the installation is not right.

HGB
  • 2,157
  • 8
  • 43
  • 74
0

I suspect one of two things is going on.

  1. The key you are trying to use from /Users/myuser/.ssh/id_rsa may be an ssh V2 key. If you created this on a Mac, it can be configured to create either V1 or V2 by default. OpenShift isn't AFAIK configured to support V2 keys. I would expect ssh-keygen -t rsa to create V1 keys.

  2. Your use of sudo rhc is confusing things. Commands run by sudo run as root, while commands without it run as your user. Above rhc setup appeared to still be accessing your user's ssh key, so I am not certain it's related, but there should be no need for root access. Your comments elsewhere indicate rvm is in use. Try rvm use system so that you can run rhc setup as your user against the system gems (which is most likely where the rhc gem is installed).

sosiouxme
  • 1,226
  • 16
  • 26
  • Sorry, this was a really old question, I no longer use Openshift. Thanks for your comment. – HGB Sep 22 '15 at 09:54
0

I could overcome same problem by generating rsa key on my own as root, in the terminal run: ssh-keygen. Asks for a passphrase, then it generates the keys. When done, open the public key at /root/.ssh/id_rsa.pub, copy its content and paste it in openshift panel under Settings -> Add new key... button. Then run rhc ssh appname and will ask for your passphrase and work

aesede
  • 5,541
  • 2
  • 35
  • 33