wolverine icon indicating copy to clipboard operation
wolverine copied to clipboard

CosmosDB agent scheme unrecognised

Open rj-cooper opened this issue 6 months ago • 1 comments

Describe the bug The CosmosDbDurabilityAgent constructs its agent URI as cosmosdb://durability, but NodeAgentController only knows about the wolverinedb scheme — so findAgentAsync throws "Unrecognized agent scheme 'cosmosdb' (Parameter 'uri')" every poll cycle.

It seems to be the same pattern as a RavenDb bug fixed in #2261

To Reproduce Steps to reproduce the behavior:

  1. Create a Wolverine host with CosmosDB persistence:
builder.Host.UseWolverine(opt =>
{
    opt.UseCosmosDbPersistence("anyDatabaseId");
    opt.Durability.NodeReassignmentPollingTime = TimeSpan.FromSeconds(5); // speed up repro
});
  1. Start the host against any reachable Cosmos account.
  2. Within NodeReassignmentPollingTime, the log emits:
Error trying to reevaluate agent assignments for 'wolverinedb' agents
System.ArgumentOutOfRangeException: Unrecognized agent scheme 'cosmosdb' (Parameter 'uri')
   at Wolverine.Runtime.Agents.NodeAgentController.findAgentAsync(Uri uri)
   at Wolverine.Runtime.Agents.NodeAgentController.StartAgentAsync(Uri agentUri)

Version: reproduced on WolverineFx.CosmosDb 5.35.1

Expected behavior No agent assignment error when using WolverineFx.CosmosDb

StackTrace System.ArgumentOutOfRangeException: Unrecognized agent scheme 'cosmosdb' (Parameter 'uri') at Wolverine.Runtime.Agents.NodeAgentController.findAgentAsync(Uri uri) in /home/runner/work/wolverine/wolverine/src/Wolverine/Runtime/Agents/NodeAgentController.cs:line 156 at Wolverine.Runtime.Agents.NodeAgentController.StartAgentAsync(Uri agentUri) in /home/runner/work/wolverine/wolverine/src/Wolverine/Runtime/Agents/NodeAgentController.cs:line 166 at Wolverine.Runtime.Agents.NodeAgentController.startAllAgentsAsync() in /home/runner/work/wolverine/wolverine/src/Wolverine/Runtime/Agents/NodeAgentController.StartLocally.cs:line 54

Additional context Disclaimer - Claude code was used to help diagnose this issue.

rj-cooper avatar May 19 '26 15:05 rj-cooper

@frozenskys yeah, there was a similar issue w/ RavenDb and this will get a similar fix. I'm aiming for a 5.* bug fix release with this, and it'll roll into 6.0 too

jeremydmiller avatar May 20 '26 11:05 jeremydmiller