Coder Social home page Coder Social logo

Comments (21)

rathboma avatar rathboma commented on May 14, 2024 3

Yeah the tunneling code is a little flaky right now. Running queries through the tunnel isn't great.

I haven't spent much time on that code, but I'm prioritizing the connection bugs.

from beekeeper-studio.

rathboma avatar rathboma commented on May 14, 2024 2

Hey @chrisdlangton,

So sorry you're frustrated with the app :-(.

Beekeeper Studio is definitely early -- we only announce it on April 20th. SSH tunneling is something we adapted from an earlier library, and yes it is the most broken part of the product right now. I have some servers that I use for testing SSH, but not all combos of dbs and configs are covered. It's a bit of a cat and mouse game.

I'm trying to determine what folks are trying to use for their SSH connection configs. For example - private keys generated from putty have been causing issues, and because I don't have docs for SSH tunnels yet I've had to field several informal questions about private/public keys, hence me dropping PEM as a suggestion :-).

Follow up Questions

  • What version of MySQL are you using? (8?)
  • Are you also enabling SSL for your connection?
  • When you are tunneling, are you keeping the hostname the same, or changing it to locahost? eg:
host: localhost, port: 3306
sshhost: myserver.com

# OR:
host: myserver.com, port; 3306
sshhost: myserver.com

Thanks for your help

from beekeeper-studio.

ssuess avatar ssuess commented on May 14, 2024 1

Same issue here, trying to connect to MySQL. It connects (always on SECOND try btw, not first) and then shows no tables or dbs

from beekeeper-studio.

rathboma avatar rathboma commented on May 14, 2024 1

My next milestone is to revamp the SSH and SSL libraries. Sorry this isn't working right :-(

from beekeeper-studio.

ssuess avatar ssuess commented on May 14, 2024 1

This build seems to fix my connection and db listing problems. Thanks!

from beekeeper-studio.

chrisdlangton avatar chrisdlangton commented on May 14, 2024 1

Using MySQL getting;

Error while signing data with privateKey: error:06000066:public key routines:OPENSSL_internal:DECODE_ERROR

Works flawlessly without SSH tunnel. Also I can SSH fine outside beekeeper (including mysql-workbench)

from beekeeper-studio.

rathboma avatar rathboma commented on May 14, 2024 1

This is working in my latest build. I used the same docker-compose config as you, sshing onto a GCP box and then connecting to mysql on 172.x.x.x. \0/.

I have a few things to tidy up but my goal is to push out a new release this week with the fixes.

from beekeeper-studio.

rathboma avatar rathboma commented on May 14, 2024

interesting. Let me investigate.

from beekeeper-studio.

XzAeRo avatar XzAeRo commented on May 14, 2024

I just tried with a MariaDB server and happens the same. After switching between several databases, they tables did show up... Maybe a loading/latency issue?

from beekeeper-studio.

bradennapier avatar bradennapier commented on May 14, 2024

I can't even get tunneling to work at all? Just says it cant connect. Same config works flawless for SequelPro and SQLPro.. This is for MySQL connecting to Amazon RDS through a SSH tunnel.

from beekeeper-studio.

pdepip avatar pdepip commented on May 14, 2024

If I had to guess, I'd say a lot of these issues are stemming from things like not supporting jump hosts, which could be resolved by taking the users ssh config file into consideration?

from beekeeper-studio.

hxhlb avatar hxhlb commented on May 14, 2024

me too. @ssuess

from beekeeper-studio.

dufferzafar avatar dufferzafar commented on May 14, 2024

For me, the error is (SSH) Channel open failure: Connection refused while I'm able to connect using DBeaver just fine.

from beekeeper-studio.

rathboma avatar rathboma commented on May 14, 2024

Can you all test this build? https://github.com/beekeeper-studio/beekeeper-studio/actions/runs/106301681

You should be able to download the assets for your OS and install as usual

from beekeeper-studio.

rathboma avatar rathboma commented on May 14, 2024

What platform, key type are you using?

Eg windows, pem

from beekeeper-studio.

chrisdlangton avatar chrisdlangton commented on May 14, 2024

considering pem (a public key format) is never going to work... I am using a private key generated via defaults of ssh-keygen RSA2048SHA256

Ubuntu 20.04 uname -a;

