cube-js/cube · error · Error
Unable to find ${name} from path: "${value}"
Error message
Unable to find ${name} from path: "${value}" What it means
getSslOptions() resolves SSL config values that may be given either as inline PEM content or as a file path. When a value looks like a file path (isFilePath) but no file exists at that location, the driver throws this error rather than silently passing an unusable cert/key.
Source
Thrown at packages/cubejs-base-driver/src/BaseDriver.ts:254
}, {
name: 'servername',
envKey: keyByDataSource('CUBEJS_DB_SSL_SERVERNAME', dataSource),
}];
const ssl: TLSConnectionOptions = sslOptions.reduce(
(agg, { name, envKey, canBeFile, validate }) => {
const value = process.env[envKey];
if (value) {
if (validate && validate(value)) {
return {
...agg,
...{ [name]: value }
};
}
if (canBeFile && isFilePath(value)) {
if (!fs.existsSync(value)) {
throw new Error(
`Unable to find ${name} from path: "${value}"`,
);
}
const file = fs.readFileSync(value, 'utf8');
if (validate(file)) {
return {
...agg,
...{ [name]: file }
};
}
throw new Error(
`Content of the file from ${envKey} is not a valid SSL ${name}.`,
);
}
throw new Error(View on GitHub (pinned to 7d981676b3)
Solutions
- Verify the file exists at the exact path (check with ls/cat) and fix the path
- Mount the certificate/key files into the runtime environment (volume mount, secret)
- Pass the actual PEM content inline instead of a path
- Ensure the process working directory makes relative paths resolve correctly
Example fix
// before
ssl: { cert: '/etc/certs/server.pem' } // file missing
// after
ssl: { cert: fs.readFileSync('/etc/certs/server.pem', 'utf8') } // or fix path Defensive patterns
Strategy: validation
Validate before calling
const p = opts.cert;
if (isFilePath(p) && !fs.existsSync(p)) throw new Error(`SSL cert path not found: ${p}`); Type guard
const isFilePath = (v: string) => /\.(pem|crt|cer|key|jks|p12|der)$/.test(v) || v.startsWith('/'); Prevention
- Mount cert files into containers and verify at startup
- Use absolute paths for SSL files
- Fail fast with a health check that reads each SSL file
- Prefer inline PEM via secrets managers when path mounting is risky
When it happens
Trigger: Setting an SSL env var or option (e.g. ssl_cert) to a path string like '/etc/ssl/cert.pem' where the file does not exist on disk.
Common situations: Typos in cert paths, certs not mounted into containers/K8s pods, running locally without the mounted secret, or relative paths resolved from an unexpected working directory.
Related errors
- Unable to find package.json file in current working director
- The ${keyByDataSource('CUBEJS_DB_SSL', dataSource)} must be
- The ${keyByDataSource('CUBEJS_DB_SSL_REJECT_UNAUTHORIZED', d
- Content of the file from ${envKey} is not a valid SSL ${name
- ${envKey} is not a valid SSL ${name}. If it's a path, please
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/64cd1afb76a5707d.
Report an issue: GitHub.