microsoft / microsoft/fhir-server
SearchParameterNotSupportedException thrown on all requests
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TSQL
- Estrellas
- 1.4k
- Forks
- 592
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 41
Descripción
**Describe the bug**
We had been running version 4.0.632 of the server and recently upgraded to version 4.0.790. The upgrade involved running the SQL schema diff scripts from schema version 102 to schema version 113 before running the 4.0.790 image version. Following this, the server has been returning an error for all requests, e.g.
```
{
"resourceType": "OperationOutcome",
"id": "301ce81d-b85e-4c26-ba5d-3ae6a312be61",
"meta": {
"lastUpdated": "2026-06-30T15:05:43.6885012+00:00"
},
"issue": [
{
"severity": "error",
"code": "not-supported",
"details": {
"text": "The request was invalid."
},
"diagnostics": "The search parameter '_type' is not supported for resource type 'Resource'."
}
]
}
```
This is happening because a `SearchParameterNotSupportedException` is being thrown on various code paths, including building a CapabilityStatement, so is possibly throwing on everything that needs to do a search. I've traced through the code as best I can for a metadata request (so very simple, no parameters) and it looks like `SearchParameterDefinitionManager.TryGetFromTypeLookup` must be returning false: https://github.com/microsoft/fhir-server/blob/release/4.0.790/src/Microsoft.Health.Fhir.Core/Features/Definition/SearchParameterDefinitionManager.cs#L556. The parameter `_type` for resource type `Resource` is being added in `SearchOptionsFactory` via `ResourceTypeSearchParameter`: https://github.com/microsoft/fhir-server/blob/release/4.0.790/src/Microsoft.Health.Fhir.Shared.Core/Features/Search/SearchOptionsFactory.cs#L389. I haven't got to the bottom of how the type lookup inside `SearchParameterDefinitionManager` is populated so am a bit stumped at the moment.
There are now a couple of later releases that I could try but I'm a bit wary of changing anything further in case things go even more wrong. Looking at the changes between 4.0.632 and 4.0.790 there are various mentions of search parameters but difficult for me to tell if anything is relevant. Given that the whole thing is completely borked presumably others would have seen it, so possibly it's something to do with our data (although I don't think we do anything unusual).
**FHIR Version?**
Stu3
**Data provider?**
SQL Server
**To Reproduce**
Steps to reproduce the behavior:
1. (Unsure if relevant) Upgrade SQL schema from version 4.0.632 to 4.0.790
2. Run server at 4.0.790
3. Make any query
**Expected behavior**
Well formed queries should return without error.
**Actual behavior**
An error is returned on every query.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Start by comparing the 4.0.632-to-4.0.790 SQL schema changes and reproducing a query against the 4.0.790 server. Trace SearchOptionsFactory.cs at ResourceTypeSearchParameter into SearchParameterDefinitionManager.cs at TryGetFromTypeLookup, including how the type lookup is populated. Done means well-formed queries and metadata or CapabilityStatement requests no longer fail with SearchParameterNotSupportedException.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- sql
- Área
- backend-api-design, databases
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100