This is a migrated thread and some comments may be shown as answers.

Token Expired

9 Answers 633 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ajeesh
Top achievements
Rank 1
Ajeesh asked on 04 Jun 2018, 03:07 PM
Hi All,

We have experienced some issues with Telerik reporting service tool and that the logs are given below.

{"message":"","exceptionMessage":"Client with ID '044210-0ccb' not found. Expired.","exceptionType":"Telerik.Reporting.Services.Engine.InvalidClientException","stackTrace":"   at Telerik.Reporting.Services.Engine.PersistableCollection`1.get_Item(String itemID)\r\n   at Telerik.Reporting.Services.Engine.ReportEngine.TouchClient(String clientID)\r\n   at Telerik.Reporting.Services.Engine.ReportEngine.CreateReportInstance(String clientID, String report, Dictionary`2 parameterValues)\r\n   at Telerik.Reporting.Services.WebApi.ReportsControllerBase.CreateInstance(String clientID, ClientReportSource reportSource)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)"}

Can you please check this as soon as possible and provide your inputs to get it resolved.

9 Answers, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 07 Jun 2018, 10:55 AM
Hello Ajeesh,

"Client with ID X not found. Expired" 
can be caused by different reasons.
One reason is the expired ClientSessionTimeout value. It expires only if there is no interaction with the viewer for the time specified as a value of ClientSessionTimeout. When the time expires, the page must be refreshed.
In this case, the issue can be avoided by setting a greater value for ClientSessionTimeout. Do not set it to infinity as the viewer's records will never be deleted from the cache storage which will affect the general performance. Another approach is programmatically 
refreshing the viewer on a given interval or refreshing the whole page. 

Another reason for this error is the usage of Reporting REST Service in a web farm or load balancing scenario without the correct storage settings. In this case if you use FileStorage option you may have the cache folder created on different machines, unless you specify a common shared folder through the second overload of the FileStorage constructorOtherwise, for load balancing and web farms scenarios, you need to use MsSqlServerStorage or RedisStorage options.
For more details about storage options please check 
REST Service Storage help article.

Note: application must have read/write permissions to the cache folder or database in order to avoid problems on registering viewers.

Additionally, I would suggest checking if Cross-Origin Resource Sharing is enabled for the service project. In case the issue is caused by CORS you might see the errors in the browser console related to CORS.

In case the issue persists please open new support ticket and send us a sample project that demonstrates your current settings and a .SAZ file created by Fiddler which will allow us to check the requests made by the viewer and more detailed error messages.

Regards,
Silviya
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ajeesh
Top achievements
Rank 1
answered on 18 Jun 2018, 02:22 PM

Thanks Silviya,

We have gone through your suggestions and the results are as follows.

1.ClientSessionTimeout -We haven't used this property while loading the report

2.Programmatically refreshing the viewer- We haven't refresh the page programmatically or given interval

3. Cache Folder- The environement has load balancing but we use by default cache folder.

4. CORS- No CORS error in the browser console.

Additional Information:

api/reports/clients successfully returns some json like {"clientId":"xxxxxx-xxxx"}

api/reports/clients/client_id_from_previous_call/parameters- is getting failed. Sometimes it may be the immediate call after the previous one.

api/reports/clients/client_id_from_previous_call/instances returns like {"instanceId":"xxxxxx-xxxx"}

api/reports/clients/client_id/instances/instance_id/documents is got failed.

Both failed service has the same response "Client with ID X not found. Expired"

 

0
Silviya
Telerik team
answered on 21 Jun 2018, 11:01 AM
Hi Ajeesh,

Errors related to expired/missing ClientID can occur if you use the Reporting REST Service in a web farm or with load balancing, without using the correct Storage settings - REST Service Storage.

The reason is that with load balancing and FileStorage option you may have the cache folder created on different machines, unless you specify a common shared folder through the second overload of the FileStorage. 
Thus, for load balancing and web farms, you have to use MsSqlServerStorage or RedisStorage.

Another thing to consider is that the URI of the request for the report parameters is not valid: /api/reports/clients/client_id_from_previous_call/parameters. So you may test the following:
1. Check for Newtosoft.Json.dll in the GAC - if it is there, remove it. In the application, update the Newtosoft.Json.dll to the latest official release and make sure it is copied to the application's bin folder. Note that since R2 2018 - 12.1.18.516 assemblies and NuGet packages depending on Newtonsoft.Json now require 9.0.1 or newer version.
2. Verify that the registered routes for the Reporting REST service are not duplicated with other routes - How to change the registered by default Telerik Reporting REST Web API routes.
3. Add the necessary handlers to the Web.config if missing - How To: Add Telerik Reporting REST Web API to Web Application (step 2).
4. Check the report viewer's scripts to refer current installed version of the product. You will need to run the Upgrade Wizard for the project in order to update the viewer's files.

