{"record":{"id":"9a01be005bfc37c5","repo":"appsmithorg/appsmith","slug":"you-specified-type-in-your-env-but-the-file","errorCode":null,"errorMessage":"You specified ${type} in your env, but the file \"${file}\" can't be found.","messagePattern":"You specified (.+?) in your env, but the file \"(.+?)\" can't be found\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/client/config/getHttpsConfig.js","lineNumber":37,"sourceCode":"    );\n  }\n\n  try {\n    // privateDecrypt will throw an error with an invalid key\n    crypto.privateDecrypt(key, encrypted);\n  } catch (err) {\n    throw new Error(\n      `The certificate key \"${chalk.yellow(keyFile)}\" is invalid.\\n${\n        err.message\n      }`\n    );\n  }\n}\n\n// Read file and throw an error if it doesn't exist\nfunction readEnvFile(file, type) {\n  if (!fs.existsSync(file)) {\n    throw new Error(\n      `You specified ${chalk.cyan(\n        type\n      )} in your env, but the file \"${chalk.yellow(file)}\" can't be found.`\n    );\n  }\n  return fs.readFileSync(file);\n}\n\n// Get the https config\n// Return cert files if provided in env, otherwise just true or false\nfunction getHttpsConfig() {\n  const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;\n  const isHttps = HTTPS === 'true';\n\n  if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {\n    const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);\n    const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);\n    const config = {","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/client/config/getHttpsConfig.js#L19-L55","documentation":"Thrown by readEnvFile() in getHttpsConfig.js. After the caller resolves SSL_CRT_FILE / SSL_KEY_FILE from the environment, readEnvFile() checks fs.existsSync(file); if the path does not resolve to a real file it throws, naming the env var type and the missing path. This is the file-resolution gate before the cert/key content is ever parsed.","triggerScenarios":"HTTPS=true with SSL_CRT_FILE or SSL_KEY_FILE set to a path that does not exist on disk: a typo, a relative path resolved against the wrong cwd, a Docker bind-mount that did not mount the file, or a path from a different machine.","commonSituations":"Path with a leading '~/` that is not expanded; Docker volume mounted to the wrong container path; file created on host but not copied into the image; case-sensitivity mismatch on Linux vs macOS/Windows; env var pointing at a file deleted by a clean step.","solutions":["Confirm the file exists at exactly the resolved path: 'ls -l \"$SSL_CRT_FILE\" \"$SSL_KEY_FILE\"'.","Use absolute paths in SSL_CRT_FILE / SSL_KEY_FILE rather than '~' or relative paths.","In Docker, verify the bind-mount/copy lands the file at the configured path inside the container.","Check for case mismatches and trailing whitespace in the env var value."],"exampleFix":"# before\nSSL_CRT_FILE=~/certs/cert.pem  # '~' not expanded by node\n# -> You specified SSL_CRT_FILE in your env, but the file \"~/certs/cert.pem\" can't be found.\n\n# after\nSSL_CRT_FILE=/home/me/certs/cert.pem SSL_KEY_FILE=/home/me/certs/key.pem HTTPS=true npm start","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst { SSL_CRT_FILE, SSL_KEY_FILE } = process.env;\nfor (const f of [SSL_CRT_FILE, SSL_KEY_FILE].filter(Boolean)) {\n  if (!fs.existsSync(f)) throw new Error(`HTTPS file not found: ${f}`);\n}","typeGuard":null,"tryCatchPattern":"try { getHttpsConfig(); } catch (e) {\n  if (/can't be found/i.test(e.message)) { /* fix path */ }\n  else throw e;\n}","preventionTips":["Use absolute paths in SSL_CRT_FILE/SSL_KEY_FILE (Node does not expand '~').","Verify Docker bind-mounts land files at the configured in-container path.","Trim whitespace from env values to avoid path mismatches."],"tags":["https","tls","filesystem","dev-server","configuration"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}