+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / Read-Only DB Error with Vista

Read-Only DB Error with Vista

17 posts, 0 answered
  1. Ian
    Ian avatar
    7 posts
    Registered:
    16 Feb 2008
    17 Feb 2008
    Link to this post
    I'm getting a little frustrated. After jumping through a bunch of hoops to get the CMS to even launch, now I get an error any time I try to access the JobsIntraSite.

    It says the database is read-only, I've made sure that Read Only is not checked in file properties and I'm not sure what else to do.

    Failed to update database "C:\PROGRAM FILES\TELERIK\SITEFINITY3.1\JOBSINTRASITE\APP_DATA\SITEFINITY.MDF" because the database is read-only.

    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.Data.SqlClient.SqlException: Failed to update database "C:\PROGRAM FILES\TELERIK\SITEFINITY3.1\JOBSINTRASITE\APP_DATA\SITEFINITY.MDF" because the database is read-only.

  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    18 Feb 2008
    Link to this post
    Hello Ian,

    Please make sure that the ~/App_Data folder is not read-only. Also, check if you have granted full permissions to the "Network Service” account for the same folder.

    Do let us know how it goes.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Ian
    Ian avatar
    7 posts
    Registered:
    16 Feb 2008
    18 Feb 2008
    Link to this post
    The Network Service has full access and the folders aren't Read-Only and now I get this error:

     

     

    Server Error in '/telerik/JobsIntraSite' Application.

    User does not have permission to perform this action.

    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.Data.SqlClient.SqlException: User does not have permission to perform this action.

    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:

    [SqlException (0x80131904): User does not have permission to perform this action.]
       Nolics.ORMapper.DataProviders.SQLDataProvider.Open() +121
       Telerik.DataAccess.NolicsHelper.SetConnection(String connectionName, String providerName) +604
       Telerik.DataAccess.AspnetProviders.TelerikRoleProvider.Initialize(String name, NameValueCollection config) +376
       System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType) +411
    
    [TypeInitializationException: The type initializer for 'Telerik.Localization.LocalizationManager' threw an exception.]
       Telerik.Localization.LocalizationManager.get_PersistenceMode() +0
       Telerik.Cms.Web.CmsHttpModule.SetCurrentCulture(HttpContext context, String& path, String query, Boolean& redirected) +34
       Telerik.Cms.Web.CmsHttpModule.BeginRequest(Object sender, EventArgs e) +1224
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
    

  4. Ian
    Ian avatar
    7 posts
    Registered:
    16 Feb 2008
    18 Feb 2008
    Link to this post
    OK, so I have no idea how your system is trying to connect to the database. I've tried manually attaching the database and resetting the connectionString accordingly and I get an error for MUIRTOP\IWAM_MUIRTOP. I added that login and made it a dbowner and I still get errors.

    So I used the Database Publishing Wizard to script the DB and remake it with sercurity configurations that I know work and I still get issues.

    This is the section that always seems to throw the error:

    Line 31:     Assembly assembly = typeof(Job).Assembly;
    Line 32:     DataConnection.Initialize(false, assembly);
    Line 33:     OdbDataProvider provider = NolicsHelper.SetConnection("DefaultConnection", "Jobs");
    Line 34:     //Upgrade the database with the defined data objects for the Jobs module.
    Line 35:     provider.Upgrade();

    Source File: c:\Program Files\telerik\Sitefinity3.1\JobsIntraSite\App_Code\JobsModule.cs    Line: 33
  5. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    19 Feb 2008
    Link to this post
    Hello Ian,

    We need more information about your database configuration in order to assist you:
    1. Can you establish a successful connection to the SQLExpress database with other applications? If no, we would recommend you reinstall SQL Express on your machine.
    2. Did you attach theJobsIntraSite database (.mdf file) through the Management Studio? If yes, did you change the connection string and did you add the "Network Service” account as a dbowner of the database? Also, did you try to connect to a remote or local database?

    If the issue still persists after you try the above, please give us a Remote Desktop Connection to your machine so that we can localize the problem.

    t,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. steeeeeeeeeee
    steeeeeeeeeee avatar
    8 posts
    Registered:
    15 Nov 2006
    29 Feb 2008
    Link to this post
    I am having a similar problem to this.

    However my sytem is as follows:

    Windows XP with IIS 5.1
    SQL Server 2005
    and VS.NET 2005

    All I have done in the way of setup is run the installer for sitefinity.

    In the installationguide pdf you mention several steps that must be taken if installing on vista, but I assume this is not needed on XP? as I have tried to follow the IIS stuff but it does not make any sence in IIS 5.1.

    when I run the sitefinity shortcut I get the 'project manager' screen but when I try to browse or admin the sites I get the Error:

    Failed to update database "C:\PROGRAM FILES\TELERIK\SITEFINITY3.1\JOBSINTRASITE\APP_DATA\SITEFINITY.MDF" because the database is read-only.

    I have made sure the data folders are not read only (which they were) and I have set the permissions in IIS on that folder so that you can write as well as read.

    What else must I do?
  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    29 Feb 2008
    Link to this post
    Hello Stephen,

    Here are the steps that should solve your problem :

    1. Make sure the user that runs the ASPNET working process (ASPNET or NETWORK SERVICE account) has Full Control permissions on the ~/[YourProject]/App_Data directory.
    2. Run IISRESET to restart IIS to refresh its permissions.

    Let us know if your problems persist.

    All the best,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. steeeeeeeeeee
    steeeeeeeeeee avatar
    8 posts
    Registered:
    15 Nov 2006
    29 Feb 2008
    Link to this post

    sorry, feel really dumb to ask but where exactly do I set full control?

    thanks!

  9. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    29 Feb 2008
    Link to this post
    Hello Stephen,

    Don't feel "really dumb to ask", probably it is our mistake not to explain really clear. We apologize for that.

    Here is how to enable the ASPNET user account and give it full permissions in IIS v5.1, explained in more detail: 
    1. Right-click on the folder where you have installed your application and select Properties.
    2. Click on the Security tab. If you do not see the security tab, go to step 3. Otherwise, go to step 7.
    3. The Security tab is not visible because you have Simple File Sharing enabled. You will need to disable it before you continue. To disable it, open a Windows Explorer.
    4. On the Tools menu, click Folder Options, and then click the View tab. In the Advanced Settings section, clear the Use simple file sharing (Recommended) check box (at the bottom of the list).
    5. Click OK.
    6. Right-click on the folder where your project is and select Properties. Click on the Security tab.
    7. Click on Add (to add a new user).
    8. Click on Locations and make sure your machine is selected.
    9. Type ASPNET in the text box and click on Check Names. ASPNET should underline (if it doesn't, then you don't have Microsoft's .NET framework installed).
    10. Click OK.
    11. Select the account ASPNET check the Full Control box to give it full permissions.
    12. Click OK.
    If you still get the same error, do the same for the Network Service account.
    I hope everything will be alright this time. If not, don't hesitate to contact us again.

    Thank you for your interest in Sitefinity!
    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. steeeeeeeeeee
    steeeeeeeeeee avatar
    8 posts
    Registered:
    15 Nov 2006
    29 Feb 2008
    Link to this post

    Hi,

    Thank you very much for your help.

    However I seam to have created a new problem during tinkering :(

    now I cannot even get the project manager screen! The error I get is:

    Failed to access IIS metabase.

    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.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.

    The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.

    I looked at the link it provides but it wasnt making much sence to me.

    Have you seen this problem before?

    thanks again

    Ste

  11. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    04 Mar 2008
    Link to this post
    Hi steeeeeeeeeee,

    Now I get the situation completely. This is happening because you have installed .NET framework after IIS. The ASPNET account is created when .NET framework is installed, so basically the IIS doesn't know that the aspnet account even exists. Therefore we have to "link" aspnet account with IIS.
    Open the command prompt by clicking "Start-> Run" , typing CMD and pressing Enter. Now, you have to go to the directory where .NET Framework 2.0 is installed, using cd command. Type :

    cd windows\Microsoft.NET\Framework\v2.0.50727

    The underlined text is the path to your .NET framework 2.0 directory. Press enter, and type again :

    aspnet_regiis -ga aspnet

    Now you have to reset IIS by running the iisreset command.

    This way, the ASPNET account should have access to the metabase file of IIS. Make sure that you have granted the ASPNET account access to your project directory following the steps we described in the previous posts. This should eliminate your problem.

    We apologize for this long posts-loop but the situation that you are in is kind of specific. We are ready to assist you further if there is still any problem.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  12. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    18 May 2008
    Link to this post
    hi Stephen,

    I tried your suggestion but I'm still getting the same error, please let me know how to fix it. Thanks.

     

    Server Error in '/XXX' Application.

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    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.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    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:

    [SqlException (0x80131904): An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
       Nolics.ORMapper.DataProviders.SQLDataProvider.Open() +121
       Telerik.DataAccess.NolicsHelper.SetConnection(String connectionName, String providerName) +528
       Telerik.DataAccess.AspnetProviders.TelerikRoleProvider.Initialize(String name, NameValueCollection config) +320
       System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType) +411
    
    [TypeInitializationException: The type initializer for 'Telerik.Localization.LocalizationManager' threw an exception.]
       Telerik.Localization.LocalizationManager.get_PersistenceMode() +0
       Telerik.Cms.Web.CmsHttpModule.SetCurrentCulture(HttpContext context, String& path, String query, Boolean& redirected) +34
       Telerik.Cms.Web.CmsHttpModule.BeginRequest(Object sender, EventArgs e) +1227
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
    
  13. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    19 May 2008
    Link to this post
    Hi Zubair,

    The error you get suggests that remote connections are currently not allowed for SQL Server. Please have a look at this article How to configure SQL Server 2005 to allow remote connections.

    Let us know if you need anyt further assistance.

    All the best,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  14. purushottam
    purushottam avatar
    2 posts
    Registered:
    09 Mar 2009
    09 Mar 2009
    Link to this post
    Hi,

    This post solved my problem... but we wanted to do this programatically...

    how can we give ASPNET user permissions programatically while deploying/developing web application using ASP.NET

    Please help mee.. this is urgent!!!

    Thanks,
    Purushottam
  15. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Mar 2009
    Link to this post
    Hi purushottam,

    Take a look at MSDN and here is a simple example:

            string path = "C:\\TEST"
            DirectorySecurity dirSec = Directory.GetAccessControl(path); 
            dirSec.AddAccessRule(new FileSystemAccessRule("DOMAIN\\ASPNET", FileSystemRights.Read, AccessControlType.Allow)); 
            Directory.SetAccessControl(path, dirSec); 

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  16. purushottam
    purushottam avatar
    2 posts
    Registered:
    09 Mar 2009
    09 Mar 2009
    Link to this post
    Hi Ivan,

    Thanks for your quick response...

    But this doesn't solve my problem.. because I don't know the path of the virtual directory in which the user is installing the applicaiton.

    I'm able to change these settings manually by right clicking on the Inetpub\wwwroot\website-virtualdirectory -> select security tab -> giving write access to this folder.

    so can you tell me how to update permisions of ASPNET user account settings for accesing database under App_Data folder.

    I'm using SQLExpress database and connection string in my app is like this :

    connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\sample.mdf; Integrated Security=SSPI;Trusted_Connection=true;User Instance=True"

    thanks,
    Purushottam
  17. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Mar 2009
    Link to this post
    Hi purushottam,

    But this doesn't solve my problem.. because I don't know the path of the virtual directory in which the user is installing the applicaiton.

    I cannot come up with a solution which sets rights over a unknown folder. You could try using Process Class

     
            Process p = new Process(); 
            p.StartInfo.FileName = "cacls.exe"
            p.StartInfo.Arguments = CommandLine; 
            p.StartInfo.RedirectStandardOutput = true
            p.StartInfo.UseShellExecute = false
            p.StartInfo.WindowStyle = ProcessWindowStyle.Minimized; 
            p.StartInfo.CreateNoWindow = true
     
            p.Start(); 


    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
17 posts, 0 answered