Portal 2 Session Service : The given key was not present in the dictionary

I’m getting the following error in my DEV environment (which hasn’t been used in a while). Can anybody point me in the right direction to resolve the error?


2024-06-21 15:44:29,253 - Portal2SessionService exception
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at NovaCura.Portal.Services.Connector.ConnectorService.GetDatabaseConnectorByName(Guid sittingKey, String connectorName, IWebSession webSession)
   at NovaCura.Portal2.Session.Service.Services.PaginableQueryExecutionService.Execute(PaginableDataSourceExecutionDto paginableDataSourceExecutionDto)
   at NovaCura.Portal.Services.Execution.PaginableExecutionService.Execute(PaginableDataSourceExecutionDto dataSourceExecutionDto)
   at NovaCura.Portal2.Session.Service.StackServices.PaginableDataSourceExecutionStackService.Post(PaginableDataSourceExecutionRequest request)
   at lambda_method(Closure , Object , Object )
   at NServiceKit.ServiceHost.ServiceRunner`1.Execute(IRequestContext requestContext, Object instance, TRequest request)

Hi @tkohhh
I would suggest you to upgrade your portal2 to the latest version first, since the DEV environment hasn’t been used recently (if you haven’t done that already)


Portal 2 is already at the same version as our Prod environment.


Hey Tom,

Are both DEV and PROD running on the same machine?
If it’s not the case, can you check if .NET framework 4.8 is available.
Also do check if the requirements mentioned here are available as well [System requirements | Flow Help]


DEV and PROD are on different VMs. .NET 4.8 is present on both VMs.

I should note that Portal 2 has run on the DEV environment previously, with the current server configuration. The only thing that I have done is import pages from our PROD environment to the DEV environment.

Does the " KeyNotFoundException" mean anything specific to you?


I believe that error typically means it is trying to reference a “page” that previously existed that is no longer there. Meaning, the old referenced page i.e. RG6Y3B1 cannot be found because it exists only in Prod. Does that help narrow it down? It could also mean that your datasource is a workflow and it cannot be found until “imported” into DEV.

Thanks Daniel… your response got me poking around a little more.

Apparently when you export connectors, and then import them into another Novacura instance, the passwords are not retained.

Adding the password to the connector has resolved the error.

Thank you!