Error after upgrade from version 15.0.21.224 to 15.1.21.616

1 Answer 311 Views
.NET Framework
sg
Top achievements
Rank 1
Veteran
sg asked on 25 Nov 2021, 08:57 AM | edited on 25 Nov 2021, 08:58 AM

Hi,

We have upgraded our Telerik reporting version to 15.1.21.616 and we are using the Upgrade Wizard to update all the telerik assemblies in the project. When we called /api/reports/formats, below error occurs:

 

"ExceptionMessage": "Multiple actions were found that match the request:  Formats on type WebApi.Controllers.ReportsController GetClientsSessionTimeoutSeconds on type WebApi.Controllers.ReportsController", "ExceptionType": "System.InvalidOperationException",
"StackTrace": "   at System.Web.Http.Controllers.ApiControllerActionSelector.ActionSelectorCacheItem.SelectAction(HttpControllerContext controllerContext)\r\n   at System.Web.Http.Controllers.ApiControllerActionSelector.SelectAction(HttpControllerContext controllerContext)\r\n   at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"

 

Once we downgrade back to 15.0.21.224, the error gone.

Please help. Thank you.

 

 

1 Answer, 1 is accepted

Sort by
2
Dimitar
Telerik team
answered on 25 Nov 2021, 12:51 PM

Hello,

Thank you for sharing the error message. Based on it, it seems that the request that fails is Get Clients Session Timeout Seconds. It is related to the keepClientAlive option of the Html5 Viewer we introduced with R2 2021 SP1.

The problem most probably comes from a greedy route in the routes configuration. I suggest moving the registration of the reporting routes before the default ones, for example, like in the following code snippet:

Telerik.Reporting.Services.WebApi.ReportsControllerConfiguration.RegisterRoutes(config);

config.Routes.MapHttpRoute(
    name: "DefaultApi",
    routeTemplate: "api/{controller}/{action}/{id}",
    defaults: new { id = RouteParameter.Optional }
);

The reason is that this way the reporting route will be prioritized and won't be overridden by the greedy ones. If you don't expose other WEB API routes, you may simply delete the default ones.

This has fixed the issue for other clients who have experienced this error, and I hope it will solve it also for you. 

Please note that there is also a public feedback item that you can vote for in order to increase the priority of the issue - The ApiDefault route registered in ReportsControllerConfiguration.RegisterRoutes hides some routes registered after it.

Thank you for using Telerik Reporting!

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tieson
Top achievements
Rank 2
commented on 30 Jan 2022, 11:33 PM

Is it possible to either add a note similar to this answer to the documentation, or a link to this question and answer? It took me a while to stumble across this, since it doesn't seem to show up in a Google search.

I think at one point the docs were open source? I'd be happy to submit a PR if that's acceptable.

Dimitar
Telerik team
commented on 31 Jan 2022, 10:02 AM

I agree that it would be useful to have this information available somewhere in the documentation. Which article would expect to find this information in?

We recently moved the docs to our GitHub - telerik / reporting-docs and PRs are now welcome! We would be glad if you made the PR for the article in which you would expect this information to be available. Please do not hesitate to also make suggestions for other articles for which you have suggestions on how they may be improved.

Tags
.NET Framework
Asked by
sg
Top achievements
Rank 1
Veteran
Answers by
Dimitar
Telerik team
Share this question
or