I'm migrating an Umbraco instance from demo (IIS6, Win2003 Server) to live server (IIS7, Win2008 R2). I've transferred the files over and restored the database to the new server. However, when I run the site I get the following permissions error:
Server Error in '/' Application.
Access to the path 'D:\sites\myserver\www.mydomain.com\web\data\umbraco.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:\sites\myserver\www.mydomain.com\web\data\umbraco.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) 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.
To grant ASP.NET access to a file, right-click the file in
Explorer, choose "Properties" and select the Security tab. Click "Add"
to add the appropriate user or group. Highlight the ASP.NET account, and
check the boxes for the desired access.
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[UnauthorizedAccessException: Access to the path 'D:\sites\myserver\www.mydomain.com\web\data\umbraco.config' is denied.] System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +10546931 System.IO.File.SetAttributes(String path, FileAttributes fileAttributes) +190 umbraco.content.ClearDiskCache() in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\presentation\content.cs:655 umbraco.content.LoadContent() in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\presentation\content.cs:699 umbraco.content.get_XmlContentInternal() in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\presentation\content.cs:130 umbraco.content.get_XmlContent() in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\presentation\content.cs:99 umbraco.UmbracoDefault.Page_PreInit(Object sender, EventArgs e) in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\presentation\default.aspx.cs:113 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Page.OnPreInit(EventArgs e) +11041726 System.Web.UI.Page.PerformPreInit() +42 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1256
Now, I've been through all the relevant folders and the web.config file on the new installation, and granted full permissions to the network service user on this installation (at least I think it's the network service user - how do I tell?) Still the error happens. I even ran the permissions script here as a command to make sure permissions are set okay. I've set the app pool to run as NetworkService on this domain too.
The odd thing is that if I point the database connection back to the demo server, the site loads fine, so I'm wondering if this is more related to permissions on the database user - although having said that, it's not a database connection error - it can connect fine to the new database.
This is just a funny idea, but maybe try to delete the umbraco.config file? If you copied it over from the other server it might have some ugly permissions that it does't need and whatnot. I think if you delete it it will be re-created automatically, maybe that mystically solves the problem.
Otherwise the user you need give access to is the identity of the app pool which you say you have set to network service, so that should be all good. The IUSR would also need access I guess. In .Net 2 there was also the ASPNET user who needed access, don't know how that is with .Net 4.
Very odd that it works fine if you switch to the old database, that's quite interesting, though I don't see how the database user permissions could produce this error.
Thanks Sascha - that didn't work unfortunately though. I've just scrapped it, installed from Web Platform Installer, then copied everything over again. A few database tweaks and it works now. Thanks for your help anyhow.
Permissions clarification
Hi,
I'm migrating an Umbraco instance from demo (IIS6, Win2003 Server) to live server (IIS7, Win2008 R2). I've transferred the files over and restored the database to the new server. However, when I run the site I get the following permissions error:
Server Error in '/' Application.
Access to the path 'D:\sites\myserver\www.mydomain.com\web\data\umbraco.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:\sites\myserver\www.mydomain.com\web\data\umbraco.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) 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.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Now, I've been through all the relevant folders and the web.config file on the new installation, and granted full permissions to the network service user on this installation (at least I think it's the network service user - how do I tell?) Still the error happens. I even ran the permissions script here as a command to make sure permissions are set okay. I've set the app pool to run as NetworkService on this domain too.
The odd thing is that if I point the database connection back to the demo server, the site loads fine, so I'm wondering if this is more related to permissions on the database user - although having said that, it's not a database connection error - it can connect fine to the new database.
Confused! Can anyone put me right?
Thanks
Should have hyperlinked permissions script to this page: http://our.umbraco.org/wiki/install-and-setup/set-umbraco-folder-permissions-from-command-line but won't let me edit my post.
This is just a funny idea, but maybe try to delete the umbraco.config file? If you copied it over from the other server it might have some ugly permissions that it does't need and whatnot. I think if you delete it it will be re-created automatically, maybe that mystically solves the problem.
Otherwise the user you need give access to is the identity of the app pool which you say you have set to network service, so that should be all good. The IUSR would also need access I guess. In .Net 2 there was also the ASPNET user who needed access, don't know how that is with .Net 4.
Very odd that it works fine if you switch to the old database, that's quite interesting, though I don't see how the database user permissions could produce this error.
Thanks Sascha - that didn't work unfortunately though. I've just scrapped it, installed from Web Platform Installer, then copied everything over again. A few database tweaks and it works now. Thanks for your help anyhow.
is working on a reply...