All queries returning "Sorry, something went wrong."

Every query I make using Vanya to my Aidbox server is returning “Sorry, something went wrong” - took a look at the logs and cannot determine what is going on? It looks like auth is working as when i break the token it lets me know but this appears to do with the return data from Aidbox FHIR?

1/31/2025 3:08:00PM - This operation is not supported for a relative URI.
1/31/2025 3:08:00PM -    at System.Uri.get_AbsoluteUri()
   at SqlOnFire.Fhir.Data.FhirDataService.CreateResource(Bundle bundle, FhirObjectType fhirObjectType, Int32 parseErrorsStartIndex)
   at SqlOnFire.Fhir.Data.FhirDataService.QueryResource(String url, FhirClient client, Nullable`1 objectType)
   at SqlOnFire.Services.QueryService.QueryResource(String serverId, String query, Nullable`1 objectType)
   at Vanya.Client.App.Controllers.QueryResourceController.QueryServerResource(String serverId, String query, Nullable`1 resourceType, ResourceDataGridState resourceDataGridState, Nullable`1 previousCacheId, String direction)
   at Vanya.Client.App.Controllers.QueryResourceController.NewCustomQuery(String serverId, String query, Nullable`1 resourceType, ResourceDataGridState resourceDataGridState, Nullable`1 previousCacheId, String direction, Nullable`1 savedQueryId)
   at lambda_method724(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Vanya.Client.App.Helpers.Middleware.GlobalExceptionHandlingMiddleware.Invoke(HttpContext context)

I’ve tried changing headers and adding things like ?_format=json to the query to no avail

I test against Aidbox regularly, so there shouldn’t be any issues if it’s configured correctly .A couple of things to check.

  1. Is the server URL correct? Aidbox has two endpoints, only one of which is the correct FHIR endpoint. Does it end with “fhir”? Example of my own test server: https://vanyatest102.aidbox.app/fhir
  2. Is the server an R4 server? Vanya currently only runs against R4 servers so you might see various errors running against R5.

The sample query below is working for me:

Interesting - tried it against the demo environment like you provided and it worked. Created a local container aidbox and it worked. But for whatever reason our hosted version is not working.

Ah the fun of FHIR - thanks for taking such a quick look!

The error log suggests there’s something wrong with a URI, possibly inside the Bundle returned by the search. If you run a query that returns an empty Bundle, do you get the same error?

Example:

Patient?name=XXX777

If you get the same error with an empty Bundle, it would be useful to see an example of that empty Bundle, possibly coming from a Postman query.

If not, maybe take a look at the Bundle returned in Postman for a real query and see if you can see anything in there.

Also, which resource type are you running the query against?

That pointed me in right direction – turns out our setup of Aidbox didnt quite get configured correctly - the AIDBOX_BASE_URL didnt have a https:// in front which caused the pagination url to not have it which caused it to fail in Vanya.

So it was a “feature” - helping verifying our server setup was correct :sweat_smile:

That’s great Chris. :+1: