Error registering the viewer with the service. An error has occurred. Access to the path 'C:\Windows\TEMP\TelerikReporting\16.0.22.225\LCT\value.dat' is denied.

2 Answers 56 Views
.NET Core .NET Framework Actions Binding Conditional Formatting DataSource SQL DataSources Expressions Filtering Grouping Sorting Table

2 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 17 Oct 2022, 01:52 PM

Hello Mahalakshmi,

Thank you for the attached screenshots!

The error message "Access to the path X is denied" indicates that the Reporting REST service cannot access the configured file storage. By default, the user temp folder will be used as storage which is the path returned by the Path.GetTempPath Method(varies between OS).

For example:

C:\Users\{UserName}\AppData\Local\Temp\{HostAppId}

You can change the default folder using the second overload of the FileStorage and passing the custom folder location. The changes need to be made in the ReportsController.cs file where the settings of the Reporting REST service are defined. Please refer to this knowledge base article for an example - Error registering the viewer with the service. Access to path X is denied.

Additionally, please make sure that the IIS process has read/write access for the folder used by the storage. You can give access to the folder from its Properties - Sharing|Security options or change the used application pool's Identity through IIS Manager.

In case you have different instances of the application running, set a unique HostAppId for each instance of the Reporting REST Service. The settings must be added in the ReportsControllerBase implementation.

While on topic about the setting of the Reporting service, I noticed that you have set the ClientSessionTimeout and ReportSharingTimeout to 6000. These settings are taken as an integer representing minutes which means that the generated reporting cache for each client will be saved for 6000 minutes which is a lot. This could take a lot of space if there are many clients, please keep that in mind. Other than the space, some of the cache might also get corrupted. Besides what I have said so far, I also recommend deleting this folder to clear all the current cache and perhaps set a lower timeout.

Depending on the hosting environment, you should also consider the appropriate cache storage options - please check the available options in REST Service Storage.

I hope that the provided information will help you resolve the issue, please let me know if you have any further questions. 

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/.
0
Mahalakshmi
Top achievements
Rank 1
Iron
answered on 18 Oct 2022, 07:51 AM

Thanks Dimitar i have added the below in Startup.cs and JSON file

string strHostAppId = appsettingjson.GetValue<string>("telerikReporting:restReportService:hostAppId");
            services.TryAddSingleton<IReportServiceConfiguration>(sp =>
                new ReportServiceConfiguration
                {
                                       HostAppId = strHostAppId,
                    Storage = new FileStorage(),
                    ReportSourceResolver = new CustomReportSourceResolver()

                });

