Forums

SSH Tunnelling - failed to connect "Cannot start SSH tunnel manager"

I had been using MySQL Workbench to connect with my PA database previously. Suddenly I can't connect and receive an error "Cannot start SSH tunnel manager". I can't figure out the problem, so I rechecked my configurations and noticed in my PA "Databases" tab my "Database host address" has changed from "mysql.server" to "leapfrog.mysql.pythonanywhere-services.com". I switched addresses, but that didn't work.

I can connect to localhost no problem and can also connect to PA via SSH command line.

Any ideas?

I just did a quick test and it seems to work OK for me. It is a bit slow though, could there be some kind of timeout at your end? How quickly to you get that "cannot start" error?

Also, could there be two tunnels active at the same time somehow, that are conflicting?

Now, connecting via SSH through the command line just hangs indefinitely. I'm now lost in the sea of SSH configurations. Can I just kill all connections and reenter my credentials into workbench?

In Workbench I'm receiving the error immediately. It seems there are open SSH connections locally, but I can't make sense of the output when I type who -a into the command line.

is it worth trying a reboot?

To clarify via the command line ssh leapfrog@pythonanywhere.com just hangs. While ssh -L 3306:mysql.server:3306 leapfrog@ssh.pythonanywhere.com displays "bind: Address already in use", but will still establish a connection. I rebooted, but the problem still persists.

Listing who -a once I'm logged in via command line will list I believe 8 connections and there ids.

Could there be an SSH daemon process on pythonanywhere that's holding the port open? Go to your consoles page and hit the "show process list" button, and kill everything?

When connection has been established from command line I will see a sshd and bash commands running on the consoles page. There are no other commands running and once I terminate the connection in the command line the listed commands will disappear.

I'm guessing this is user error and I need to figure out things on my end. But, I am still curious about the listings for who -a once the connection is established. Is this relevant?

Could you try again now? We've just updated the system, and part of that was a replacement of the SSH server you were previously connecting to with a new one. It would be interesting to see if that has fixed the problem.

The situation remains the same. I can connect via command line using `ssh -L 3306:mysql.server:3306 leapfrog@ssh.pythonanywhere.com' but I receive a prompt stating "bind: Address already in use".

I can only assume I messed with some dependencies which is causing the problem. If everything checks OK on your end I only see two options: 1) properly learn SSH configuration 2) reinstall OS, as I've been intending to do a fresh install anyways.

Ah, something just occurred to me -- did you install a local MySQL server recently? That would use port 3306 for itself and would cause problems like this.

Also -- if you're on Linux, you can see what's using the port by running this command:

lsof | grep LISTEN | grep 3306

Before the problem occurred I was running both localhost and PA connections. No connections are listed when I run the command you provided. I'm going to cut my losses and do a fresh OS install. I recently switched to Ubuntu and have been messing with system dependencies, so more than likely its user error. Thanks for your time!

No problem! Just let us know if the re-install doesn't help.

After a reinstall everything is now working properly =)

Excellent! Thanks for letting us know.

Hi there, just to make sure this link is out there, we have a specific help page on ssh tunnelling for remote mysql access now...