{"record":{"id":"7ec089021752a112","repo":"Mintplex-Labs/anything-llm","slug":"qdrant-invalid-env-settings","errorCode":null,"errorMessage":"QDrant::Invalid ENV settings","messagePattern":"QDrant::Invalid ENV settings","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/utils/vectorDbProviders/qdrant/index.js","lineNumber":21,"sourceCode":"const { SystemSettings } = require(\"../../../models/systemSettings\");\nconst { storeVectorResult, cachedVectorInformation } = require(\"../../files\");\nconst { v4: uuidv4 } = require(\"uuid\");\nconst { toChunks, getEmbeddingEngineSelection } = require(\"../../helpers\");\nconst { sourceIdentifier } = require(\"../../chats\");\nconst { VectorDatabase } = require(\"../base\");\n\nclass QDrant extends VectorDatabase {\n  constructor() {\n    super();\n  }\n\n  get name() {\n    return \"QDrant\";\n  }\n\n  async connect() {\n    if (process.env.VECTOR_DB !== \"qdrant\")\n      throw new Error(\"QDrant::Invalid ENV settings\");\n\n    const client = new QdrantClient({\n      url: process.env.QDRANT_ENDPOINT,\n      ...(process.env.QDRANT_API_KEY\n        ? { apiKey: process.env.QDRANT_API_KEY }\n        : {}),\n    });\n\n    const isAlive = (await client.api(\"cluster\")?.clusterStatus())?.ok || false;\n    if (!isAlive)\n      throw new Error(\n        \"QDrant::Invalid Heartbeat received - is the instance online?\"\n      );\n\n    return { client };\n  }\n\n  async heartbeat() {","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/vectorDbProviders/qdrant/index.js#L3-L39","documentation":"Environment guard at the top of QDrant.connect(): the vector DB client was constructed while process.env.VECTOR_DB is not 'qdrant', i.e. the QDrant provider code ran under a mismatched VECTOR_DB setting and refuses to connect to avoid using the wrong database.","triggerScenarios":"QDrant was selected as the vector database but its environment settings are missing or invalid.","commonSituations":"This error is raised at runtime in server/utils/vectorDbProviders/qdrant/index.js. It occurs when the required configuration for this provider is missing or invalid (unset environment variables, empty API key or base path), when the external service is unreachable or returns an unexpected response, or when invalid input reaches the call site. To prevent it, validate the relevant provider settings and environment variables at startup and confirm the service is reachable before this code path executes.","solutions":["Set the QDRANT_API_ENDPOINT and QDRANT_API_KEY environment variables."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}