Internal Server Error:
An error has occurred.
Access to the path '8.2.14.1027_ClientsCacheLock' is denied.
Can you provide direction on solving this problem?
Thank you
15 Answers, 1 is accepted
If the Reporting REST service will be hosted on multiple instances, you need to use the IStorage CreateStorage method instead of the ICache CreateCache method of the service - REST Service storage.
In case the service is hosted as a single instance, you can use the ICache CreateCache method of the Reporting REST service, where the application's process must have proper read/write access to the cache storage. You can set a specific folder where the service will store (cache) the data through the CacheFactory.CreateFileCache Method (String). Thus different processes (applications using the Reporting REST service) will not use the same default cache folder.
On a side note, if the service will be hosted separately, and will use a different domain you may need to enable CORS to allow the communication between the clients(viewers) and the service.
Let us know if you need any further help.
Regards,
Stef
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Starting today, we have run into this same error. On our Dev/QA server, we have 2 websites running (separate IIS site, separate ApplicationPools) that run 2 different versions of our code. Whichever website is accessed first, reporting worked as expected. The 2nd website fails (exception message shown below). I made code changes to both branches to specify the folder structure (based on the web.config) so that it is different between the 2 (C:\ReportCache1 and C:\ReportCache2).
{"message":"An error has occurred.","exceptionMessage":"Access to the path '8.2.14.1027_ClientsCacheLock' is denied.",
"exceptionType":"System.UnauthorizedAccessException","stackTrace":" at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n
at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)\r\n at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)\r\n
at System.Threading.Mutex.CreateMutexWithGuaranteedCleanup(Boolean initiallyOwned, String name, Boolean& createdNew, SECURITY_ATTRIBUTES secAttrs)\r\n
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)\r\n
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew)\r\n
at Telerik.Reporting.Services.Engine.CacheStorage.Lock..ctor(String key)\r\n
at Telerik.Reporting.Services.Engine.CacheStorage.GetAllMembersInSet(String key)\r\n
at Telerik.Reporting.Services.Engine.ReportEngine.ClearExpiredClients()\r\n
at Telerik.Reporting.Services.Engine.ReportEngine.RegisterClient()\r\n
at Telerik.Reporting.Services.WebApi.ReportsControllerBase.RegisterClient()\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)"}
Regards,
Travis Lamkin
Please apply the following settings for all applications having a running Reporting REST service in them:
- If you use the ICache storage and the file system:
- Make each application to write in its own folder. For the purpose you can use the CacheFactory.CreateFileCache Method (String), where the argument specifies the cache folder;
- If users are authenticated, add additional separation in the cache storage by letting each user to use its own cache folder:
protected
override
ICache CreateCache()
{
var userID=GetUserID();
var appID=GetAppID();
return
Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache(String.Format(
"C:\\{0}\\{1}"
,appID,userID));
}
- If the applications are hosted in a web farm, you will have to switch to the IStorage storage - REST Service storage.
I notice you have a support ticket on the same question. If you need further help, please update the ticket with further details how the applications are hosted and steps how to reproduce the problem locally.
Regards,
Stef
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
protected override ICache CreateCache()
{
return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache(string.Format("{0}\\reportcache", HttpRuntime.AppDomainAppPath));
}
Please check my response in your support ticket on the same question - #916058 'Access to the path is denied' Error on Production. Also please download and upgrade to the latest available internal build of Q3 2014 SP1 v8.2.14.1222 or Q1 2015 v9.0.15.313.
I will appreciate it if we continue the discussion in the above mentioned support ticket.
Regards,
Stef
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I get the error using the most recent version: 9.0.15.225.
What is the root cause of this issue?
Internal Server Error:
An error has occurred.
Access to the path '9.0.15.225_LastCheckTimeLock' is denied.
Thanks..
We recently investigated the issue further and added some improvements in Telerik Reporting Q1 2015 SP1 v9.0.15.324. If upgrading projects to this version does not resolve the problem with the locked cache files, please check the following details.
If the application is not hosted in a web farm use an ICache implementation in the service's CreateCache method, where each application (hosted on the same machine and having a Reporting REST service) uses the same application pool. With this approach, different applications will not lock each other on accessing their cache storage, and will wait for each other.
On the question Why?, ICache interface does not give application lock mechanism so that the access to the cache can be serialized. So if you are using ICache to store the viewer state, the service engine uses internally named semaphores in order to serialize the access to each particular entry. However it appears that trying to create semaphore with the same name from two different user contexts leads to an error in the OS.
This will be addressed from our Dev team by introducing the possibility to specify different prefix for the cache keys for the different apps you deploy. Until the improvement is added, processes must be identified as the same user (by using the same application pool).
The recommended option however is to provide IStorage implementation to your service controller (service's CreateStorage method) which provides native implementation of the lock mechanism for that particular storage. In the current case please use the MsSqlServerStorage IStorage implementation which uses db transactions with appropriate isolation level to implement locking mechanism. Additionally you may configure different databases for each different application.
I hope this information helps you to resolve the issue.
Regards,
Stef
Telerik
See What's Next in App Development. Register for TelerikNEXT.
Please go through my previous post in the thread, and check if at the same time there are running other applications having a Reporting REST service with ICache implementation. Unless all running applications are identified as the same user on the machine, the cache might be locked. Thus test switching to an IStorage implementation (MsSqlServerStorage is recommended).
Currently our developers are adding an improvement to allow multiple applications with Reporting REST service having ICache to run simultaneously on the same machine.
Regards,
Stef
Telerik
See What's Next in App Development. Register for TelerikNEXT.
Hi Stef
On load or refresh, I always get the error:
Internal Server Error:
An error has occurred.
Access to the port is denied
However if I press F5, then everything works fine !!
My code is like this:
string cachePath = String.Format(@"E:\RAS\ReportCaching" + "/{0}", WindowsIdentity.GetCurrent().Name);
var cache2 = Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache(cachePath);
if (cache2.HasValue(cachePath))
{
cache2.Clear();
}
return Telerik.Reporting.Services.Engine.StorageFactory.CreateStorage(cache2);
I hope you have a solution for me.
Best regards:
Albert ElĂsson
I have tried to change my code in the controller and use the DataBaseCache like so:
protected override ICache CreateCache()
{
return Telerik.Reporting.Services.Engine.CacheFactory.CreateDatabaseCache("MsSql", "data source=xxxxxx;initial catalog=xxxxxx;User ID=xxxxx;Password=xxxxxxx;");
}
I get caching rows in my db but....
I get the same error on the server.
This is so strange. Everything works like a charm on my local machine but when I run the web after deployment to
the server, I get this strange behavior.
That is, when I load the report up, I get the error "Access to the port is denied". I get the same error if I press the
refresh button on the ReportViewer but everything works fine if I press F5 on my keyboard !!!!
My application is a Asp.Net MVC application and I am using telerikReportViewer-9.0.15.324.
What could be the cause of this? Some settings on the web server? It is Windows Server 2008 R2.
I can't find any solution for this !!!! Please help...
Best regards,
Albert ElĂsson
Please download and install the latest available internal build v9.0.15.422 (this is a consecutive build of v9.0.15.324 which includes improvements in the Reporting REST service's cache management).
After installing v9.0.15.422 apply the following cache settings depending on the type of hosting:
- If the application is hosted on a single instance as in development environment, you can use an ICache implementation like:
protected
override
Telerik.Reporting.Cache.Interfaces.ICache CreateCache()
{
return
Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache();
}
or
protected
override
Telerik.Reporting.Cache.Interfaces.ICache CreateCache()
{
return
Telerik.Reporting.Services.Engine.CacheFactory.CreateDatabaseCache(
"mssql"
,
"connection string to the configured database"
);
}
- If the application is hosted on multiple instances (web farm) suitable for production purpoces, you will need to use an IStorage implementation like:
protected
override
Telerik.Reporting.Cache.Interfaces.IStorage CreateStorage()
{
return
new
Telerik.Reporting.Cache.MsSqlServerStorage(
"connectionString string here"
);
}
Regards,
Stef
Telerik
Hi Stef
Thank you so much. My problem is resolved !!
I downloaded version v9.0.15.422 like you suggested, used the upgrade wizard to update my project and changed the code in my ReportController to use the MsSqlServerStorage option like shown in option 2 and everything is working now. :)
Best regards,
Albert ElĂsson