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

Forums / Set-up & Installation / Database errors + Null ref exceptions

Database errors + Null ref exceptions

5 posts, 0 answered
  1. Dilyan
    Dilyan avatar
    3 posts
    Registered:
    06 Dec 2008
    05 Feb 2009
    Link to this post
    Hello!

    I've been trying to run Sitefinity for some time, and it seems that problems do like me (or Vista ?). I handled the most of them myself, but a few remain and I can't do it myself.

    Here is what happens:
    - when I run a local project, there seems to be an error in the first-time configuration, .i.e. a database error. The error message depends on the way the project is created:
        - through the wizard: "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed." . I followed the steps in the troubleshooting - enabled browsing and added two exceptions to the firewall. Still the same. I tried the obvious : Control Panel->User Accounts->Configure advanced user profile properties->Chage type... . Here only "local profile" is enabled. I have no idea what this means but it seems this is what it compains about.
        - manually (dowloading the empy project .zip - not the one in the project manager folder - and adding it to the IIS): "There was an error trying to connect to the Database Server:
    User does not have permission to perform this action." .I don't get this either - it doesn't work even when I run the browser as administrator. It seems that Sitefinity uses the following conneciton string (copied from IIS): "Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Sitefinity.mdf", and the default one is "data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true". I don't know what User Instance means as I haven't used it, but I will certainly look it up. I believe it is the culprit here.
      - the example university site. There is something very weird about it. When I "browse" it, it displays "under construction". When I try to edit it, I get the null ref exception. The stack trace it gives me is : "
    [NullReferenceException: Object reference not set to an instance of an object.]
       Telerik.Personalization.PersonalizationManager.get_ProvidersSettings() +6
       Telerik.ManagerBase`1.Initialize() +372
       Telerik.ManagerBase`1..ctor(String providerName) +21
       Telerik.ManagerBase`1..ctor() +11
       Telerik.Personalization.PersonalizationManager..ctor() +5
       Telerik.Personalization.PersonalizationManager..cctor() +21
    
    [TypeInitializationException: The type initializer for 'Telerik.Personalization.PersonalizationManager' threw an exception.]
       Telerik.Personalization.PersonalizationManager.get_DefaultInstance() +0
       Sitefinity_Default.Page_Load(Object sender, EventArgs e) +39
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
    
    ". I checked the only .master I found, and it seemed pretty fine to me. The other suggestions in the troubleshooting guide seemed not in the point to me. What is the most weird, however, is that if I ran the project through VS, it would run just fine, an exact copy of the example site here, on sitefinity.com. As is expected, I guess. The funny thing is that it displayes the non-existent "Home.aspx" by default. And that is after an eternity of compilation.

    I would very much like to actually see what sitefinity is. Thanks for your help in advance.
    Dilyan Rusev
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Feb 2009
    Link to this post
    Hello Dilyan,

    The account under which you are trying to create a user instance of SQL Express does not have a local profile on the server. To fix this you need to locally login using that account or adjust your impersonation settings on the application. You can also change the connection string. When you are working in VS you are using an account that have a local profile and the problem does not exist. Probably, you are running SQL Server as  NETWORK SERVICE account.

    Try the following.

    1. Create a new DB - let say Sitefinity35 using SQl Server Management Studio.

    2. After you have created the database, expand the tree view of the Database and go to Security >> Users. Then, add a new user - for example, you could add NETWORK SERVICES. Please set this user as dbo for "Schemas owned by" and "Database Role membership"

    3. Create a new virtual directory under Default Website in IIS. Let's call it SitefinityVD and point it to the physical files of Sitefinity. Set ClassicMode application pool instead of the Default one.

    4. Run the project. After a few steps you will be prompted to enter your DB information. Here enter your DB name( Sitefinity35) and your server name. Check Windows Authentication checkbox. If you want you could create a different user in SQL Management Studio and use its credentials here instead of Windows Authentication method.

    Finally you should have the following connection string

    <add name="Sitefinity" connectionString="data source=SERVER_NAME_HERE;Integrated Security=SSPI;initial catalog=Sitefinity35" 
          providerName="System.Data.SqlClient" /> 

    I hope this helps.

    Regards, Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Dilyan
    Dilyan avatar
    3 posts
    Registered:
    06 Dec 2008
    06 Feb 2009
    Link to this post
    Thank you for your quick response!.

    Well, problems do like me. This one is solved, another popped - I can't go through the login screen. If I enter invalid credentials, it gives the proper error message. When I enter the correct username and password, I'm prompted to log in yet again.This could go on forever.

    The TIU site still dosn't work at all. Under construction when browsed, NullReferenceException when edited.

    Cookies are enabled. I am using Vista Business 64-bit (although for .NET it shouldn't matter at all), with .NET 3.5 SP1 installed.

    Dilyan Rusev
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Feb 2009
    Link to this post
    Hi Dilyan,

    Run the website under Classic pipeline mode. Also enable 32 bit application support for the Application poolin IIS, I am not sure what the problem could be. It is related to the installation you have set up.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Dilyan
    Dilyan avatar
    3 posts
    Registered:
    06 Dec 2008
    06 Feb 2009
    Link to this post
    Thanks for your reply again.

    I have already done these. They are written in the user manual, so I followed them to the letter. I am convinced that I have done something wrong, I just don't have a clue. If I somehow succeed, I will post the solution here.

    Dilyan Rusev
Register for webinar
5 posts, 0 answered