{"record":{"id":"46ff06e686990291","repo":"TencentCloud/TencentDB-Agent-Memory","slug":"instance-config-config-source-returned-empty-vdb","errorCode":null,"errorMessage":"[instance-config] Config source returned empty VDB config for instanceId=\"${instanceId}\" (url=${config?.url})","messagePattern":"\\[instance-config\\] Config source returned empty VDB config for instanceId=\"(.+?)\" \\(url=(.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"MemoryCore/src/core/instance-config-provider.ts","lineNumber":222,"sourceCode":"    } finally {\n      // 清理 in-flight 标记。注意要在 await 之后清理 (即使 fetch 抛错也清), \n      // 否则一次失败会让该 instanceId 永久卡住。\n      this.vdbFetchPromises.delete(instanceId);\n    }\n  }\n\n  /**\n   * 实际执行 source fetch + 写入 vdbPool。\n   * 仅由 resolveVdb 内部调用 (并发去重保证只跑一次)。\n   */\n  private async fetchAndStoreVdb(instanceId: string): Promise<VdbConfig> {\n    const config = await this.source.fetchVdb(instanceId);\n\n    // source 返回空 → 直接报错记录日志\n    if (!config || !config.url) {\n      const msg = `[instance-config] Config source returned empty VDB config for instanceId=\"${instanceId}\" (url=${config?.url})`;\n      this.logger.error(msg);\n      throw new Error(msg);\n    }\n\n    // LRU 淘汰\n    if (this.vdbPool.size >= this.maxInstances && !this.vdbPool.has(instanceId)) {\n      this.evictLru();\n    }\n\n    const now = Date.now();\n    this.vdbPool.set(instanceId, {\n      config,\n      expiresAt: now + this.vdbTtlMs,\n      lastAccessedAt: now,\n    });\n\n    return config;\n  }\n\n  /**","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/3efcd317b84146d6a08518ac0f7ee7c8a8d200ec/MemoryCore/src/core/instance-config-provider.ts#L204-L240","documentation":"InstanceConfigProvider.fetchAndStoreVdb fetches the vector-database config for an instance from its config source. When the source returns null/undefined or a config without a url, the provider logs the error and throws, because a VDB pool entry cannot be created without a connection URL.","triggerScenarios":"Calling fetchAndStoreVdb (via fetchPromise, i.e. get-or-load of a VDB for an instanceId) where this.source.fetchVdb(instanceId) resolves to undefined/null or an object lacking url.","commonSituations":"Instance not registered in the config source (control plane has no entry for that instanceId); config service down or returning empty payloads; instanceId typo; stale instance whose config was deleted; partial config written by provisioning pipeline missing the url field.","solutions":["Verify the instance exists in the config source and its VDB config includes a url (query the control plane/config service directly for that instanceId)","Check the config source connectivity (config service address, auth, network) — empty may mean a failed upstream call swallowed into an empty result","Confirm the instanceId being requested is correct (no truncation/typo)","If the instance is genuinely gone, stop requesting it / clean up stale references"],"exampleFix":"// before (server: no vdb entry provisioned)\ninstances: [\"a1\"] // no vdb section for a1\n// after\ninstances: [\"a1\"]\nvdb: { \"a1\": { url: \"http://vdb:19530\" } }","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"function hasVdbUrl(config) {\n  return config != null && typeof config.url === \"string\" && config.url.length > 0;\n}","tryCatchPattern":"try {\n  await provider.getVdb(instanceId);\n} catch (e) {\n  if (e.message.includes(\"empty VDB config\")) {\n    logger.error(`no VDB registered for ${instanceId}; check config source`);\n  }\n  throw e;\n}","preventionTips":["Provision the VDB config (with url) for every instance before its first request","Monitor the config source: empty fetches usually mean missing registration or control-plane outage","Validate instanceIds against the control plane before using them with this provider"],"tags":["configuration","network","vdb","instance"],"backgroundTag":"config-source-empty","analyzedSha":"3efcd317b84146d6a08518ac0f7ee7c8a8d200ec","analyzedAt":"2026-09-01T05:44:22.276Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}