{"record":{"id":"b591d3c09db9465f","repo":"danny-avila/LibreChat","slug":"no-endpoint-provided","errorCode":null,"errorMessage":"No endpoint provided","messagePattern":"No endpoint provided","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"api/server/services/Files/process.js","lineNumber":1337,"sourceCode":"function filterFile({ req, image, isAvatar }) {\n  const { file } = req;\n  const { endpoint, endpointType, file_id, width, height } = req.body;\n\n  if (!file_id && !isAvatar) {\n    throw new Error('No file_id provided');\n  }\n\n  if (file.size === 0) {\n    throw new Error('Empty file uploaded');\n  }\n\n  /* parse to validate api call, throws error on fail */\n  if (!isAvatar) {\n    isUUID.parse(file_id);\n  }\n\n  if (!endpoint && !isAvatar) {\n    throw new Error('No endpoint provided');\n  }\n\n  const appConfig = req.config;\n  const fileConfig = mergeFileConfig(appConfig.fileConfig);\n\n  const endpointFileConfig = getEndpointFileConfig({\n    endpoint,\n    fileConfig,\n    endpointType,\n  });\n  const fileSizeLimit =\n    isAvatar === true ? fileConfig.avatarSizeLimit : endpointFileConfig.fileSizeLimit;\n\n  if (file.size > fileSizeLimit) {\n    throw new Error(\n      `File size limit of ${fileSizeLimit / megabyte} MB exceeded for ${\n        isAvatar ? 'avatar upload' : `${endpoint} endpoint`\n      }`,","sourceCodeStart":1319,"sourceCodeEnd":1355,"githubUrl":"https://github.com/danny-avila/LibreChat/blob/5ff282f9006c436e561de1afd39a481bea1ef0d8/api/server/services/Files/process.js#L1319-L1355","documentation":"filterFile() throws this at process.js:1336 when endpoint is missing from req.body on a non-avatar upload. The endpoint field (e.g. 'openAI', 'azureOpenAI', 'assistants') drives which endpointFileConfig is selected for size/type limits via getEndpointFileConfig. Without it the service cannot choose the correct policy, so it refuses the upload.","triggerScenarios":"POST /api/files or POST /api/files/images whose body omits endpoint, or sends it under endpointType only. The check fires after file_id and UUID validation pass, so you only reach it for otherwise well-formed payloads.","commonSituations":"Client refactored to send only the model name and dropped the endpoint field. A new endpoint value that the client derives at runtime but fails to set on a particular screen. Avatar uploads are exempt, so misclassifying a non-avatar call as an avatar call also surfaces this elsewhere.","solutions":["Include endpoint in the upload body, set to the active conversation endpoint key.","Verify the value matches an endpoint registered in your librechat.yaml / fileConfig endpoints.","If you intended an avatar upload, ensure isAvatar semantics are used via the /files/avatar route, not /files."],"exampleFix":"// before\nform.append('file_id', id);\n// after\nform.append('file_id', id);\nform.append('endpoint', currentEndpoint); // e.g. 'openAI'","handlingStrategy":"validation","validationCode":"const VALID_ENDPOINTS = ['openAI','azureOpenAI','bingAI','chatGPTBrowser','anthropic','google','assistants','gptPlugins'];\nfunction assertEndpoint(body) {\n  if (!VALID_ENDPOINTS.includes(body.endpoint)) {\n    throw new Error(`endpoint missing or unknown: ${body.endpoint}`);\n  }\n}","typeGuard":"const hasEndpoint = (body) => typeof body?.endpoint === 'string' && body.endpoint.length > 0;","tryCatchPattern":null,"preventionTips":["Derive endpoint from the active conversation and attach it in the same helper that sets file_id.","Keep a single source of truth for endpoint keys shared between client and server."],"tags":["files","validation","api","config"],"backgroundTag":null,"analyzedSha":"5ff282f9006c436e561de1afd39a481bea1ef0d8","analyzedAt":"2026-08-12T21:38:08.145Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}