cube-js/cube · warning
Unable to resolve file "${value}" from ${key}
Error message
Unable to resolve file "${value}" from ${key} What it means
Cube reads certain env vars (e.g. CUBEJS_DB_KEY_PATH, SSL cert vars) as paths to files whose contents should be inlined. When the env var is listed as a file-resolvable key, looks like a path, but no file exists at that path, Cube logs this warning, clears the value, and continues with an empty string instead of the file content.
Source
Thrown at packages/cubejs-backend-cloud/src/config.ts:64
const env = dotenv.config({ path: envFile, multiline: 'line-breaks' }).parsed;
if (env) {
if ('CUBEJS_DEV_MODE' in env) {
delete env.CUBEJS_DEV_MODE;
}
const resolvePossibleFiles = [
'CUBEJS_DB_SSL_CA',
'CUBEJS_DB_SSL_CERT',
'CUBEJS_DB_SSL_KEY',
];
// eslint-disable-next-line no-restricted-syntax
for (const [key, value] of Object.entries(env)) {
if (resolvePossibleFiles.includes(key) && isFilePath(value)) {
if (fs.existsSync(value)) {
env[key] = fs.readFileSync(value, 'ascii');
} else {
console.warn(`Unable to resolve file "${value}" from ${key}`);
env[key] = '';
}
}
}
return env;
}
}
return {};
}
public async addAuthToken(authToken: string, config?: Configuration): Promise<ConfigurationFull> {
if (!config) {
config = await this.loadConfig();
}
View on GitHub (pinned to 7d981676b3)
Solutions
- Create/mount the file at the exact path given in the env var and restart Cube
- Use an absolute path in the env var to avoid relative-path resolution issues
- If the value is actual inline content, move it out of the file-resolvable env var keys (or change the key so it is not treated as a path)
- Verify the volume/secret is mounted in the container before the Cube process starts
Example fix
// before CUBEJS_DB_KEY=/secrets/db.key (file not mounted) // after CUBEJS_DB_KEY=/etc/cube/secrets/db.key (mount: k8s secret at /etc/cube/secrets/)
Defensive patterns
Strategy: validation
Validate before calling
const p = process.env.CUBEJS_DB_KEY;
if (p && !fs.existsSync(p)) {
throw new Error(`File for CUBEJS_DB_KEY does not exist: ${p}`);
} Type guard
function isFilePath(v: unknown): v is string {
return typeof v === 'string' && (v.startsWith('/') || v.startsWith('./'));
} Prevention
- Mount secret files before the app starts (init containers/entrypoint order)
- Use absolute paths for file-like env vars
- Validate required files exist in a startup health check
- Keep inline secrets and file-path secrets in distinct env vars
When it happens
Trigger: An env var such as CUBEJS_DB_KEY or CUBEJS_DB_CERT is set to a file path; fs.existsSync(path) returns false at startup, so the warn branch in envFile fires.
Common situations: Container images where the secret/cert file was not mounted or was mounted at a different path; typos in the path; working directory differences making relative paths invalid; Kubernetes secrets not mounted before Cube starts.
Related errors
- Unable to find ${name} from path: "${value}"
- The ${keyByDataSource('CUBEJS_DB_SCHEMA', dataSource)} is de
- The ${keyByDataSource('CUBEJS_DATABASE', dataSource)} is dep
- The CUBEJS_DB_CATALOG is deprecated. Please, use the CUBEJS_
- Native api gateway is not enabled
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/36eb7ba1d9f2bdb8.
Report an issue: GitHub.