YAFLogo

Gofer01
  • Gofer01
  • 100% (Exalted)
  • YAF Commander Topic Starter
10 years ago
I'm getting this error on a new install. Is there any solutions on repairing this bug?

Server Error in '/' Application
-------------------------------------------------------------------------------

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_yaf_BBCode_Board". The conflict occurred in database "DB_28845_yaf", table "dbo.yaf_Board", column 'BoardID'.
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.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_yaf_BBCode_Board". The conflict occurred in database "DB_28845_yaf", table "dbo.yaf_Board", column 'BoardID'.
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:


[SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_yaf_BBCode_Board". The conflict occurred in database "DB_28845_yaf", table "dbo.yaf_Board", column 'BoardID'.
The statement has been terminated.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +404
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2660
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6431293
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +6432994
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +538
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +689
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +327
YAF.Classes.Data.MsSqlDbAccess.ExecuteNonQuery(IDbCommand cmd, Boolean transaction) +322
YAF.Classes.Data.LegacyDb.bbcode_save(Object bbcodeID, Object boardID, Object name, Object description, Object onclickjs, Object displayjs, Object editjs, Object displaycss, Object searchregex, Object replaceregex, Object variables, Object usemodule, Object moduleclass, Object execorder) +758
YAF.Classes.Data.Import.DataImport.BBCodeExtensionImport(Int32 boardId, Stream imputStream) +1421
YAF.Install._default.UpgradeDatabase(Boolean fullText) +451
YAF.Install._default.Wizard_NextButtonClick(Object sender, WizardNavigationEventArgs e) +559
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +586
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707





Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Michael
My Website 
Sponsor

squirrel
10 years ago
I think this is related to "Import/Upgrade BBCode Extensions" option during setup. If this is a fresh install, leave the box unchecked - I would have to research more to be sure, but that might be a quick option to try on your install --
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
alpha6789
10 years ago
I have the same "FOREIGN KEY" issue. I was running the installation through source code. The problem
in funciton DataImport.BBCodeExtensionImport,

LegacyDb.bbcode_save(
null,
boardId,
row["Name"],
row["Description"],
row["OnClickJS"],
row["DisplayJS"],
row["EditJS"],
row["DisplayCSS"],
row["SearchRegex"],
row["ReplaceRegex"],
row["Variables"],
Convert.ToBoolean(row["UseModule"]),
row["ModuleClass"],
row["ExecOrder"]);

This function is to call the stored procedure bbcode_save. The first argument is bbcodeID, which is null, violates the FOREIGN KEY restriction.
squirrel
10 years ago
This is issue when 'Upgrade BBCode Extensions' is checked in the installer when installing a 'new forum' and not upgrading. It is fixed in the repository to not allow the checkbox on new install. Fix will be in next release.
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
wcraig
  • wcraig
  • 50.2% (Neutral)
  • YAF Forumling
10 years ago
Originally Posted by: squirrel 

This is issue when 'Upgrade BBCode Extensions' is checked in the installer when installing a 'new forum' and not upgrading. It is fixed in the repository to not allow the checkbox on new install. Fix will be in next release.



Which box do I check? When I go to install/default.aspx, there is no such box during the process.
squirrel
10 years ago
Originally Posted by: wcraig 

Originally Posted by: squirrel 

This is issue when 'Upgrade BBCode Extensions' is checked in the installer when installing a 'new forum' and not upgrading. It is fixed in the repository to not allow the checkbox on new install. Fix will be in next release.



Which box do I check? When I go to install/default.aspx, there is no such box during the process.



What version of YAF are you trying to install? -- the two checkboxes appear on the screen right before you click to 'update the database' --
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
wcraig
  • wcraig
  • 50.2% (Neutral)
  • YAF Forumling
10 years ago
Wow I feel like a total idiot now. The box was right there before I installed the database, I guess I was just blindsided by the "attempt to install full-text searching" box. Thanks for the help, I'm going to go hang my head in shame now.
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button