Accessed denied issue
I can run Sitefinity 4.0 RC perfectly in VS2010. But, if I use VS2010 to publish the web application to an IIS server, I run into issues.
The message I keep getting is below. I
have tried giving the IUSR access to path mentioned, but it didn't seem to
resolve the problem. Any suggestions on how to deal with this issue?
Server Error in '/test' Application.
Access to the path 'D:\inetpub\wwwroot\test\App_Data\Sitefinity\Configuration\SecurityConfig.config' is denied.
Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack trace
for more information about the error and where it originated in the
code.
Exception Details: System.UnauthorizedAccessException:
Access to the path
'D:\inetpub\wwwroot\test\App_Data\Sitefinity\Configuration\SecurityConfig.config'
is denied.
ASP.NET is not authorized to access the requested resource.
Consider granting access rights to the resource to the ASP.NET request
identity. ASP.NET has a base process identity (typically
MACHINE\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the
configured application pool identity on IIS 7.5) that is used if the
application is not impersonating. If the application is impersonating
via <identity impersonate="true"/>, the identity will be the
anonymous user (typically IUSR_MACHINENAME) or the authenticated request
user.
Hi Stephen,
This is a general ASP.NET error. The account that runs your application pool does not have permissions over the App_Data, its subfolders and items.
Regards,
Ivan Dimitrov
the Telerik team
Can you give us a bit more of a solution? For those of us that might be a bit new to this and what sort of permissions or account needs to be used to fix this problem.
Hi Robert,
The account that runs ASP.NET worker process (generally NETWORK SERVICE ) should have Read/Write permissions over App_Data.
Greetings,
Ivan Dimitrov
the Telerik team
I'm having this same issue on a brand new SF 4.0 site I set up in our cloud environment. The physical path is a UNC location, and we are using a domain account as the physical path credentials and for the app pool identity. This set up has worked on 3.x versions of Sitefinity, but doesn't seem to be here for some reason. The App_Data folder definitely has the domain account added with full control... Any ideas?
Thanks, DanO
Hello Dan,
Could you please post the whole error? Is it absolutely the same error reported by the first person?
All the best,Yep - same error:
[UnauthorizedAccessException: Access to the path '\\XXcloudad1\users\dobrien\Projects\XXX\XXX.Web\Main\Src\XXX.Web.UI\App_Data\Sitefinity\Configuration\SecurityConfig.config' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +9726046
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +1142
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +83
System.Xml.XmlWriterSettings.CreateWriter(String outputFileName) +142
System.Xml.XmlWriter.Create(String outputFileName, XmlWriterSettings settings) +23
Telerik.Sitefinity.Configuration.Data.XmlConfigProvider.GetConfigurationWriter(ConfigSection section) +117
Telerik.Sitefinity.Configuration.Data.XmlConfigProvider.SaveSectionInternal(ConfigSection section) +58
Telerik.Sitefinity.Configuration.Data.XmlConfigProvider.SaveSection(ConfigSection section) +87
Telerik.Sitefinity.Configuration.ConfigManager.SaveSection(ConfigSection section) +25
Telerik.Sitefinity.Security.SecurityManager..cctor() +384
[TypeInitializationException: The type initializer for 'Telerik.Sitefinity.Security.SecurityManager' threw an exception.]
Telerik.Sitefinity.Security.SecurityManager.GetCurrentUser() +0
Telerik.Sitefinity.Configuration.UserPolicyHandler.GetPolicyNames(ConfigProvider configProvider, ConfigSection section) +27
Telerik.Sitefinity.Configuration.ConfigElement.GetValueFromPolicy(ConfigPolicyHandler handler, ConfigProperty prop, Object& value) +101
Telerik.Sitefinity.Configuration.ConfigElement.GetPolicyValue(ConfigProperty prop, Object& value) +87
Telerik.Sitefinity.Configuration.ConfigElement.get_Item(ConfigProperty prop) +56
Telerik.Sitefinity.Configuration.ConfigElement.get_Item(String propertyName) +68
Telerik.Sitefinity.Localization.Configuration.ResourcesConfig.get_Providers() +17
Telerik.Sitefinity.Localization.ResourceManager.get_ProvidersSettings() +23
Telerik.Sitefinity.Data.ManagerBase`1.GetProvidersSettings() +10
Telerik.Sitefinity.Data.ManagerBase`1.Initialize() +507
Telerik.Sitefinity.Data.ManagerBase`1..ctor(String providerName, String transactionName) +24
Telerik.Sitefinity.Localization.ResourceManager..ctor() +21
Telerik.Sitefinity.Localization.Res..cctor() +21
[TypeInitializationException: The type initializer for 'Telerik.Sitefinity.Localization.Res' threw an exception.]
Telerik.Sitefinity.Localization.Res.RegisterResource() +0
Telerik.Sitefinity.Abstractions.ObjectFactory.RegisterIoCTypes() +1035
Telerik.Sitefinity.Abstractions.Bootstrapper.Bootstrap() +87
Telerik.Sitefinity.Web.SitefinityHttpModule.Init(HttpApplication context) +24
System.Web.Routing.UrlRoutingModule.System.Web.IHttpModule.Init(HttpApplication application) +10
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +431
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +194
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +253
[HttpException (0x80004005): The type initializer for 'Telerik.Sitefinity.Localization.Res' threw an exception.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8950644
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256
Hi Dan,
Actually, you might have access rights to the App_data, but not to Sitefinity\Configuration\. In other words, the permissions inheritance might not be set, and you may try to give permissions over the entire directory tree under the App_Data, not just on App_data.
Regards,We have permissions set for that domain user at the root of the site and inheritance is turned on. I've even checked at the file level, and the user our site is running under has full control of the SecurityConfig.config file.
Have you tried to reproduce this problem by creating a Sitefinity 4.0 site that uses a UNC path as it's Physical Path, and uses a domain account to authenticate?
I have a feeling if you try that you will reproduce the error. It seems like there is some local identity that needs access to that file, but I don't know which one or why...
Thanks, Dan
We figured out what the issue is - the files are read-only since they were checked into source control. Are these files supposed to be excluded from source control?
Thanks, Dan
Hi Dan,
The files in App_Data should not be excluded from the source control. We use App_Data as a data storage for the configurations and if you exclude these files there will be difference for the users that use the solution.
Greetings,
Ivan Dimitrov
the Telerik team
So to clarify - should the entire App_Data directory be included in source control? I'm confused as to why more people aren't running into this issue. It doesn't seem like the problem has anything to do with the fact that our local sites are pointing to a UNC location.
If the application needs to write to files that are in source control at runtime they are going to have to be checked out anytime the application is running locally. That seems like a headache. Is there something I am missing?
Thanks, Dan
We are running into the same issue as Dan. Using a source control (we're using Vault) it's a bit annoying to have to keep checking out the whole App_Data folder when browsing the site from Visual Studio. Any assistance on this?
Thanks,
Greg
Hi Dan,
Sitefinity configuration and the database are closely related. There are configuration settings, persisted for one database, could not be relevant to another database and this is why you need to put the project in source control after it has been installed. The files inside App_Data will be check out and checked it with the changes made by each person. There might be some conflicts related to setting some values like ID of the home page or adding widgets, because before you start working you should get the latest version from the source control and you should have a notification for each checkin.
Regards,
Ivan Dimitrov
the Telerik team
Hi Guys,
I am getting the same error with this. 'C:\inetpub\wwwroot\Sitefinity\4.1\SP2\Client\App_Data\Sitefinity\Configuration\AppearanceConfig.config
Problem is, AppearanceConfig.config does not even exist. I have set SF4 up on another project and I see that file existing in that project but not the one that I am currently working on which is a fresh installation.
Is this file meant to be created by Sitefinity because if I check the _EmptyProject folder which comes with SF installation, it is not there.
Cheers,
James
I have also given the App_Data folder the permissions for NETWORKSERVICE and Defult App Pool and not having joy. This is happening when I try and set the DefaultFrontendTheme in the admin section of the site.
thanks
Hi Guys,
I have now set the permissions for Default App Pool and Network Service on my App Data folder and give it all full permission so that I can get to the bottom of this but still no joy.
Attached is the error message I get..
This only started happening when I moved my project from Sitefinity 4's slow integrated web server to IIS as recommended by one of your guys in another post.
Thanks,
James
Hello James@Nw,
When you go to Administration >> Settings >> Advanced >> Appearance this should generate AppearanceConfig.config file. Most of the config files are generated only when the configuration section is updated.
Can you replicate the access denied issue using our Project Manager or Visual Studio to run the project.
The error you get is related to the permissions - the worker process and the account under which your application pool runs does not have read/write permissions.
Best wishes,
Ivan Dimitrov
the Telerik team
Hi Ivan,
I run Visual Web Developer 2008 Express for most of my projects and when I build my site (which I never do from Express) I get the same .Net 4 error <compilation debug="false" targetFramework="4.0"> as I do when I run it in the wrong .Net Application Pool in IIS.
I have moved the project out of the Project Manager because it is SUPER slow and any changes I make on my pages do not reflect when I refresh the browser.
I have gone as far as giving the uppermost folder the permissions for Network Service and Default App Pool and made sure all sub folders and files inherit these permissions.
Anything else I can check?
Thanks
Got it!
Gave the IIS_IUSRS account full read/write permission and that worked at long last! Does this however have any negative effect on the AppData folder now though?
Thanks!
Hello All,
We are also having the same issue with access denied to the configuration files. We have just started working with Sitefinity 4.2 project and we are running into this issue. We have Sitefinity 4.2 web application in TFS 2008 and as mentioned in this forum, by defualt all the files would be marked as Read-Only when they are in source control. Is there any solution for this? As suggested in this post the App_Data folder should be there in Source Control, but if it is it has read-only attribute attached to it.
The problem with our site is that I cannot even create a homepage as the access to the C....\...\App_Data\Sitefinity\Configuration\PagesConfig.config is denied, so I am basically stuck. Please refer to attached screenshot of the error.On the permissions side, we have given NETWORK SERVICE full permissions through IIS. It seems that some people are reporting this issue, so is there any solution for this problem?
Thank you.
Hello All,
I was able to resolve this issue, by checking out the files in the App_Data folder. But, I don't think so this should be the case every time, when I would like to work on a project on my local machine, I need to get the latest version and check out the App_Data folder for edit, so I can start doing pretty much anything. Any suggestions or advice from Sitefinity?
Thank you,
Hi Santosh,
When using TFS or other make sure you don`t chekin or checkout configuration changes as config files are relating to database changes. It is recommended to take the latest config files manually. When you create new news item the configuration files are checked and then compared to the database if there is no difference the information in the database is applied(config file is updated) and executed. Another alternative is saving configurations in the database.
Greetings,
Stanislav Velikov
the Telerik team
Hi Stanislav -
This solution works fine for a single-user environment, but falls apart when multiple developers need to work on the same project. Do you have any recommended solutions for this scenario? We've ended up removing the project from source control due to the number of issues encountered relating to this.
Thanks,
Greg
Hi Stanislav,
When you say that I should not checkout the configuration files, it leads me to the same issue where I cannot edit a page/ I get an error message as it will be locked by TFS. So, basically to overcome this error message I had to checkout the configuration files for editing and then only I was able to change the page properties.
So, this means as a developer I am making changes to the configurations files, the other question that arises is do we need to check-in these changed configuration files into source control. And above Ivan, suggested that we should get the latest version of the files from source control before working on a project. Sorry, if I misunderstood what was conveyed above. All this seems a little confusing. Can you please let me know what do you mean by getting configuration files manually?
Thank you for all your time.
Hi All,
We are also facing this Access Denied issue in our web farm environment.
In our case , as a firm policy we can not have App_Data folder writable under IIS , also we cant configure IIS to any other local directory for App_Data folder(as suggested in this post http://www.sitefinity.com/devnet/forums/sitefinity-sdk/change-app-data-location ).
Any help regarding this is much appreciated. What other options do we have in order to work around this?
One thought - Can we have App_Data folder moved to some network location(without configuring in IIS) and refer it from there, any configuration settings to do so ?
Thanks,
Chetan