{"record":{"id":"3bae477508e039c5","repo":"Mintplex-Labs/anything-llm","slug":"no-lemonade-image-generation-base-path-was-set","errorCode":null,"errorMessage":"No Lemonade image generation base path was set.","messagePattern":"No Lemonade image generation base path was set\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/utils/ImageGenerators/lemonade/index.js","lineNumber":7,"sourceCode":"const { parseLemonadeServerEndpoint } = require(\"../../AiProviders/lemonade\");\nconst { BaseImageGenerator } = require(\"../base\");\n\nclass LemonadeImageGenerator extends BaseImageGenerator {\n  constructor() {\n    if (!process.env.IMAGE_GEN_LEMONADE_BASE_PATH)\n      throw new Error(\"No Lemonade image generation base path was set.\");\n    if (!process.env.IMAGE_GEN_MODEL_PREF)\n      throw new Error(\"No Lemonade image generation model was set.\");\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    super({\n      client: new OpenAIApi({\n        baseURL: parseLemonadeServerEndpoint(\n          process.env.IMAGE_GEN_LEMONADE_BASE_PATH,\n          \"openai\"\n        ),\n        apiKey: process.env.IMAGE_GEN_LEMONADE_API_KEY || null,\n      }),\n      model: process.env.IMAGE_GEN_MODEL_PREF,\n      className: \"LemonadeImageGenerator\",\n    });\n  }\n}\n\nmodule.exports = { LemonadeImageGenerator };","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/ImageGenerators/lemonade/index.js#L1-L25","documentation":"Thrown synchronously in the LemonadeImageGenerator constructor before building the OpenAI client. IMAGE_GEN_LEMONADE_BASE_PATH is required because parseLemonadeServerEndpoint needs it to derive the OpenAI-compatible baseURL. It is a hard config precondition: without a base path there is no endpoint to talk to.","triggerScenarios":"Instantiating new LemonadeImageGenerator() (selecting Lemonade as the image provider) when process.env.IMAGE_GEN_LEMONADE_BASE_PATH is unset or empty.","commonSituations":"Selecting Lemonade as the image-generation engine without configuring its server address; .env missing the variable after a provider switch; running in a container without passing the env var; typo in the variable name (e.g. LEMONADE_BASE_PATH).","solutions":["Set IMAGE_GEN_LEMONADE_BASE_PATH to your Lemonade server URL (e.g. http://localhost:8000) in .env.","Restart the server after setting the variable.","If containerized, pass the variable via -e IMAGE_GEN_LEMONADE_BASE_PATH=... or compose env_file.","Use the exact variable name IMAGE_GEN_LEMONADE_BASE_PATH."],"exampleFix":"# before\nIMAGE_GEN_PROVIDER=lemonade\n# (no base path)\n\n# after\nIMAGE_GEN_PROVIDER=lemonade\nIMAGE_GEN_LEMONADE_BASE_PATH=http://localhost:8000","handlingStrategy":"validation","validationCode":"function hasLemonadeBasePath() {\n  return typeof process.env.IMAGE_GEN_LEMONADE_BASE_PATH === 'string'\n    && process.env.IMAGE_GEN_LEMONADE_BASE_PATH.trim().length > 0;\n}\nif (!hasLemonadeBasePath()) {\n  throw new Error('Set IMAGE_GEN_LEMONADE_BASE_PATH before using Lemonade image generation.');\n}","typeGuard":"function isLemonadeConfigured() {\n  return !!process.env.IMAGE_GEN_LEMONADE_BASE_PATH && process.env.IMAGE_GEN_LEMONADE_BASE_PATH.trim().length > 0;\n}","tryCatchPattern":"let generator;\ntry {\n  generator = new LemonadeImageGenerator();\n} catch (e) {\n  if (/No Lemonade image generation base path/.test(e.message)) {\n    throw new Error('Configure IMAGE_GEN_LEMONADE_BASE_PATH in .env and restart.');\n  }\n  throw e;\n}","preventionTips":["Run a startup config validator that checks all IMAGE_GEN_* vars for the selected provider.","Use the exact variable name IMAGE_GEN_LEMONADE_BASE_PATH.","Pass the variable through to containers explicitly.","Restart the server after changing .env."],"tags":["lemonade","image-generation","configuration","missing-env","constructor"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}