Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-888

Fails SSH Tunneling

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 2.7.3
    • N/A
    • protocol
    • None
    • Amazon Aurora MySQL-compatible
      OpenSSH_8.1p1, LibreSSL 2.7.3

    Description

      Steps to reproduce:

      1) Open a ssh tunnel through a jump (bastion) server. For example:

      $ ssh -NL 9000:something.something.eu-central-1.rds.amazonaws.com:3306 bastion

      2) Open a JDBC Connection with DriverManager and a url of the form: jdbc:mysql://localhost:9000/mydatabase

      You end up with an exception:

      Exception in thread "main" java.lang.RuntimeException: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=localhost)(port=9000)(type=master) : (conn=98) could not load system variables
              at de.e2n.Main.connectToDatabase(Main.java:140)
              at de.e2n.Main.run(Main.java:52)
              at de.e2n.Main.main(Main.java:165)
      Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=localhost)(port=9000)(type=master) : (conn=98) could not load system variables
              at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
              at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:194)
              at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1394)
              at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:635)
              at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:150)
              at org.mariadb.jdbc.Driver.connect(Driver.java:89)
              at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
              at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
              at de.e2n.Main.connectToDatabase(Main.java:138)
              ... 2 more
      Caused by: java.sql.SQLNonTransientConnectionException: (conn=98) could not load system variables
              at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
              at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:185)
              at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.requestSessionDataWithShow(AbstractConnectProtocol.java:1114)
              at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.readPipelineAdditionalData(AbstractConnectProtocol.java:1075)
              at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.postConnectionQueries(AbstractConnectProtocol.java:882)
              at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.createConnection(AbstractConnectProtocol.java:597)
              at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1389)
              ... 8 more
      Caused by: java.sql.SQLNonTransientConnectionException: (conn=98) Connection is closed
              at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
              at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:189)
              at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.cmdPrologue(AbstractQueryProtocol.java:1945)
              at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:249)
              at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.requestSessionDataWithShow(AbstractConnectProtocol.java:1089)
              ... 12 more
      

      This works if we use mysql-connector-java-5.1.46.jar.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            raupach Björn Raupach
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.