0

We have had a huge email get sent to Fogbugz (body sHTML >43,000 chars) and it is causing a timeout. Obviously, we have addressed the cause but the case persists and after trying

UPDATE FogBugz.BugEvent 
SET sVerb = 'Removed', ixPerson = -1, s = '', sHTML = '' 
WHERE ixBugEvent = xxxx;

we're getting this error below when clicking on the case to try and close it.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Wasabi.Runtime.Mail.MailMessage.ParseSimpleEmail(String email) in e:\code\licensed\build\FB\8.7.61L\wasabi\Wasabi.Runtime\Mail\MailMessage.cs:line 175
   at FogCreek.FogBugz.CBugEvent.ParseEmail() in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\CBugEvent.was:line 557
   at FogCreek.FogBugz.CBugEvent.GetEventText(Function`2 fxnEmail, Function`2 fxnHtml, Function`2 fxnText) in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\CBugEvent.was:line 1096
   at FogCreek.FogBugz.CBugEvent.GetSafeHtml() in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\CBugEvent.was:line 1087
   at FogCreek.FogBugz.__Global.Lambda_BugEventDisplayArray_67.__Run(CBugEvent ev) in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\dlgBugEditing.was:line 1870
   at FogCreek.FogBugz.__Global.BugEventContentBuilder(Function`2 fxnGetContent, Function`3 fxnPluginHook, CBugEvent[] rgEvent) in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\dlgBugEditing.was:line 1855
   at FogCreek.FogBugz.__Global.BugEventDisplayArray(CBug bug, CBugEvent[] rgevent) in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\dlgBugEditing.was:line 1881
   at FogCreek.FogBugz.__Global.BugViewBugEvents(String sCommand, Boolean fMultipleBugs, String sBugs, WasabiDictionary`1 oViewMap, CBug oBug, Boolean fOrderAscending, Boolean fShowLastEvent, Boolean fAllEvents, Nullable`1 fOnlyMissing, String sMiniGridId) in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\dlgBugEditing.was:line 1672
   at FogCreek.FogBugz.__Global.RenderEntireBug(CBug c, CPerson cp, String sCommand, Boolean fMultipleBugs, String sBugs, String[] rgBugs, Int32 ixBugEventLatest, Int32 ixDiscussTopic, Int32 ixScreenshot, Boolean bCanWriteAllBugs, Boolean fShowLastEvent, Int32 ixPersonLastOwner, String sDefaultText, Function`1 fxHTMLPluginTop, Function`1 fxHTMLPluginLeft, Function`1 fxHTMLPluginLink, Int32 ixBugEvent, String sMiniGridId) in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\editBug2.was:line 906
   at FogCreek.FogBugz.__Global.EditBugPage(String sCommand, Int32 ixBugEventLatest, Int32 ixDiscussTopic, Boolean fShowLastEvent, Boolean fNewBug, Int32 ixScreenshot) in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\editBug2.was:line 1116
   at FogCreek.FogBugz.__Global.RawpgEditBug() in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\default.was:line 3185
   at FogCreek.FogBugz.__Global.pgEditBug() in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\_Generated.was:line 1360
   at FogCreek.FogBugz.__Global.RunPg() in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\_Generated.was:line 3035
   at Wasabi.Runtime.Web.Response.PictureOf(Sub sub) in e:\code\licensed\build\FB\8.7.61L\wasabi\Wasabi.Runtime\ResponseGenerator.cs:line 24
   at FogCreek.FogBugz.__Global.RawRunFogBugz() in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\default.was:line 4467
   at FogCreek.FogBugz.__Global.RunFogBugz() in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\_Generated.was:line 2341
   at FogCreek.FogBugz.__Global.StartDefault() in e:\code\licensed\build\FB\8.7.61L\fogbugz\src-Website\default.was:line 128
   at FogCreek.FogBugz.HttpHandler.ProcessRequest(HttpContext context) in c:\Users\svc-mortar\AppData\Local\Temp\vod4xk7s.0.cs:line 0
flag

1 Answer

2

The UPDATE statement you show above has cleared out the content, but FogBugz still thinks it has a cached copy of the email's content in sHTML. So, when the "parse the cached copy of an email" code runs, it fails because where the cached copy used to be, there is now only an empty string.

There are two things you can try:

  1. Run UPDATE FogBugz.BugEvent SET fHTML = 0 WHERE ixBugEvent = xxxx; and then try viewing that case. This flag will tell FogBugz to try and re-parse the email (instead of trying to parse the non-existent cached copy). This still may not work, however, as the original source of the email is also gone.

  2. If the above fails, your best bet is probably to mark the problem BugEvent as no longer being an email event at all: UPDATE FogBugz.BugEvent SET fEmail = 0, sVerb = 'Edited' WHERE ixBugEvent = xxxx;

link|flag
Point 1 worked - Thanks. – MikeC May 17 2012 at 0:54

Your Answer

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