It is also important to make sure the application have read/write permissions to the cache folder/database used by the service.
 
Regards,
Silviya
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ajeesh
Top achievements
Rank 1
answered on 28 Jun 2018, 01:43 PM

Hi Silviya,

We have applied the cache in temp folder as mentioned in the following thread 

https://docs.telerik.com/reporting/configuring-telerik-reporting-file-session-state-provider

But we are facing the issue like the cache files are not getting cleared.

Could you please provide any solution for this.

0
Ajeesh
Top achievements
Rank 1
answered on 02 Jul 2018, 05:44 AM

Hi Silviya,

We have applied the cache in temp folder on the environment in which the actual issue mentioned. But unfortunately the issue is not got resolved. Could you please share your thoughts and what action should we take next?

Thanks and Regards

Ajeesh

0
Silviya
Telerik team
answered on 03 Jul 2018, 07:13 AM
Hi Ajeesh,

In your previous reply, you've mentioned that the environment has load balancing but using a cache folder. FileStorage is suitable if the application is hosted on a single instance. In this case, the application must have proper read/write rights for the folder specified by the FileStorage. 

Please check the REST Service Storage article and test switching to an IStorage implementation for multiple instances support, i.e. MsSqlServerStorage or RedisStorage.
How To: Configure MS Sql database storage
How to: Use Redis storage

Regards,
Silviya
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ajeesh
Top achievements
Rank 1
answered on 17 Jul 2018, 12:40 PM

Hi Silviya,

Thanks for your timely response. we appreciate your support.let us give more details regarding

Actually we have two environments. Lets say environment-1 and environment-2. In environment-1 the report has been successfully generated. Environment-2 did't generate the report with the above mentioned issue. We have applied the above configuration changes in environment-2 and it did not work.

At this point we tried to reproduce the same in environment-1. we have reduced the network bandwidth (2G-bandwidth configuration- 114 kb/s download and 20 kb/s upload) and were able to reproduce the above mentioned issue in environment-1.

We have attached the error responses from environment-2, we have noted in network profiles , that error is coming sometimes in instances call or if it passes instance call error comes in documents network call. But error is same

Note: Both are having load balancing.

0
Nasko
Telerik team
answered on 20 Jul 2018, 10:23 AM
Hi Ajeesh,

My guess is that the "expired client" issue is caused by the load balancing feature. To test if this is the case swap the currently used File storage with MsSqlServer storage. The error should disappear.

Another approach is to use sticky session. The answer there would look like this in terms of Telerik Reporting:

If the requests are being served from (physically) 3 different servers, each server has created a separate file storage and because these file storages sit on three independent boxes, there's no direct way of one knowing what is there in the file storage of the other. In order to synchronize between these servers, you may have to write/read the storage data into a layer which is common to all - MsSqlServer or Redis storage.

Now, here comes the role of sticky-session:
If the load balancer is instructed to use sticky sessions, all of your interactions will happen with the same physical server, even though other servers are present. Thus, while other clients may hit other physical servers, your client will hit the same file storage throughout your entire interaction with the viewer.


Regards,
Nasko
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ajeesh
Top achievements
Rank 1
answered on 06 Nov 2018, 05:24 AM

Hi Nasko,

Your observation is right. The root cause for the mentioned issue is the load balanced environment.

To fix this we have tried ,cache management by folder and by sql server method as mentioned in the following link and results are as below.

Method-1.https://docs.telerik.com/reporting/configuring-telerik-reporting-session-state

             1.Implemented the above method by a common shared folder and the issue is reproducible.-(Fail)

Method-2 https://docs.telerik.com/reporting/configuring-telerik-reporting-database-session-state-provider

              1.Created separate database, tables and stored procedure using Database Cache Configuration Tool

              2.provided the configuration values as mentioned ADO.NET cache provider and Telerik Data Access cache provider

              3.Result- No tables or Stored procedures were executed. We have confirmed this by using sql profiler.

              4.Even the result is as mentioned in step 3, Document got downloaded in development environment. we have tried with                        invalid connection string and the behavior is same and no error were logged.

Thanks for your patience and assistance.

Tags
General Discussions
Asked by
Ajeesh
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Ajeesh
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or