{"record":{"id":"c0c9e1f41d542a58","repo":"mastra-ai/mastra","slug":"vector-store-vectorname-not-found","errorCode":null,"errorMessage":"Vector store ${vectorName} not found","messagePattern":"Vector store (.+?) not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"packages/server/src/server/handlers/vector.ts","lineNumber":56,"sourceCode":"  metric?: 'cosine' | 'euclidean' | 'dotproduct';\n}\n\ninterface QueryRequest {\n  indexName: string;\n  queryVector: number[];\n  topK?: number;\n  filter?: Record<string, any>;\n  includeVector?: boolean;\n}\n\nfunction getVector(mastra: Context['mastra'], vectorName?: string): MastraVector {\n  if (!vectorName) {\n    throw new HTTPException(400, { message: 'Vector name is required' });\n  }\n\n  const vector = mastra.getVector(vectorName);\n  if (!vector) {\n    throw new HTTPException(404, { message: `Vector store ${vectorName} not found` });\n  }\n\n  return vector;\n}\n\n// Upsert vectors\nexport async function upsertVectors({\n  mastra,\n  vectorName,\n  indexName,\n  vectors,\n  metadata,\n  ids,\n}: VectorContext & UpsertRequest) {\n  try {\n    if (!indexName || !vectors || !Array.isArray(vectors)) {\n      throw new HTTPException(400, { message: 'Invalid request index. indexName and vectors array are required.' });\n    }","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/vector.ts#L38-L74","documentation":"HTTP 404 thrown by getVector: a vectorName was provided but mastra.getVector(vectorName) returned undefined — no vector store with that name is registered on the Mastra instance.","triggerScenarios":"Any vector route call with a vectorName not present in the server's Mastra configuration (typo, vector not registered, wrong server/environment).","commonSituations":"Local dev registered the vector but the deployed instance did not; renamed the vector in mastra config without updating clients; casing mismatches; environment variable gates skipping vector registration.","solutions":["Register the vector store on the Mastra instance: new Mastra({ vectors: { 'my-store': new PgVector(...) } }).","Fix the vectorName to match the registered key exactly (check casing/spelling).","Verify the target server/environment has the vector plugin/config deployed."],"exampleFix":"// before\nconst mastra = new Mastra({ agents: { ... } }); // no vectors\n// after\nconst mastra = new Mastra({ agents: { ... }, vectors: { 'my-store': new PgVector(process.env.DATABASE_URL) } });","handlingStrategy":"try-catch","validationCode":"const res = await fetch('/api/vectors').then(r => r.json());\nconst names = res.map(v => v.name);\nif (!names.includes(vectorName)) throw new Error(`Vector '${vectorName}' not registered. Available: ${names.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  return await vectorQuery(vectorName, params);\n} catch (e) {\n  if (isHttpException(e, 404) && e.message.includes('not found')) {\n    console.error(`Vector store '${vectorName}' not registered on this Mastra instance. Check mastra config vectors map.`);\n  }\n  throw e;\n}","preventionTips":["Keep vector registration keys in a shared constant used by both server config and clients.","Verify deployed environments register the same vectors as local dev.","List available vectors via the API before querying when debugging."],"tags":["http-404","not-found","vector","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}