Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to connect via an SSH tunnel: "An error occured while calling connect()." #78

Closed
smedinaw4l opened this issue May 14, 2013 · 17 comments

Comments

@smedinaw4l
Copy link

I'm on OSX 10.8.3 and I'm trying to connect to a remove server via an SSH tunnel with MongoHub 2.5.5[99] but I get the following error: "An error occured while calling connect()."

The DB is not in the remote server but in another one in the same internal network (therefore I put its IP address in the "Address" field).

Let me know if there is any more information I can provide.

@jeromelebel
Copy link
Owner

You have at least to provide the details of your connexion... (you can mask the ip)

@smedinaw4l
Copy link
Author

I just updated the issue, here is a screenshot anyway:

capture decran 2013-05-14 a 17 22 04

@smedinaw4l smedinaw4l reopened this May 14, 2013
@jeromelebel
Copy link
Owner

can you try from the computer where you run mongohub:
ping my_server
ssh my_user@my_server

does it work?

and can you try from my_server:
ping 10.x.x.x

does it work?

According to this setting, your mongo server is running on 10.x.x.x on port 27017. Is it correct?

@jeromelebel
Copy link
Owner

while doing the ssh command, it should not ask you for a password (since you didn't give any)

@smedinaw4l
Copy link
Author

Sure I can ping my_server from my local machine without problems.
In order to SSH to my_server I specify the SSH key:

ssh -i ~/.ssh/id_rsa_another_key my_user@my_server

and indeed I am not required to input a password.

From my_server I can surely ping 10.x.x.x and I can also connect via mongo:

my_user@my_server $ mongo 10.x.x.x:27017/my_db

@fedosov
Copy link

fedosov commented May 15, 2013

You pointed out one key path (~/.ssh/id_rsa) in the screenshot, but the other (~/.ssh/id_rsa_another_key) in the comments. This may not be the cause of the error?

@smedinaw4l
Copy link
Author

Yeah I'm sorry about that. The screenshot is of course not what I am really using, was just to show the fields that were filled. Then I realized that I should have changed the key to actually show that I am not using the typical default key "~/.ssh/id_rsa" but another key.

@jeromelebel
Copy link
Owner

Just to make sure, so MongoHub still doesn't work with ~/.ssh/id_rsa_another_key?

@jeromelebel
Copy link
Owner

the problem might be about the default mongo port. You didn't put any ports (27017). I think there is a bug about that. Try to put it, to see if it works better.

Also the ssh command is logged into the console, try to see if you see any other problems that by running it. It seems to work for me.

Let this bug opened until I fix it, so it works as it is expected to work

@jeromelebel
Copy link
Owner

Should be fixed with:
[master 4642c78] Bug fix when the mongo host port was left with the default value (while using ssh tunneling) #78
3 files changed, 19 insertions(+), 3 deletions(-)

I will do a build this week-end

@smedinaw4l
Copy link
Author

It does work when I input the port, great, thanks! :)

@jeromelebel
Copy link
Owner

Great! The ssh tunneling is very slow to connect in Mongohub. I always forget how painful it is (I don't use this feature). I think I found a way to make it a lot faster. As soon as I have the time to implement my fix, I will do a build, and you will be able to check the fix of this issue and close it.

@smedinaw4l
Copy link
Author

Sure, I'll check it then, just let me know.

@smedinaw4l
Copy link
Author

For info, I've just discovered that this same bug occurs also with the SSH port, i.e. if we leave the default (22) MongoHub tries to connect using port 0 (I checked in the console).
Do you want me to file another bug or this comment is enough?

@jeromelebel
Copy link
Owner

No that's ok. This related enough to this issue. Don't bother. I think I've tried yesterday with the ssh port also, I didn't have any problem. I will look again anyway (and even more if I solve the connexion delay, since I will redo a lot of the tunneling code).

@jeromelebel
Copy link
Owner

Fixed in 2.5.6(100). Please, verify and close this issue

@smedinaw4l
Copy link
Author

Works like a charm :) Closing the issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants