Skip to content

Commit

Permalink
Follow-up fix for SSHExceptions (#18383)
Browse files Browse the repository at this point in the history
* Follow-up fix for SSHExceptions

* Catch RuntimeException instead of augmenting connection error messaging for now

* Update tests

* Bump versions + docs

* auto-bump connector version

* auto-bump connector version

* auto-bump connector version

Co-authored-by: Octavia Squidington III <[email protected]>
  • Loading branch information
akashkulk and octavia-squidington-iii authored Oct 25, 2022
1 parent 30a8d17 commit b0a8e54
Show file tree
Hide file tree
Showing 15 changed files with 254 additions and 247 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@
- name: Microsoft SQL Server (MSSQL)
sourceDefinitionId: b5ea17b1-f170-46dc-bc31-cc744ca984c1
dockerRepository: airbyte/source-mssql
dockerImageTag: 0.4.23
dockerImageTag: 0.4.24
documentationUrl: https://docs.airbyte.com/integrations/sources/mssql
icon: mssql.svg
sourceType: database
Expand Down Expand Up @@ -706,7 +706,7 @@
- name: MySQL
sourceDefinitionId: 435bb9a5-7887-4809-aa58-28c27df0d7ad
dockerRepository: airbyte/source-mysql
dockerImageTag: 1.0.7
dockerImageTag: 1.0.8
documentationUrl: https://docs.airbyte.com/integrations/sources/mysql
icon: mysql.svg
sourceType: database
Expand Down Expand Up @@ -864,7 +864,7 @@
- name: Postgres
sourceDefinitionId: decd338e-5647-4c0b-adf4-da0e75f5a750
dockerRepository: airbyte/source-postgres
dockerImageTag: 1.0.19
dockerImageTag: 1.0.20
documentationUrl: https://docs.airbyte.com/integrations/sources/postgres
icon: postgresql.svg
sourceType: database
Expand Down
6 changes: 3 additions & 3 deletions airbyte-config/init/src/main/resources/seed/source_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6330,7 +6330,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-mssql:0.4.23"
- dockerImage: "airbyte/source-mssql:0.4.24"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/destinations/mssql"
connectionSpecification:
Expand Down Expand Up @@ -7160,7 +7160,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-mysql:1.0.7"
- dockerImage: "airbyte/source-mysql:1.0.8"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/mysql"
connectionSpecification:
Expand Down Expand Up @@ -8792,7 +8792,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-postgres:1.0.19"
- dockerImage: "airbyte/source-postgres:1.0.20"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/postgres"
connectionSpecification:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public void close() {
* @see <a href=
* "https://javadoc.io/static/org.apache.sshd/sshd-common/2.8.0/org/apache/sshd/common/config/keys/loader/KeyPairResourceLoader.html#loadKeyPairs-org.apache.sshd.common.session.SessionContext-org.apache.sshd.common.util.io.resource.IoResource-org.apache.sshd.common.config.keys.FilePasswordProvider-">loadKeyPairs()</a>
*/
KeyPair getPrivateKeyPair() throws IOException, GeneralSecurityException, ConnectionErrorException {
KeyPair getPrivateKeyPair() throws IOException, GeneralSecurityException {
final String validatedKey = validateKey();
final var keyPairs = SecurityUtils
.getKeyPairResourceParser()
Expand All @@ -312,7 +312,7 @@ KeyPair getPrivateKeyPair() throws IOException, GeneralSecurityException, Connec
if (keyPairs != null && keyPairs.iterator().hasNext()) {
return keyPairs.iterator().next();
}
throw new ConnectionErrorException("Unable to load private key pairs, verify key pairs are properly inputted");
throw new RuntimeException("Unable to load private key pairs, verify key pairs are properly inputted");
}

private String validateKey() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public AirbyteConnectionStatus check(final JsonNode config) throws Exception {
try {
return (endPointKey != null) ? SshTunnel.sshWrap(config, endPointKey, delegate::check)
: SshTunnel.sshWrap(config, hostKey, portKey, delegate::check);
} catch (final SshException | ConnectionErrorException e) {
} catch (final RuntimeException e) {
final String sshErrorMessage = "Could not connect with provided SSH configuration. Error: " + e.getMessage();
AirbyteTraceMessageUtility.emitConfigErrorTrace(e, sshErrorMessage);
return new AirbyteConnectionStatus()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public ConnectorSpecification spec() throws Exception {
public AirbyteConnectionStatus check(final JsonNode config) throws Exception {
try {
return SshTunnel.sshWrap(config, hostKey, portKey, delegate::check);
} catch (final SshException | ConnectionErrorException e) {
} catch (final RuntimeException e) {
final String sshErrorMessage = "Could not connect with provided SSH configuration. Error: " + e.getMessage();
AirbyteTraceMessageUtility.emitConfigErrorTrace(e, sshErrorMessage);
return new AirbyteConnectionStatus()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ ENV APPLICATION source-mssql-strict-encrypt

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=0.4.23
LABEL io.airbyte.version=0.4.24
LABEL io.airbyte.name=airbyte/source-mssql-strict-encrypt
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-mssql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ ENV APPLICATION source-mssql

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=0.4.23
LABEL io.airbyte.version=0.4.24
LABEL io.airbyte.name=airbyte/source-mssql
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ ENV APPLICATION source-mysql-strict-encrypt

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=1.0.7
LABEL io.airbyte.version=1.0.8

LABEL io.airbyte.name=airbyte/source-mysql-strict-encrypt
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ void testStrictSSLSecuredWithTunnel() throws Exception {
.putIfAbsent(JdbcUtils.SSL_MODE_KEY, Jsons.jsonNode(sslMode));
((ObjectNode) config).putIfAbsent("tunnel_method", Jsons.jsonNode(tunnelMode));

final Exception exception = assertThrows(NullPointerException.class, () -> source.check(config));
final AirbyteConnectionStatus actual = source.check(config);
assertEquals(Status.FAILED, actual.getStatus());
assertTrue(actual.getMessage().contains("Could not connect with provided SSH configuration."));
}

@Test
Expand All @@ -322,7 +324,9 @@ void testStrictSSLUnsecuredWithTunnel() throws Exception {
.putIfAbsent(JdbcUtils.SSL_MODE_KEY, Jsons.jsonNode(sslMode));
((ObjectNode) config).putIfAbsent("tunnel_method", Jsons.jsonNode(tunnelMode));

final Exception exception = assertThrows(NullPointerException.class, () -> source.check(config));
final AirbyteConnectionStatus actual = source.check(config);
assertEquals(Status.FAILED, actual.getStatus());
assertTrue(actual.getMessage().contains("Could not connect with provided SSH configuration."));
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ ENV APPLICATION source-mysql

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=1.0.7
LABEL io.airbyte.version=1.0.8

LABEL io.airbyte.name=airbyte/source-mysql
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ ENV APPLICATION source-postgres-strict-encrypt

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=1.0.19
LABEL io.airbyte.version=1.0.20
LABEL io.airbyte.name=airbyte/source-postgres-strict-encrypt
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-postgres/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ ENV APPLICATION source-postgres

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=1.0.19
LABEL io.airbyte.version=1.0.20
LABEL io.airbyte.name=airbyte/source-postgres
Loading

0 comments on commit b0a8e54

Please sign in to comment.