appsetting.json

  "telerikReporting": {
    "restReportService": {
      "hostAppId": "Alpha4AdminAPI",
      "workerCount": 9999,
      "reportSharingTimeout": 6000,
      "clientSessionTimeout": 6000,
      "exceptionsVerbosity": "detailed",
      "reportResolver": {
        "provider": "type"
      }
    }
Dimitar
Telerik team
commented on 21 Oct 2022, 07:04 AM

Hi Mahalakshmi,

I see that the default FileStorage is still being used, would you please test to specify a new path in the constructor, for example:

string strHostAppId = appsettingjson.GetValue<string>("telerikReporting:restReportService:hostAppId");
            services.TryAddSingleton<IReportServiceConfiguration>(sp =>
                new ReportServiceConfiguration
                {
                                       HostAppId = strHostAppId,
                    Storage = new FileStorage("D:\\MyFolder"),
                    ReportSourceResolver = new CustomReportSourceResolver()

                });

The folder specified in the constructor must be accessible by the service and the service should have read/write access to it.

Also, I recommend leaving the workerCount to the default value which is equal to the count of the available logical processors on the machine.

I mentioned it in the previous reply but the reportSharingTimeout and clientSessionTimeout settings are set in minutes so the cached assets with the current settings will be preserved for 6000 minutes and with a lot of users accessing this service, that could make the file storage folder ver big, please keep that in mind. I would suggest setting it to a much lower value like 60, for example.

Khadeer
Top achievements
Rank 1
commented on 22 Oct 2022, 03:03 AM | edited

Hi 

After changing the code we are getting below error: Also how can I check whether the settings given in appsettings.json  are applied in the constructor

Dimitar
Telerik team
commented on 26 Oct 2022, 03:24 PM

It seems that the Get Report Parameters request is failing with status code 410 which indicates that the client has expired.

What value did you set to the ClientSessionTimeout? Did you set it to 60 and did you update the FileStorage folder? Please share the updated code.

After how much time did the error appear? If it is less than the ClientSessionTimeout(value in minutes), then there is some kind of issue with the storage. Perhaps FileStorage is not suitable for your environment, please test with the other options - IStorage implementation suitable for deploying both on single instance application hosting and in Web Farms.

 

 

Mahalakshmi
Top achievements
Rank 1
Iron
commented on 26 Oct 2022, 04:34 PM | edited

hi Dimitar,

 ClientSessionTimeout is 60 and given access rights for folder path in servers  and  error appear upto application session timeout

 Json

"telerikReporting": {
    "restReportService": {
      "hostAppId": "Alpha4AdminAPI",
      "workerCount": 999,
      "reportSharingTimeout": 60,
      "clientSessionTimeout": 60,
           "exceptionsVerbosity": "detailed",
      "reportResolver": {
        "provider": "type"
      },
      "storage": {
        "provider": "file",
        "parameters": 
          {
            "name": "directory",
            "value": "E:\\BitBuket\\PrivateApi"
          }        
      }
      },
      "extensions": [
        {
          "name": "RTF",
          "visible": "false"
        },
        {
          "name": "PPTX",
          "visible": "false"
        },
        {
          "name": "IMAGEInteractive",
          "visible": "false"
        },
        {
          "name": "IMAGE",
          "visible": "false"
        },
        {
          "name": "XLSX",
          "visible": "true"
        },
        {
          "name": "DOCX",
          "visible": "true"
        }

      ]
    }

 

Startup.cs

 var strStorage = appsettingjson.GetValue<string>("telerikReporting:restReportService:storage:parameters:value");
            // Configure dependencies for ReportsController.
            services.TryAddSingleton<IReportServiceConfiguration>(sp =>
                new ReportServiceConfiguration
                {
                    // The default ReportingEngineConfiguration will be initialized from appsettings.json or appsettings.{EnvironmentName}.json:
                    ReportingEngineConfiguration = sp.GetService<IConfiguration>(),

                    // In case the ReportingEngineConfiguration needs to be loaded from a specific configuration file, use the approach below:
                    // ReportingEngineConfiguration = ResolveSpecificReportingConfiguration(WebHostEnvironment),
                    HostAppId = strHostAppId,
                    Storage = new FileStorage(strStorage),
                    //ReportSourceResolver = new TypeReportSourceResolver().AddFallbackResolver(
                    //                       new UriReportSourceResolver(reportsPath))
                    ReportSourceResolver = new CustomReportSourceResolver(),
                    WorkerCount = 999,
                    ClientSessionTimeout = 60,
                    ReportSharingTimeout = 60,
                    ExceptionsVerbosity = ""

                });
Mahalakshmi
Top achievements
Rank 1
Iron
commented on 27 Oct 2022, 11:17 AM | edited

Hi, please find the updated startup.cs

  var appsettingjson = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
            string strHostAppId = appsettingjson.GetValue<string>("telerikReporting:restReportService:hostAppId");            
            string strWorkerCount = (appsettingjson.GetValue<string>("telerikReporting:restReportService:workerCount"));
            string strClientSessionTimeout = (appsettingjson.GetValue<string>("telerikReporting:restReportService:clientSessionTimeout"));
            string strReportSharingTimeout = (appsettingjson.GetValue<string>("telerikReporting:restReportService:reportSharingTimeout"));
            string strExceptionsVerbosity = appsettingjson.GetValue<string>("telerikReporting:restReportService:exceptionsVerbosity");
            var strStorage = appsettingjson.GetValue<string>("telerikReporting:restReportService:storage:parameters:value");
            // Configure dependencies for ReportsController.
            services.TryAddSingleton<IReportServiceConfiguration>(sp =>
                new ReportServiceConfiguration
                {
                    // The default ReportingEngineConfiguration will be initialized from appsettings.json or appsettings.{EnvironmentName}.json:
                    ReportingEngineConfiguration = sp.GetService<IConfiguration>(),

                    // In case the ReportingEngineConfiguration needs to be loaded from a specific configuration file, use the approach below:
                    // ReportingEngineConfiguration = ResolveSpecificReportingConfiguration(WebHostEnvironment),
                    HostAppId = strHostAppId,
                    Storage = new FileStorage(strStorage),
                    //ReportSourceResolver = new TypeReportSourceResolver().AddFallbackResolver(
                    //                       new UriReportSourceResolver(reportsPath))
                    ReportSourceResolver = new CustomReportSourceResolver(),
                    WorkerCount = Convert.ToInt16(strWorkerCount ),
                    ClientSessionTimeout =Convert.ToInt16( strClientSessionTimeout ),
                    ReportSharingTimeout = Convert.ToInt16(strReportSharingTimeout ),
                    ExceptionsVerbosity = strExceptionsVerbosity

                });

Dimitar
Telerik team
commented on 31 Oct 2022, 02:18 PM

In what environment is the project running? What is the OS of the server? Depending on the answer, FileStorage might not be the correct storage type.

I highly recommend testing with one of the following storage:

In case the issue is not resolved with the other storages, please attach a trace listener to log the errors and send the log file - How to troubleshoot errors in ASP.NET Core projects - Telerik Reporting.

 

Tags
.NET Core .NET Framework Actions Binding Conditional Formatting DataSource SQL DataSources Expressions Filtering Grouping Sorting Table
Asked by
Mahalakshmi
Top achievements
Rank 1
Iron
Answers by
Dimitar
Telerik team
Mahalakshmi
Top achievements
Rank 1
Iron
Share this question
or