Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 4.x > Installation and deployment > Changing licence and SQL error View modes: 
User avatar
Member
Member
francois.voeltzel-sedasis - 4/2/2009 4:32:42 PM
   
Changing licence and SQL error
Hello,

I've worked on a project with the trial licence, and changed it before expiration to a paid licence... I don't know what i've done wrong, but when i try to reach my localhost/(mysite), I've got an invalid domain page from kentico...telling me to go to Site manager to edit my licence information.

but the problem is when i go for it, i've an error page, and can't access the cmsdesk or the site manager :
Paste of the error message

[DataConnection.ExecuteQuery]: Query: Proc_CMS_Session_Update: caused exception: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CMS_Session_CMS_Site". The conflict occurred in database "InovahCMS", table "dbo.CMS_Site", column 'SiteID'.
The statement has been terminated.
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.Exception: [DataConnection.ExecuteQuery]: Query: Proc_CMS_Session_Update: caused exception: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CMS_Session_CMS_Site". The conflict occurred in database "InovahCMS", table "dbo.CMS_Site", column 'SiteID'.
The statement has been terminated.

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:


[Exception: [DataConnection.ExecuteQuery]: Query: Proc_CMS_Session_Update: caused exception: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CMS_Session_CMS_Site". The conflict occurred in database "InovahCMS", table "dbo.CMS_Site", column 'SiteID'.
The statement has been terminated.]
CMS.DataProviderSQL.DataConnection.ExecuteQuery(String queryText, Object[,] queryParams, QueryTypeEnum queryType) +807
CMS.DataProviderSQL.DataConnection.CMS.IDataConnectionLibrary.IDataConnection.ExecuteQuery(String queryText, Object[,] queryParams, QueryTypeEnum queryType) +13
CMS.DataEngine.GeneralConnection.ExecuteQuery(String queryText, Object[,] parameters, QueryTypeEnum queryType, Boolean transaction) +171
CMS.CMSHelper.SessionInfo.Update() +910
CMS.CMSHelper.SessionManager.UpdateCurrentSession() +875
CMS.UIControls.SiteManagerPage.SiteManagerPage_PreInit(Object sender, EventArgs e) +36
System.Web.UI.Page.OnPreInit(EventArgs e) +8698174
CMS.UIControls.CMSPage.OnPreInit(EventArgs e) +83
System.Web.UI.Page.PerformPreInit() +31
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282


How can i recover the site without having access to the site manager and cmsdesk ??

Thanks for your help

Francois

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/3/2009 2:13:09 AM
   
RE:Changing licence and SQL error
Hi,

Unfortunately, this seems to be a bug in the current version. I'm very sorry for this inconvenience. We will try to fix it in the nearest version. Here is the workaround: could you please turn off this setting in: 'Site Manger -> Settings -> select_your_site -> Membership -> Store online users in database'. When there is no site running, there is problem with it. After you start the web site, you can turn it on again.

If you are not able to logon to Site Manager, you can change this setting in DB: CMS_SettingsKey table, by default it is KeyID 152 and KeyName "CMSSessionUseDBRepository", please change the KeyValue to FALSE.

You may need to restart the application after this change.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
rmontgomery-experior-solutions - 6/3/2009 11:09:36 PM
   
RE:Changing licence and SQL error
I am having this exact problem as well. Although I wasn't changing my license, I was just poking around the images in a files folder on my site. Out of nowhere my entire content node is gone, and when I go to the admin area I get the same message as above.

[DataConnection.ExecuteQuery]: Query: Proc_CMS_Session_Update: caused exception: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CMS_Session_CMS_Site". The conflict occurred in database "{databaseName}", table "dbo.CMS_Site", column 'SiteID'.
The statement has been terminated.

What does this mean? I looked in the database and I don't see a conflict. There is only one site and only my session. The identities seemed in order.

Any ideas?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/4/2009 4:28:58 AM
   
RE:Changing licence and SQL error
Hi,

Have you tried the suggestions mentioned above? Could you please check if the site is running? This problem occurs if there is no site running in the CMS.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
rmontgomery - 6/4/2009 7:41:25 AM
   
RE:Changing licence and SQL error
Sorry - I just wiped the database and am going through installation again (3rd time now with same error randomly showing up)

Is there anything I can turn on like advanced logging or something to help diagnose the problem should it happen again?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/5/2009 1:40:28 AM
   
RE:Changing licence and SQL error
Hi,

You can check the Event Log in Site Manger -> Administration for any exceptions.
Moreover, you can turn the debug mode on in web.config file by setting the "debug" property to true. This can have impact on the performance so it is recommended to use only in development to see more detailed error messages.

Best Regards,
Juraj Ondrus