{"record":{"id":"d0916635667dc28a","repo":"xai-org/x-algorithm","slug":"request-with-model-version-modelversion-and-emb","errorCode":null,"errorMessage":"Request with model version ($modelVersion) and embedding type ($embeddingType) cannot be processed by service variant ($actualServiceName). Expected service variant: $expectedServiceName.","messagePattern":"Request with model version \\(\\$modelVersion\\) and embedding type \\(\\$embeddingType\\) cannot be processed by service variant \\(\\$actualServiceName\\)\\. Expected service variant: \\$expectedServiceName\\.","errorType":"exception","errorClass":"InvalidRequestForSimClustersAnnVariantException","httpStatus":400,"severity":"error","filePath":"simclusters/simclustersann/filters/SimClustersAnnVariantFilter.scala","lineNumber":46,"sourceCode":"\n    validateRequest(request)\n    service(request)\n  }\n\n  private def validateRequest(\n    request: Request[SimClustersANNService.GetTweetCandidates.Args]\n  ): Unit = {\n    val modelVersion = request.args.query.sourceEmbeddingId.modelVersion\n    val embeddingType = request.args.query.config.candidateEmbeddingType\n\n    val actualServiceName = serviceIdentifier.service\n\n    val expectedServiceName = serviceNameMapper.getServiceName(modelVersion, embeddingType)\n\n    expectedServiceName match {\n      case Some(name) if name == actualServiceName => ()\n      case _ =>\n        throw InvalidRequestForSimClustersAnnVariantException(\n          modelVersion,\n          embeddingType,\n          actualServiceName,\n          expectedServiceName)\n    }\n  }\n}\n","sourceCodeStart":28,"sourceCodeEnd":54,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/simclusters/simclustersann/filters/SimClustersAnnVariantFilter.scala#L28-L54","documentation":"Thrown by SimClustersAnnVariantFilter when the service variant that received the request is not the variant mapped for the given model version and embedding type. The filter uses serviceNameMapper.getServiceName(modelVersion, embeddingType) and rejects mismatches, so each (modelVersion, embeddingType) pair is only served by its designated service variant.","triggerScenarios":"Calling the SimClusters ANN serving endpoint on a service whose name differs from serviceNameMapper's expected name for the request's modelVersion/embeddingType combination (e.g. pointing a client at the wrong variant deployment, or adding a new model version without updating the variant mapping).","commonSituations":"New model version rolled out but routing/mapper config not updated; staging traffic sent to prod variant or vice versa; embedding type (e.g. unnormalized vs normalized) not supported by the deployed variant.","solutions":["Verify the modelVersion and embeddingType in the request and which service variant the client is hitting","Check serviceNameMapper configuration so (modelVersion, embeddingType) maps to the deployed service's name","Send the request to the expected service variant named in the error message","If the variant should serve this pair, update the mapper config and redeploy"],"exampleFix":"// before: client configured against wrong variant\nclient.setService(\"simclusters-ann-a\")\n// after: route to variant expected for (modelVersion, embeddingType)\nclient.setService(expectedServiceName) // from serviceNameMapper","handlingStrategy":"validation","validationCode":"val expected = serviceNameMapper.getServiceName(modelVersion, embeddingType)\nrequire(expected.contains(actualServiceName), s\"wrong variant, expected $expected\")","typeGuard":null,"tryCatchPattern":"catch { case e: InvalidRequestForSimClustersAnnVariantException => routeTo(e.expectedServiceName) }","preventionTips":["Centralize variant routing via serviceNameMapper instead of hardcoded service names","Add config tests asserting every deployed modelVersion maps to a live variant"],"tags":["simclusters","routing","config-validation","scala"],"backgroundTag":"service-variant-mismatch","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}