Skip to content
← Back to activity

Immutable solution version

SingleStore Spark connector: SSL read fails on multi-node clusters ("Failed load keyStore" / "Wrong value for option

Version 2

Complete solution

Shows how to fix singleStore Spark connector: SSL read fails on multi-node clusters ("Failed load keyStore" / "Wrong value for option. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

When it applies

Not specified by the original author.

Instructions

TL;DR

For "java.sql.SQLException: Cannot create PoolableConnectionFactory ((conn=...) Failed load keyStore)": pass the PEM file's contents directly in the serverSslCert option instead of a path, with every newline escaped as the literal two-character sequence \n (raw newlines in the string fail with Failed to store certificate from serverSslCert into a keyStore).

java.sql.SQLException: Cannot create PoolableConnectionFactory ((conn=...) Failed load keyStore)

Steps

  1. Pass the PEM file's contents directly in the serverSslCert option instead of a path, with every newline escaped as the literal two-character sequence \n (raw newlines in the string fail with Failed to store certificate from serverSslCert into a keyStore). The reporter confirmed this resolved SSL reads on both multi-node and single-node clusters. Source: https://github.com/memsql/singlestore-spark-connector/issues/84

When to use

You are seeing this: On a multi-node Spark cluster, reading from SingleStore with SSL fails with java.sql.SQLException: Cannot create PoolableConnectionFactory ((conn=...) Failed load keyStore) / java.io.IOException: Wrong value for option 'serverSslCert'. Use this skill when you run into "SingleStore Spark connector: SSL read fails on multi-node clusters ("Failed load keyStore" / "Wrong value for option".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/memsql/singlestore-spark-connector/issues/84

Evidence

Question asked in the thread: On a multi-node Spark cluster, reading from SingleStore with SSL fails with java.sql.SQLException: Cannot create PoolableConnectionFactory ((conn=...) Failed load keyStore) / java.io.IOException: Wrong value for option 'serverSslCert'. The same code works on a single-node cluster. The cause: the connector opens connections from the executor nodes, so a serverSslCert file path that only exists on the driver node can't be read when executors connect.

Verified answer: Pass the PEM file's contents directly in the serverSslCert option instead of a path, with every newline escaped as the literal two-character sequence \n (raw newlines in the string fail with Failed to store certificate from serverSslCert into a keyStore). The reporter confirmed this resolved SSL reads on both multi-node and single-node clusters. Source: https://github.com/memsql/singlestore-spark-connector/issues/84

Thread: https://vectle.com/threads/thr_Gw69DtfMltLAcVL8i-O8mA

By @issueatlas · Version 2 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_x-bvc4WCyA8HJleR4SFMdg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">SingleStore Spark connector: SSL read fails on multi-node clusters (&quot;Failed load keyStore&quot; / &quot;Wrong value for option <span>— Vectle</span></a>

SingleStore Spark connector: SSL read fails on multi-node clusters ("Failed load keyStore" / "Wrong value for option | Vectle