{"record":{"id":"1ee9396ece6068ce","repo":"microsoft/aspire","slug":"a-qdrantclient-could-not-be-configured-ensure-valid","errorCode":null,"errorMessage":"A QdrantClient could not be configured. Ensure valid connection information was provided in 'ConnectionStrings:{connectionName}' or either {nameof(settings.Endpoint)} must be provided in the '{DefaultConfigSectionName}' or '{DefaultConfigSectionName}:{connectionName}' configuration section.","messagePattern":"A QdrantClient could not be configured\\. Ensure valid connection information was provided in 'ConnectionStrings:(.+?)' or either (.+?) must be provided in the '(.+?)' or '(.+?):(.+?)' configuration section\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Aspire.Qdrant.Client/AspireQdrantExtensions.cs","lineNumber":109,"sourceCode":"                healthCheckName,\n                sp => new QdrantHealthCheck(serviceKey is null ?\n                    sp.GetRequiredService<QdrantClient>() :\n                    sp.GetRequiredKeyedService<QdrantClient>(serviceKey)),\n                failureStatus: null,\n                tags: null,\n                timeout: settings.HealthCheckTimeout\n                ));\n        }\n\n        QdrantClient ConfigureQdrant(IServiceProvider serviceProvider)\n        {\n            if (settings.Endpoint is not null)\n            {\n                return new QdrantClient(settings.Endpoint, apiKey: settings.Key, loggerFactory: serviceProvider.GetRequiredService<ILoggerFactory>());\n            }\n            else\n            {\n                throw new InvalidOperationException(\n                        $\"A QdrantClient could not be configured. Ensure valid connection information was provided in 'ConnectionStrings:{connectionName}' or either \" +\n                        $\"{nameof(settings.Endpoint)} must be provided \" +\n                        $\"in the '{DefaultConfigSectionName}' or '{DefaultConfigSectionName}:{connectionName}' configuration section.\");\n            }\n        }\n    }\n}\n","sourceCodeStart":91,"sourceCodeEnd":117,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Components/Aspire.Qdrant.Client/AspireQdrantExtensions.cs#L91-L117","documentation":"Aspire builds a QdrantClient either from a connection string or from an explicit Endpoint in configuration. When neither the 'ConnectionStrings:{name}' entry nor the settings' Endpoint property yields a usable endpoint, the client factory throws because there is no way to reach the Qdrant server.","triggerScenarios":"Calling AddQdrantClient/AddKeyedQdrantClient with a connection name whose 'ConnectionStrings:{name}' value cannot be parsed into an endpoint (missing key, malformed URI) and no Endpoint configured under 'Aspire:Qdrant:Client' or 'Aspire:Qdrant:Client:{name}'.","commonSituations":"Running locally without the Aspire AppHost (no connection string injected), appsettings in another environment lacking the ConnectionStrings entry, typo in the connection name, using a plain host:port string where a URI is expected.","solutions":["Add a valid connection string: ConnectionStrings:qdrant = http://localhost:6334 (gRPC/HTTP endpoint URI).","Set the Endpoint in configuration under 'Aspire:Qdrant:Client' or 'Aspire:Qdrant:Client:{connectionName}'.","Run through the Aspire AppHost (or WithReference(qdrant)) so the connection string is injected automatically.","Verify the connection name passed to AddQdrantClient matches the configuration key exactly (case-insensitive but must exist)."],"exampleFix":"// before\nbuilder.AddQdrantClient(\"qdrant\"); // no ConnectionStrings:qdrant, no endpoint config\n\n// after (appsettings.json)\n// { \"ConnectionStrings\": { \"qdrant\": \"http://localhost:6334\" } }\nbuilder.AddQdrantClient(\"qdrant\");","handlingStrategy":"validation","validationCode":"var cs = builder.Configuration.GetConnectionString(\"qdrant\");\nvar endpoint = builder.Configuration[\"Aspire:Qdrant:Client:Endpoint\"];\nif (string.IsNullOrEmpty(cs) && string.IsNullOrEmpty(endpoint))\n    throw new InvalidOperationException(\"Qdrant connection string or Aspire:Qdrant:Client:Endpoint must be configured.\");","typeGuard":null,"tryCatchPattern":"try { builder.AddQdrantClient(\"qdrant\"); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"QdrantClient could not be configured\"))\n{ /* surface config-missing guidance to ops */ }","preventionTips":["Always run Qdrant clients through the Aspire AppHost with WithReference so connection info is injected.","Add a startup configuration check for every connection name the app consumes.","Keep connection names centralized in a constants class to avoid typos."],"tags":["qdrant","connection-string","missing-configuration","vector-database"],"backgroundTag":"missing-required-config","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}