0

I was trying to set the parent case on two cases, and got an error. Now when I try to set the parent case of the second of the two cases I get this error. Is there a way to fix my database?

FogBugz Internal Error
An internal error occurred in FogBugz. If you are unsure of how to fix this error, and you have made no changes to the source code of FogBugz, please report this error to Fog Creek Software by clicking "Submit."

Error:  Duplicate entry '109' for key 'PRIMARY'
SQL: INSERT INTO FBLock (sLock, sKey) VALUES (?, '')
Params: S
1: NestedSetRoot_98
Stack Trace:    Show Stack TraceHide Stack Trace

Wasabi.Runtime.WasabiException (0x80004005): Duplicate entry '109' for key 'PRIMARY'
SQL: INSERT INTO FBLock (sLock, sKey) VALUES (?, '')
Params: S
1: NestedSetRoot_98
 MySql.Data.MySqlClient.MySqlException: Duplicate entry '109' for key 'PRIMARY'
  at MySql.Data.MySqlClient.MySqlStream.OpenPacket () [0x00000] 
  at MySql.Data.MySqlClient.NativeDriver.ReadResult (System.UInt64& affectedRows, System.Int64& lastInsertId) [0x00000] 
  at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet () [0x00000] 
  at MySql.Data.MySqlClient.MySqlDataReader.NextResult () [0x00000] 
  at Wasabi.Runtime.Error.Raise (Int32 number, System.String source, System.String description, System.String helpfile, Nullable`1 helpcontext) [0x00000] 
  at FogCreek.FogBugz.CCmd.ExecuteNonQuery (Nullable`1 nCacheClearLevel) [0x00000] 
  at FogCreek.FogBugz.CLock.EnsureOneRow (System.String sLock) [0x00000] 
  at FogCreek.FogBugz.CLock.GetLock (System.String sLock, Int32 cSecondsValid, System.Boolean& fBrokeLock, Nullable`1 fForceTake) [0x00000] 
  at FogCreek.FogBugz.CLock.GetLockOrSpin (System.String sLock, Int32 cSecondsValid, System.Boolean& fBrokeLock, Int32 cSecondsSpin) [0x00000] 
  at FogCreek.FogBugz.BugOutlineUpdate.GetLockForRoot (Int32 ixRoot) [0x00000] 
  at FogCreek.FogBugz.BugOutlineUpdate.AppendToParent (Int32 ixBug, Int32 ixBugParent) [0x00000] 
  at FogCreek.FogBugz.CBug.CommitNewParent () [0x00000] 
  at FogCreek.FogBugz.CBug.CommitBug (Int32 ixPerson, Nullable`1 fCleaned, FogCreek.FogBugz.CBugEvent bugevent) [0x00000] 
  at FogCreek.FogBugz.CBug.CommitBugWithEvent (BugAction nBugAction, System.String sPathToUploadedFile, FogCreek.FogBugz.CBugEvent bugevent, Nullable`1 fPublic) [0x00000] 
  at FogCreek.FogBugz.CBug.Edit (Int32 ixPerson, System.String sEvent, System.String sPathToUploadedFile, Boolean fFormatEventAsEmail, Boolean fAutoCreated, Boolean fResolveChildrenIfParentResolved, Wasabi.Runtime.Mail.MailMessage msgEmail) [0x00000] 
  at (wrapper remoting-invoke-with-check) FogCreek.FogBugz.CBug:Edit (int,string,string,bool,bool,bool,Wasabi.Runtime.Mail.MailMessage)
  at FogCreek.FogBugz.__Global.SubmitBug (System.Boolean& fNewBug, System.String& sCommand, System.Boolean& fCancel, System.String& sErrorFileTooLong, System.String& sErrorFileNotFound, System.String& sError, System.String& sWarnTitle, System.String& sWarnBody, System.String& sWarnAttachment, System.Int32& ixScreenshotTry, Boolean fAlaCarte, Boolean fActionTokenOK) [0x00000] 
  at FogCreek.FogBugz.__Global.RawpreSubmitBug () [0x00000] 
  at FogCreek.FogBugz.__Global.preSubmitBug () [0x00000] 
  at FogCreek.FogBugz.__Global.RunPre () [0x00000] 
  at FogCreek.FogBugz.__Global.RawRunFogBugz () [0x00000] 
  at FogCreek.FogBugz.__Global.RunFogBugz () [0x00000] 
  at FogCreek.FogBugz.__Global.StartDefault () [0x00000] 
  at FogCreek.FogBugz.HttpHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] 

Browser:    Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.2.8) Gecko/20100723 Linux Mint/8 (Helena) Firefox/3.6.8

Update

I found this in the administration page that looks like the original error received when trying to set the parent case:

23/10/2010 12:55 (GMT+01:00): System.Threading.ThreadAbortException: Thread was being aborted
  at FogCreek.FogBugz.CCmd.ExecuteNonQuery (Nullable`1 nCacheClearLevel) [0x00000]
  at FogCreek.FogBugz.CLock.ReleaseLock (System.String sLock, System.String sKey) [0x00000]
  at FogCreek.FogBugz.CDbSession.ReleaseWriteLock (System.String sSessionId, System.String sKey) [0x00000]
  at FogCreek.FogBugz.CDbSession.Commit () [0x00000]
  at FogCreek.FogBugz.__Global.DbSessionCommit () [0x00000] 

Thanks

Richard

flag

2 Answers

0

This looks like database corruption. REPAIR TABLE or similar may work, but I'd consult the MySQL documentation (or an expert) first.

link|flag
Thanks for the reply. Fogbugz eventually sorted itself out. I did try this while I was still having problems: mysql> check table FBLock; +----------------+-------+----------+----------+ | Table | Op | Msg_type | Msg_text | +----------------+-------+----------+----------+ | fogbugz.FBLock | check | status | OK | +----------------+-------+----------+----------+ 1 row in set (0.01 sec) – richj Oct 26 2010 at 21:54
0

Eso me paso a mi, lo que pasaba es que en la tabla donde tengo las llaves foraneas tengo como index los campos foraneos, pero en el Index Type lo tenia como Unique y lo cambie a Normal y se soluciono el problema.

Suerte

link|flag
Es un poco dificil comprender su respuesta en español. ?Puedes escribirla en ingles? (Perdon, no tengo las letras especiales en mi ThinkPad.) – Zian Choy May 25 2011 at 3:24

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.