Linux alteran 5.4.0-29-generic #33-Ubuntu SMP Wed Apr 29 14:32:27 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Installed clean from instructions after the issue #40 I raised with snap and you closed as being due to a snap restriction and i solved it by not using snap, so not really resolving the issue but closed anyway..

My conclusion is Beekeeper for Linux is a toy/alpha tool used for localhost and not ready for enterprise/production use - maybe other platforms, perhaps more familiar to the devs, work in real world scenarios.

from beekeeper-studio.

chrisdlangton avatar chrisdlangton commented on May 14, 2024

@rathboma
Didn't mean the critical feedback to appear as frustration, text is.. not the best.

To give the project benefit of doubt the key pair was generated fresh, and the public key was added to authorized_keys of a digital ocean docker droplet. My production use case is EC2 Amazon Linux 2 (centos) as a temporary/breakglass bastion to access RDS/Aurora.

I tried various databases so versions, but the isolated test on the droplet was a container image mysql:5.7@sha256:ba2eda1bf1249bd7e7160fa6c446d03b3261f75d3de91bc2125967d39db1525c specifically docker-compose.yaml;

version: '3.6'
x-defaults: &defaults
  restart: unless-stopped
  logging:
    options:
      max-size: "10m"
      max-file: "3"

  mysql:
    <<: *defaults
    image: mysql:5.7@sha256:ba2eda1bf1249bd7e7160fa6c446d03b3261f75d3de91bc2125967d39db1525c
    container_name: mysql
    volumes:
      - /mnt/volume_sgp1_02/mysql_data:/var/lib/mysql
    command: '--max_allowed_packet=65011712 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=1024 --skip-show-database --skip-grant-tables'
    expose:
      - 3306
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}

and the tunnel uses ssh config for simplicity;

Host do-docker
  HostName www.example.com
  User root
  IdentityFile /home/<user>/.ssh/id_rsa
  Compression yes
  ConnectionAttempts 3
  ConnectTimeout 5
  IdentitiesOnly yes

Replace host and user. Not using SSL for the isolated test (yet), but RDS/Aurora does.

The mysql IP address is usually a 172. in docker, you can find it via docker inspect <image name> for this isolated test, but with RDS/Aurora you use a DNS record in the tunnel connection configuration not an IP

from beekeeper-studio.

rathboma avatar rathboma commented on May 14, 2024

Ok, so just to be clear, looks like your set-up is:

  1. SSH tunnel to a droplet in digital ocean
  2. Accessing MySQL 5.7 running on the digital ocean droplet, accessing with the docker IP and port 3306

Quick Question:

You're using expose for the port. Can you double check that you can connect to the container using the mysql command line on your droplet?

I'd thought expose only exposes that port to other containers, and you had to map it to a host port to actually access it.

from beekeeper-studio.

chrisdlangton avatar chrisdlangton commented on May 14, 2024

Yes, happy to explain what expose does.
I had commented earlier that everything is working fine outside beekeeper, that includes the usual commands typed out as well as mysql workbench ssh tunnel connection (i'm looking at beekeeper studio because workbench is terribly buggy).

The expose directive is simply telling docker to allow communication on port 3306 from another container in the same docker network, meaning the port 3306 will not have a bind to the host interface (i.e. not a bind to 0.0.0.0:3306) and can only be accessed inside the host - thus the ssh tunnel. While it is designed to not bind to the host interface and only be exposed to other containers, there is a leak in a sense that if you know the correct docker network ip assigned to the container (usually a 172.x.x.x address on the host) then you can actually connect from inside the host, outside the docker network, but not from the host wan interface.

flow;
ssh > do.dns.record.co:22
docker inspect < ip address is 172.x.x.x
mysql -h 172.x.x.x -P 3306

Besides this Digital Ocean droplet isolated test, there is the EC2 > RDS which is technically a totally different setup but in terms of an ssh tunnel it is almost identical, just replace 172.x.x.x with the RDS dns record (after ensuring the EC2 host you ssh to can resolve that RDS dns record)

from beekeeper-studio.

rathboma avatar rathboma commented on May 14, 2024

Thanks, I'll test this today

from beekeeper-studio.

chrisdlangton avatar chrisdlangton commented on May 14, 2024

@rathboma amazing!
I'll do some testing when merged and deb built.
If you could tag the commit here when it is merged, I can debug anything i find in testing and maybe PR for you if i find anything, i noticed the other day it is mostly javascript so I should be trying to be directly useful on this project considering i know that language almost as well as i know English..

from beekeeper-studio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.